Tags:
create new tag
, view all tags

Question

I generated a template to be used for documenting the activities of one day:

---+ Activities of *%SERVERTIME{"$year-$mo-$day"}%* from topic %URLPARAM{"topicparent"}%

Write down your activities here...

------
__Back to:__ %URLPARAM{"topicparent"}%

This template is used to generate new topics like this:

*[[%SCRIPTURLPATH{"edit"}%/%WEB%/ServiceActivitiesIDXXXXXXXXXX?templatetopic=ActivitiesTemplate&topicparent=%TOPIC%&amp][New service-activities]]*

Now I want to generate a search that displayes all activity-topics

  • one after another (I don't want to use booview)
  • display the date in each activity-topic as heading
  • folowed by the content of each topic
  • but excluding the heading and the footer ("Back to...") of the topics.

I used

%SEARCH{ ".*" topic="%TOPIC%ID*" type="regex" nosearch="on" nototal="on" format="---++ $pattern(.*---\+ Activities of\s*([^\n]+) from.*) [[$topic][Details]]" }%

That works, but here I have to click on Details to get the specific topic-content.

I have no idea how to display the topic content within the search result as described above.

And help appreciated!

Environment

TWiki version: TWikiRelease04x00x04
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: SuSE 9.1
Web server: Apache2
Perl version:  
Client OS: SuSE 9.1
Web Browser: Firefox 1.5
Categories: Search

-- AlexanderScholler - 06 Sep 2006

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Try BookView!

-- FranzJosefSilli - 07 Sep 2006

I though I mentioned it, but actually didn't: I don't want to use BookView because (as mentioned above) want to exclude some information of the summarised topics.

-- AlexanderScholler - 08 Sep 2006

Ah, I see, but than I'm sorry that I can't help here. Peter! wink

-- FranzJosefSilli - 08 Sep 2006

You can use two patterns. This here is untested:

format="---++ $pattern(.*---\+ Activities of\s*([^\n]+) from.*) [[$topic][Details]]$n()$pattern(.*---\+ Activities of[^\n]+(.*?)__Back to:__.*)"

-- PeterThoeny - 08 Sep 2006

Thank you Peter for your excellent working regex! Now, I just have one more question on this topic:

Topics are added with ongoing IDs at the end of the topic-name. How can I achieve to order the topics listed in your search result by date - note that the topic order on sorting by IDs or by date may differ!

I see problems in achieving this. Perhaps, my approach of such a sortable day-book-application is completely wrong?

-- AlexanderScholler - 11 Sep 2006

See VarSEARCH on sort result options.

-- PeterThoeny - 11 Sep 2006

I know this documentation, but all possible values within the =order=-parameter are not suitable for my needs. I want to order by a regex-result. This regex would

  • searches for the date coming after "Activities of" within the headings
  • makes a substitution from $day.$mo$.$year to $year-$mo-$day to (because I use german date notation)

I don't see a possiblity to achieve this.

-- AlexanderScholler - 12 Sep 2006

OIC. If you would output the search result in a table you can use the table sorting feature of the TablePlugin to sort the result. But this is not possible in your case since you output plain text. I do not know how to do that besides including the date in the topic name (see MeetingMinutes example.)

-- PeterThoeny - 12 Sep 2006

Thank you Peter for your hint. You gave my confirmation that I didn't ignore some TWiki-features.

First, I did the activity-logging with a table and the EditTablePlugin. But due to limitation in formatting the text, I switched to the template-topic-design desribed above.

I will include the sort-criteria (here date) into the topic-name.

Perhaps, out of this support-question, a feature-request should be created, like: Request of ordering search results by the results of a regex-substition.

I myself did not request this feature because of my limited knowledge on TWiki. Perhaps Peter, you want to rethink this feature-request to post it in the Codev-Web.

-- AlexanderScholler - 14 Sep 2006

 
Change status to:
Topic revision: r10 - 2006-09-14 - AlexanderScholler
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.