Difference: FilterPlugin (1 vs. 3)

Revision 3
14 Oct 2014 - Main.MatthiasGeorgi
Line: 1 to 1
 

FilterPlugin

Line: 132 to 132
 

EXTRACT Example 1: convert table into text

One of the uses of this plugin is to extract data from tables, which is useful for creating "database-like" wiki applications where data is stored in foswiki tables. While it is certainly possible to do that without this plugin the plugin makes these requests easier to create and maintain. Note, however, that best practice is to store database-like
Changed:
<
<
information using DataForms, so that you don't need to parse the format of the data to extract its records repeatedly.
>
>
information using DataForms?, so that you don't need to parse the format of the data to extract its records repeatedly.
 

The table:
Pos Description Hours
Revision 2
30 Oct 2013 - Main.AdminUser
Line: 1 to 1
Changed:
<
<
<--

PLEASE DO NOT EDIT THIS TOPIC

It is automatically generated from the subversion repository, and any changes you make will simply be overwritten the next time a release is generated.

Instead, you could check your fix in, raise a bug in the Bugs web, or mail the author. -->

FilterPlugin

>
>

FilterPlugin

 
Changed:
<
<
Powered by
WikiRing Consultants
>
>
 

Description

This plugin allows to substitute and extract information from content by using regular expressions. There are three different types of new functions:
Line: 84 to 68
 
  • <list>: the list
  • tokenize="...": regex to tokenize the list before spliting it up, tokens are inserted back again after the split stage has been passed
  • split="...": the split expression (default ",")
Added:
>
>
  • replace="key1=value1,key2=value2, ...": this allows to preprocess each list item by replacing the given keys with their value
 
  • pattern="...": pattern applied to each item (default "\s(.*)\s")
  • format="...": the format string for each item (default "$1")
  • header="...": header string
  • footer="...": footer string
  • separator="...": string to be inserted between list items
Added:
>
>
  • lastseparator="...": string separating the last item from the rest of the list
 
  • null="...": the format string to render the empty list
Added:
>
>
  • hideempty="on,off": when set to "on" then empty list items will not be added to the result (empty in the sense of ''); set this to "off" to still add them (default "on")
 
  • limit="...": max number of items to be taken out of the list (default "-1")
  • skip="...": number of list items to skip, not adding them to the result
  • sort="on,off,alpha,num,nocase" order of the formatted items (default "off")
Line: 100 to 87
 
  • selection="...": regular expression that a list item must match to be "selected"; if this matches the $marker is inserted
  • marker="...": string to be inserted when the selection regex matches; this will be inserted at the position $marker as indicated in format .
Changed:
<
<
  • map="key1=value1,key2=value2, ...": this establishes a key-value hash available via the $map() variable.
>
>
  • map="key1=value1,key2=value2, ...": this establishes a key-value hash available via the $map() variable. (see also the replace parameter for means to preprocess list items automatically.)
 
Changed:
<
<
The pattern string shall group matching substrings in the list item to which you can refer to by using $1, $2, ... in the format string. Any format string (format, header, footer) may contain variables $percnt$, $nop, $dollar and $n. The variable $index referse to the position number within the list being formatted; using $count in the footer or header argument refers to the total number of list elements; $marker is set if the selection regular expression matches the current item. The $map(key) macro returns the value for "key" as specified in the map argument.
>
>
The pattern string shall group matching substrings in the list item to which you can refer to by using $1, $2, ... in the format string. Any format string (format, header, footer) may contain variables $percnt$, $nop, $dollar and $n. The variable $index referse to the position number within the list being formatted; $count refers to the total number of matched list elementsr;=$marker= is set if the selection regular expression matches the current item. The $map(key) macro returns the value for "key" as specified in the map argument.
 

MAKEINDEX

Syntax: %MAKEINDEX{"<list>" ...}%
Line: 263 to 252
 
  • Set SHORTDESCRIPTION = Substitute and extract information from content by using regular expressions
-->
Plugin Author: Michael Daum
Changed:
<
<
Copyright ©: 2005-2010, Michael Daum http://michaeldaumconsulting.com
>
>
Copyright ©: 2005-2012, Michael Daum http://michaeldaumconsulting.com
 
License: GPL (GNU General Public License)
Changed:
<
<
Release: 2.03
Version: 8284 (2010-07-23)
>
>
Release: 3.10
Version: 15048 (2012-06-19)
 
Change History:
<-- versions below in reverse order -->
 
Changed:
<
<
23 Jul 2010: fixes wrapper for non-official api call to getAnchorName on foswiki-1.1
>
>
19 Jun 2012: added lastseparator (by Foswiki:Main/OliverKrueger); fixed paging when using together with include and exclude parameters
15 May 2012: fixed paging through lists in FORMATLIST
05 May 2012: fixed lists not being processed properly before iterating over them in FORMATLIST and MAKEINDEX
19 Apr 2012: modernized plugin by using a proper OO-core; fixed processing of tokenize properly; added replace parameter for FORMATLIST; fixed the plugin calling Foswiki::Func::expandCommonVariables() itself unnecessarily
10 Jan 2012: fixed filtering zero; fixed counting list items without formating them; added hideempty parameter to enable/disable rendering empty list items
29 Sep 2011: fixed SUBST macro topic param processing embedded META
25 Aug 2011: fixed perl rookie error initializing defaults
14 Jul 2011: fixed parsing zero values in lists (by Grzegorz Marszalek)
06 Apr 2011: fixed SUBST to removing everything after the last match
23 Jul 2010: fixed wrapper for non-official api call to getAnchorName on foswiki-1.1
 
07 Jun 2010: fixed expanding standard escapes ($n, $percent, ...); improved examples in docu
12 Feb 2010: ease tokenize; forward compatibility for newer foswikis
| 17 Nov 2009: | added tokenize pattern for FORMATLIST;
Line: 303 to 305
 
Dependency: $Foswiki::Plugins::VERSION 1.024
CPAN Dependencies: none
Other Dependencies: none
Deleted:
<
<
Perl Version: 5.005
 
Plugin Home: Foswiki:Extensions/FilterPlugin
Support: Foswiki:Support/FilterPlugin
Deleted:
<
<

META FILEATTACHMENT attr="h" autoattached="1" comment="" date="1189788323" name="wikiringlogo40x40.png" path="wikiringlogo40x40.png" size="2571" user="ProjectContributor" version="1"
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback