Tags:
create new tag
, view all tags

Question

A co-worker is trying to dynamically generate a list of calendar events using a SEARCH. This should be possible but it's not working. I assume there's an ordering dependency problem somewhere.

%SEARCH{ search="META:FIELD.*?appt_start_date" topic="Event_*" nosearch="on" nototal="on" regex="on" 
    format="   * $formfield(appt_start_date) - $formfield(appt_subject)</br> "}%

The bullet list is created but Calendar (version 1.020) doesn't accept it. I assume it sees the SEARCH code instead.

I've tried with an INCLUDE; that doesn't work either.

I've read Sandbox/CalendarTable and Sandbox/CalendarEvent and added a query to Plugins/CalendarPluginDev.

Does anyone have a workaround or a patch?

Environment

TWiki version: unspecified
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Search, Plugins

-- VickiBrown - 15 Dec 2008

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.

See working example I posted in CalendarPluginDev today. Make sure that the date format is a format the CalendarPlugin understands. Reformat if needed (inside the SEARCH format using CALC).

-- PeterThoeny - 15 Dec 2008

Our format is correct. Perhaps it is a problem with our version of CalendarPlugin. We have version 1.020. Generated events look acceptable to calendar.

    *  10 Dec 2008 - test
    * 9 Dec 2008 - sdgasdfgadg
    * 11 Dec 2008 - TestEventCalendar
    * 15 Dec 2008 - abcd 

Perhaps we need to change the order in which plugins are run?

-- VickiBrown - 16 Dec 2008

Hmm, those events look OK indeed. Not sure why it won't work. I use version 1.020 as well. I don't think it makes a difference, but your SEARCH has a trailing br tag and a trailing space.

-- PeterThoeny - 16 Dec 2008

Here is a sample .. Also check that CalendarPlugin works properly using a static ( ie no search ) event list ?

%CALENDAR{  weekstartsonmonday="1" month="12" year="2008" showweekdayheaders="1" lang="Français" }%
---
%SEARCH{ search="^FooTopic00*" web="FooWeb" type="regex" scope="topic"  excludetopic="%TOPIC%"  nonoise="on"
format="   * $formfield(FooDate) -  [[FooWeb.$topic][$formfield(FooField)]]  $formfield(AnotherField) " }%

-- OlivierThompson - 26 Dec 2008

And here is a working example I use:

<form action="%SCRIPTURL{view}%/%WEB%/%TOPIC%">Month:<select name="month"><option value="%<nop>URLPARAM{"month" default="%SERVERTIME{$mo}%"}%">%<nop>URLPARAM{"month" default="%SERVERTIME{$mon}%"}%</option><option value="1">Jan</option><option value="2">Feb</option><option value="3">Mar</option><option value="4">Apr</option><option value="5">May</option><option value="6">Jun</option><option value="7">Jul</option><option value="8">Aug</option><option value="9">Sep</option><option value="10">Oct</option><option value="11">Nov</option><option value="12">Dec</option></select>-<select name="year"><option value="%<nop>URLPARAM{"year" default="%SERVERTIME{$year}%"}%">%<nop>URLPARAM{"year" default="%SERVERTIME{$year}%"}%</option><option>2007</option><option>2008</option><option>2009</option><option>2010</option><option>2011</option><option>2012</option><option>2013</option><option>2014</option></select><input type="submit" value="Go" /></form>

%CALENDAR{ month="%<nop>URLPARAM{month}%" year="%<nop>URLPARAM{year}%" width="100%" }%

<!--
%SEARCH{ "[M]ETA:FORM.*[E]ventPlanForm" topic="EventPlan*" excludetopic="EventPlanTemplate" type="regex" nonoise="on" format="   * $percntCALC{$FORMATTIME($TIME($formfield(Date)), $day $mon $year)}$percnt - [[$topic][$formfield(Name)]]" }%
-->

__See also:__ EventPlans

-- PeterThoeny - 28 Dec 2008

FYI, we upgraded to 4.2.4 last spring and this problem seems to have disappeared with the upgrade. We no can generate calendar events on the fly. Yippee!

-- VickiBrown - 2009-10-22

Note: The SEARCH results (events) must be on the same page as the calendar. Apparently CALENDAR can't use topic="..." where the named topic contains a search, probably because the other page isn't rendered, it's imported as TWiki source.

-- VickiBrown - 2009-10-22

Or, possibly INCLUDE the page containing the SEARCH into the calendar page.

-- PeterThoeny - 2009-10-22

 
Change status to:
Topic revision: r10 - 2009-10-22 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, 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.