Actions
Feature #5096
closedSupport arguments in views
Start date:
09/18/2013
Due date:
% Done:
100%
Estimated time:
Description
Refactoring steps:
1) replace @path-template with list of <argument>
- support <argument> for path() only.
- develop XSL to translate @path-template to <argument> (for lavoisier-update-config.sh).
2) replace XPath functions path() and request().
Replace @path-template with list of <argument>:- @name="string"
- @pattern="regexp | .*"
- @path-format=" | VALUE | name/value"
- @eval => the default value (example: property('def')).
- text() => the default value (NOTE: not allowed if preceding-sibling::argument[text()='']).
Example:
<view><!-- /vo/{vo=dteam}/{site=CC-IN2P3} -->
<argument name="vo" path-format="name/value">dteam</argument>
<argument name="site">CC-IN2P3</argument>
</view>
Replace XPath functions with:
- STRING variables instead of path('k').
- STRING path() with no argument.
- NODESET arguments() with no argument.
- NODE post() with no argument instead of request('k').
- NODE current() as synonym of post() may be removed because it conflicts with function current() in eval() ???
- NODE view(STRING, [<entry> NODESET]) instead of view(STRING, [STRING]).
- NODE view_post(STRING, NODE, [<entry> NODESET]) instead of view_request(STRING, NODE, [STRING]).
- OBJECT eval(STRING, [NODESET]) instead of eval(STRING, [BOOLEAN]).
- NODESET users(['IP | DN | LOGIN']).
- key/values extracted from query fields
- key/values extracted from path
- key/values extracted from posted HTML form
- default values described in list of <argument>
- posted HTML form
- posted XML data
- XML data sent by view (NOTE: using function view_post())
- NULL
Example: revert priority order or arguments
<view name="v1" xmlns:str="http://exslt.org/strings">
<argument name="a">666</argument>
<argument name="b" eval="6 * 111"/>
<argument name="c"/>
<argument name="d"/>
<argument name="e"/>
<connector type="XMLConnector">
<parameter name="content" eval="view('v2',
eval('entry(@name, text() | eval(@eval))', view('config')/*/lav:view[@name='v1']/lav:argument[text()!='' or @eval])
| post()/*/*
| eval('entry(@name, str:split(path(),"/")[position(current())])',
view('config')/*/lav:view[@name='v1']/lav:argument[not(@path-format='')])
| arguments())"/>
</connector>
</view>
<view name="v2">
<argument name="a"/><argument name="b"/><argument name="c"/><argument name="d"/><argument name="e"/>
<connector type="StringConnector">
<parameter name="content" eval="concat($a,'/',$b,'/',$c,'/',$d,'/',$e)"/>
</connector>
</view>
If URL is...
POST http://localhost:8080/lavoisier/v1/path/path/path/path?a=query&b=query&c=query&d=query&e=query a=post b=post c=post
Then result is...
666/666/post/path/query
Updated by Reynaud Sylvain about 11 years ago
- Subject changed from replace @path-template with list of <argument> to Support arguments in views
Updated by Reynaud Sylvain about 11 years ago
- Status changed from New to Resolved
- Assigned To set to Reynaud Sylvain
- % Done changed from 0 to 100
Actions