Revision [15722]
This is an old revision of StructDataActionInfo made by DomBonj on 2006-11-30 16:39:04.
StructData Action Documentation
Not Included in official Wikka versionSee also:
Development: StructDataAction.Documentation
Short description
Enables to embed structured (or "semantically tagged", a bit like a database record) data items in a page. You can then use a specific visual rendering, showing only key informations and call predefined requests (a la SQL) to select and process data items across all wiki pages.This is by essence not a turnkey tool, as you have to define your data items and the request to be performed upon them.
Two examples are provided :
- a "To Do" list
- a contact card
Parameters
Parameters shall be:- either a pair ('type', 'data'), if you want to define a data item
- either 'req' with optionnally 'p1', 'p2' and 'p3', if you want to perform a request
name | type | required? | default | description |
---|---|---|---|---|
type | string | optional | The data item type. Predefined types are ToDo and Card. | |
data | string | required if you passed a 'type' parameter | field1='value1' field2='value2' etc. Optionnality and allowed values depend on vlalue of the 'type' parameter |
Long description
Didn't you ever think: "these wiki are nice, but if only I could somehow tag a chunk of page as containing the data for a contact card, a customer call or a calendar entry, in order to perform some database-style request on these data items?"Well, here is a solution. With the structdata action you can do four things:
- embed in any page a "structured data item" which is defiined by a type (e.g. a To-Do list entry) and a (possibly empty) set of parameters (or fields, in the database language). Note that fields are not typed;
- validate the content of the parameter. You can:
- check for the presence of a mandatory parameter; and
- perform any data validation desired.
An error message will indicate failure to validate a given data item. Note this requires you to provide the corresponding code;
- control the visual rendering of your data item. You can choose:
- to make it visible or not; or
- to display is as a list, a table or an inline text by using predefined display modes; or
- to display it in any custom way you may provide code for.
- perform any selection, processing and aggregation request you wish (example: display all the 'open' To-Do list entries with priority levels of 1 or 2). Of course, here again you have to provide some code.
Usage:
{{structdata (type="datatype" data="fieldslist" [print="printmode"] | req="reqname" [p1="val1"][p2="val2"][p3="val3"] | help) }}
Examples:
Definition of To-Do list items. The second one is not displayed{{structdata type="ToDo" print="table" data="date_open='2006-10-3' owner='jdoe' status='open' date_due='2007/11/13' desc='Complete logo design'"}}
{{structdata type="ToDo" print="false" data="owner='kbill' status='open' desc='Book flight to Lake Tahoe' priority='2' date_open='2006-10-3' "}}
Definition of a contact card
{{{{structdata type="Card" data="n='DOE;John' email='jdoe@himself.org' fax='(+1) 415 696 123' tel='212-898-31321' ORG='himself'"}} }}
Design considerations
Full SQL-style request language with parsermicroformats
structured wikis: xwiki and twiki
Author
Dominique BonjourCategoryDocumentation