Changeset 3394


Ignore:
Timestamp:
04/09/09 11:27:46 (3 years ago)
Author:
CrawfordCurrie
Message:

Item8106: fix doc for auto-port, and merge a minor fix

Location:
trunk/FormQueryPlugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FormQueryPlugin/data/System/FormQueryPlugin.txt

    r3384 r3394  
    264264*Write this:* 
    265265 
    266 =%<nop>FORMQUERY{name="q1" search="topic=~'FAQ'" web="Foswiki"}%= %BR% 
     266=%<nop>FORMQUERY{name="q1" search="topic=~'FAQ'" web="%WEB%"}%= %BR% 
    267267=%<nop>SHOWQUERY{query="q1" header="   * *Topic: Summary:*" format="   * [<nop>[$web.$topic]]: $summary(25)"}%= 
    268268 
    269269*To get this:* 
    270270 
    271 %FORMQUERY{name="q1" search="topic=~'FAQ'" web="Foswiki"}% 
     271%FORMQUERY{name="q1" search="topic=~'FAQ'" web="%WEB%"}% 
    272272%SHOWQUERY{query="q1" header="   * *Topic: Summary:*" format="      * [[$web.$topic]]: $summary(25)"}% 
    273273 
     
    277277*Write this:* 
    278278 
    279 =%<nop>FORMQUERY{name="q1" search="text=~'__Back to:__ <nop>FrequentlyAskedQuestions'" web="Foswiki"}%= %BR% 
    280 =%<nop>SHOWQUERY{query="q1" header="Foswiki FAQs:" format="   * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [<nop>[$web.$topic][Answer...]]"}%= 
    281  
    282 *To get this:* 
    283  
    284 %FORMQUERY{name="q1" search="text=~'__Back to:__ FrequentlyAskedQuestions'" web="Foswiki"}% 
    285 %SHOWQUERY{query="q1" header="Foswiki FAQs:" format="   * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$web.$topic][Answer...]]"}% 
     279=%<nop>FORMQUERY{name="q1" search="text=~'__Back to:__ <nop>FrequentlyAskedQuestions'" web="%WEB%"}%= %BR% 
     280=%<nop>SHOWQUERY{query="q1" header="FAQs:" format="   * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [<nop>[$web.$topic][Answer...]]"}%= 
     281 
     282*To get this:* 
     283 
     284%FORMQUERY{name="q1" search="text=~'__Back to:__ FrequentlyAskedQuestions'" web="%WEB%"}% 
     285%SHOWQUERY{query="q1" header="FAQs:" format="   * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$web.$topic][Answer...]]"}% 
    286286 
    287287 
     
    293293 
    294294   * First search: 
    295       * =%<nop>FORMQUERY{name="q1" search="text=~'culture'" web="Foswiki"}% %<nop>SHOWQUERY{query="q1" format="   * $web.$topic is referenced by:$n(list all references)"}%= 
     295      * =%<nop>FORMQUERY{name="q1" search="text=~'culture'" web="%WEB%"}% %<nop>SHOWQUERY{query="q1" format="   * $web.$topic is referenced by:$n(list all references)"}%= 
    296296   * Second search. For each hit we want this search: 
    297       * =%<nop>DOQUERY{"(topic found in first search)" separator=", " web="Foswiki" format="$web.$topic"}%= 
     297      * =%<nop>DOQUERY{"(topic found in first search)" separator=", " web="%WEB%" format="$web.$topic"}%= 
    298298   * Now let's nest the two. We need to escape the second search, e.g. the first search will build a valid second search string. Note that we escape the second search so that it does not get evaluated prematurely by the first search: 
    299299      * Use =$percnt= to escape the leading percent of the second search 
     
    303303*Write this:* 
    304304 
    305 =%<nop>FORMQUERY{name="q1" search="text=~'culture'" web="Foswiki"}%= %BR% 
    306 =%<nop>SHOWQUERY{query="q1" format="   * $web.$topic is referenced by:$n      * $percntDOQUERY{\"$topic\" separator=\", \" web=\"Foswiki\" format=\"$dollarweb.$dollartopic\"}$percnt "}%= 
    307  
    308 *To get this:* 
    309  
    310 %FORMQUERY{name="q1" search="text=~'culture'" web="Foswiki"}% 
    311 %SHOWQUERY{query="q1" format="   * $web.$topic is referenced by:$n      * $percntDOQUERY{\"$topic\" separator=\", \" web=\"Foswiki\" format=\"$dollarweb.$dollartopic\"}$percnt "}% 
     305=%<nop>FORMQUERY{name="q1" search="text=~'culture'" web="%WEB%"}%= %BR% 
     306=%<nop>SHOWQUERY{query="q1" format="   * $web.$topic is referenced by:$n      * $percntDOQUERY{\"$topic\" separator=\", \" web=\"%WEB%\" format=\"$dollarweb.$dollartopic\"}$percnt "}%= 
     307 
     308*To get this:* 
     309 
     310%FORMQUERY{name="q1" search="text=~'culture'" web="%WEB%"}% 
     311%SHOWQUERY{query="q1" format="   * $web.$topic is referenced by:$n      * $percntDOQUERY{\"$topic\" separator=\", \" web=\"%WEB%\" format=\"$dollarweb.$dollartopic\"}$percnt "}% 
    312312 
    313313__Note:__ Nested search can be slow, especially if you nest more then 3 times. Nesting is limited to 16 levels. For each new nesting level you need to "escape the escapes", e.g. write =$dollarpercntDOQUERY= for level three, =$dollardollarpercntDOQUERY= for level four, etc. 
     
    317317*Write this:* 
    318318 
    319 =%<nop>FORMQUERY{name="q1" search="" web="Foswiki"}%= %BR% 
     319=%<nop>FORMQUERY{name="q1" search="" web="%WEB%"}%= %BR% 
    320320=%<nop>SHOWQUERY{query="q1" limit="7" sort="info.date" format="| $web.$topic | $wikiusername | $date |"}%= 
    321321 
    322322*To get this:* 
    323323 
    324 %FORMQUERY{name="q1" search="" web="Foswiki"}% 
     324%FORMQUERY{name="q1" search="" web="%WEB%"}% 
    325325%SHOWQUERY{query="q1" limit="7" sort="info.date" format="| $web.$topic | $wikiusername | $date |"}% 
    326326 
     
    338338 
    339339=%<nop>CALC{$SET(weekold, $TIMEADD($TIME(), -7, day))}%= %BR% 
    340 =%<nop>FORMQUERY{name="q1" search="name='.*'" web="Foswiki"}%= %BR% 
     340=%<nop>FORMQUERY{name="q1" search="name='.*'" web="%WEB%"}%= %BR% 
    341341=%<nop>SHOWQUERY{query="q1" sort="info.date" format="$percntCALC{$dollarIF($dollarTIME($date) &lt; $dollarGET(weekold), <nop>, | $web.$topic | $wikiusername | $date | $rev |)}$percnt" }%= 
    342342 
     
    350350 
    351351%CALC{$SET(weekold, $TIMEADD($TIME(), -7, day))}% 
    352 %FORMQUERY{name="q1" search="name='.*'" web="Foswiki"}% 
     352%FORMQUERY{name="q1" search="name='.*'" web="%WEB%"}% 
    353353%SHOWQUERY{query="q1" sort="info.date" format="$percntCALC{$dollarIF($dollarTIME($date) < $dollarGET(weekold), <nop>, | $web.$topic | $wikiusername | $date | $rev |)}$percnt" }% 
    354354 
     
    369369Result: 
    370370</verbatim> 
    371 =%<nop>FORMQUERY{name="q1" search="text=~'%URLPARAM{"q"}%'" web="Foswiki"}%= %BR% 
     371=%<nop>FORMQUERY{name="q1" search="text=~'%URLPARAM{"q"}%'" web="%WEB%"}%= %BR% 
    372372=%<nop>SHOWQUERY{query="q1" limit="7" format="   * $web.$topic: %<nop>BR% $summary" }%= 
    373373 
     
    380380</form><br> 
    381381Result (first 7): 
    382 %FORMQUERY{name="q1" search="text=~'%URLPARAM{"q"}%'" web="Foswiki"}% 
     382%FORMQUERY{name="q1" search="text=~'%URLPARAM{"q"}%'" web="%WEB%"}% 
    383383%SHOWQUERY{query="q1" limit="7" format="   * $web.$topic: %BR% $summary" }% 
    384384 
     
    389389*Write this:* 
    390390 
    391 =%<nop>FORMQUERY{name="all" search="" web="Foswiki" extract="attachments"}%= %BR% 
     391=%<nop>FORMQUERY{name="all" search="" web="%WEB%" extract="attachments"}%= %BR% 
    392392=%<nop>FORMQUERY{name="big" query="all" search="size&gt;'10240'"}%= %BR% 
    393393=%<nop>SHOWQUERY{query="big" format="|$_up.web.$_up.name|$name|  $percntCALC{$dollarROUND($dollarEVAL($size / 1024), 1)k}$percnt|$percntCALC{$dollarFORMATTIME($date, $dollarday $dollarmon $dollaryear)}$percnt|"}%= 
     
    395395*To get this:* 
    396396 
    397 %FORMQUERY{name="all" search="" web="Foswiki" extract="attachments"}% 
     397%FORMQUERY{name="all" search="" web="%WEB%" extract="attachments"}% 
    398398%FORMQUERY{name="big" query="all" search="size>'10240'"}% 
    399399%SHOWQUERY{query="big" format="|$_up.web.$_up.name|$name|  $percntCALC{$dollarROUND($dollarEVAL($size / 1024), 1)k}$percnt|$percntCALC{$dollarFORMATTIME($date,  $dollarday $dollarmon $dollaryear)}$percnt|"}% 
     
    454454   * The variable %<nop>FORMQUERYPLUGIN_ENABLE% *must* be set either globally or in the web where you want to use it. If the plugin is enabled globally (on all webs), this may have an unwelcome performance impact, as the plugin may create a cache of topics in a web where it is not intended to be used. To enable the plugin for selected webs only, put the following line into the !WebPreferences topic of the web you want to enable it on: 
    455455<pre> 
    456       * <nop>Set FORMQUERYPLUGIN_ENABLE = 1 
     456   * Set FORMQUERYPLUGIN_ENABLE = 1 
    457457</pre> 
    458458   * You can set a global default for the =moan= parameter by setting the =FORMQUERYPLUGIN_MOAN variable in %USERSWEB%.SitePreferences, WebPreferences in individual webs, or in individual topics. 
  • trunk/FormQueryPlugin/lib/Foswiki/Plugins/FormQueryPlugin/TableFormat.pm

    r3382 r3394  
    121121sub _breakName { 
    122122    my ( $text, $args ) = @_; 
     123    $text = '' unless defined $text; 
     124 
     125    return $text unless $args; 
    123126 
    124127    my @params = split( /[\,\s]+/, $args, 2 ); 
Note: See TracChangeset for help on using the changeset viewer.