Revision history for RESTHandlerInfo
Revision [23366]
Last edited on 2016-05-20 07:38:47 by DomBonj [Replaces old-style internal links with new pipe-split links.]Additions:
This handler is a partial implementation (offering only a read-only mode, i.e. only the 'GET' method is supported) of the [[http://www.xfront.com/REST-Web-Services.html | REST style]] of implementing web services.
Deletions:
Revision [20042]
Edited on 2008-06-20 15:23:44 by DomBonj [v0.94: replaced empty parameters with '*'; documentation of error messages]Additions:
""<table class="data" cellspacing="0" cellpadding="2" border="1"> <thead> <tr><th scope="col">name</th><th scope="col">type</th><th scope="col">required?</th><th scope="col">default</th><th scope="col">description</th></tr> </thead> <tbody> <tr><td>tag</td><td>string</td><td>optional</td><td> *</td><td>The name of an XHTML tag (e.g. 'p', 'div', etc.)</td></tr> <tr><td>attribute</td><td>string</td><td>optional</td><td> *</td><td>The
name of an XHTML attribute (e.g. 'class', 'id', etc.)</td></tr> <tr><td>value</td><td>string</td><td>optional</td><td> *</td><td>The value of the XHTML attribute. If present, attribute has to be present too (see examples below)</td></tr> <tr><td>rank</td><td>integer</td><td>optional</td><td><i>none</i></td><td>The sequence number of the targeted tag in the page</td></tr> </tbody> </table>""
Use the default value of the parameters you do not want to filter on (see examples below.)
%%http://www.wikkawiki.org/wikka.php?wakka=HomePage/rest/div/*/*/2%%
==Error handling==
Any error will be reported both in the HTTP 'Status-Code' header and in the body of the XML reply, formatted as in this example (the message string can be localized):
%%(xml)
<Error>
<Code>IllegalParameters</Code>
<Message>Illegal parameter(s) value</Message>
<Resource>GET */*/*/8</Resource>
</Error>
%%
the third paragraph in the page which has a 'class' attribute equal to 'code'</td></tr> <tr><td>p</td><td>*</td><td>*</td><td>3</td><td>/p/*/*/3</td><td>Selects the third paragraph in the page, whatever its attributes</td></tr> <tr><td>p</td><td>id</td><td>*</td><td>3</td><td>/p/id/*/3</td><td>Selects the third paragraph in the page having a 'id' attribute, whatever its value</td></tr> <tr><td>*</td><td>*</td><td>*</td><td>3</td><td>/*/*/*/3</td><td><i>Not
allowed</i></td></tr> <tr><td>p</td><td>*</td><td>code</td><td></td><td>/p/*/code</td><td><i>Not
<tr><td>*</td><td>*</td><td>code</td><td></td><td>/*/*/code</td><td><i>Not
As an example, the following URL:
%%http://www.wikkawiki.org/wikka.php?wakka=HomePage/rest/div/*/*/2%%
yields the following result:
%%(xml)
<?xml version="1.0" encoding="utf-8" ?>
<wikkapage><div class="center">
<h2> Welcome to Wikka Wiki </h2>
</div>
</wikkapage>
%%
name of an XHTML attribute (e.g. 'class', 'id', etc.)</td></tr> <tr><td>value</td><td>string</td><td>optional</td><td> *</td><td>The value of the XHTML attribute. If present, attribute has to be present too (see examples below)</td></tr> <tr><td>rank</td><td>integer</td><td>optional</td><td><i>none</i></td><td>The sequence number of the targeted tag in the page</td></tr> </tbody> </table>""
Use the default value of the parameters you do not want to filter on (see examples below.)
%%http://www.wikkawiki.org/wikka.php?wakka=HomePage/rest/div/*/*/2%%
==Error handling==
Any error will be reported both in the HTTP 'Status-Code' header and in the body of the XML reply, formatted as in this example (the message string can be localized):
%%(xml)
<Error>
<Code>IllegalParameters</Code>
<Message>Illegal parameter(s) value</Message>
<Resource>GET */*/*/8</Resource>
</Error>
%%
the third paragraph in the page which has a 'class' attribute equal to 'code'</td></tr> <tr><td>p</td><td>*</td><td>*</td><td>3</td><td>/p/*/*/3</td><td>Selects the third paragraph in the page, whatever its attributes</td></tr> <tr><td>p</td><td>id</td><td>*</td><td>3</td><td>/p/id/*/3</td><td>Selects the third paragraph in the page having a 'id' attribute, whatever its value</td></tr> <tr><td>*</td><td>*</td><td>*</td><td>3</td><td>/*/*/*/3</td><td><i>Not
allowed</i></td></tr> <tr><td>p</td><td>*</td><td>code</td><td></td><td>/p/*/code</td><td><i>Not
<tr><td>*</td><td>*</td><td>code</td><td></td><td>/*/*/code</td><td><i>Not
As an example, the following URL:
%%http://www.wikkawiki.org/wikka.php?wakka=HomePage/rest/div/*/*/2%%
yields the following result:
%%(xml)
<?xml version="1.0" encoding="utf-8" ?>
<wikkapage><div class="center">
<h2> Welcome to Wikka Wiki </h2>
</div>
</wikkapage>
%%
Deletions:
name of an XHTML attribute (e.g. 'class', 'id', etc.)</td></tr> <tr><td>value</td><td>string</td><td>optional</td><td></td><td>The value of the XHTML attribute. If present, attribute has to be present too (see examples below)</td></tr> <tr><td>rank</td><td>integer</td><td>optional</td><td></td><td>The sequence number of the targeted tag in the page</td></tr> </tbody> </table>""
All parameters can be omitted but the '/' separator has to be present it there are subsequent parameters (see examples below.)
%%http://www.wikkawiki.org/wikka.php?wakka=HomePage/rest/div///2%%
the third paragraph in the page which has a 'class' attribute equal to 'code'</td></tr> <tr><td>p</td><td></td><td></td><td>3</td><td>/p///3</td><td>Selects the third paragraph in the page, whatever its attributes</td></tr> <tr><td></td><td></td><td></td><td>3</td><td>///3</td><td>Selects the third tag in the page, whatever its type and attributes</td></tr> <tr><td>p</td><td></td><td>code</td><td></td><td>/p//code</td><td><i>Not
<tr><td></td><td></td><td>code</td><td></td><td>///code</td><td><i>Not
~- Limitation: when using mod_rewrite, empty parameters are rewritten into mistaken URLs (example: ##""mysite/mypage/rest/div///3""## becomes ##mysite/mypage/rest/div/3##.)
Additions:
This handler is a partial implementation (offering only a read-only mode, i.e. only the 'GET' method is supported) of the [[http://www.xfront.com/REST-Web-Services.html REST style]] of implementing web services.
Deletions:
Additions:
the third paragraph in the page which has a 'class' attribute equal to 'code'</td></tr> <tr><td>p</td><td></td><td></td><td>3</td><td>/p///3</td><td>Selects the third paragraph in the page, whatever its attributes</td></tr> <tr><td></td><td></td><td></td><td>3</td><td>///3</td><td>Selects the third tag in the page, whatever its type and attributes</td></tr> <tr><td>p</td><td></td><td>code</td><td></td><td>/p//code</td><td><i>Not