Erasmo wrote:
My requirements are:
1.- I should be able to transform incoming request (incoming transform
pipes?).
You mean transforming via XSLT ? Yes, you can... you can also send
request parameters or portion of URIs to XSLT as parameters just by
using the sitemap:
<map:match pattern="pages/*.html">
<map:generate type="jx" src="contents/{1}.xml"/>
<map:transform src="resource/external/page-styling.xsl">
<map:parameter name="format" value="{request-param:format}"/>
<map:parameter name="page" value="{1}"/>
</map:transform>
<map:transform type="i18n">
<map:parameter name="locale" value="{request-param:locale}"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
2.- I should be abe to manage the rest url style.
Yes, I did some experiments myself and come out with sitemap fragments
like these:
<!--
Intecepts all URIs starting with "api/" and calls the corresponding
Flowscript function based on the HTTP method. Actually, the
function
name is a concatenation of the last part of the URI and "Set"
or "Get"
depending on the HTTP method.
-->
<map:match pattern="api/*">
<map:select type="request-method">
<map:when test="GET">
<map:call function="{1}Get"/>
</map:when>
<map:when test="PUT">
<map:call function="{1}Set"/>
</map:when>
</map:select>
</map:match>
<!--
Emits as JSON the obj collection object received from Flowscript.
-->
<map:match pattern="apipages/send-json">
<map:read src="module:flow-attr:json" mime-type="text/javascript"/>
</map:match>
<!--
Emits as XML the obj collection object received from
Flowscript. URI
format is send-{set|map}.xml
-->
<map:match pattern="apipages/send-*.xml">
<map:generate type="jx" src="pages/{1}.jx">
<map:parameter name="obj" value="{flow-attr:obj}"/>
</map:generate>
<map:serialize type="xml"/>
</map:match>
3.- I should be able to transform outcoming responses based on a
programatically generated way.
Not sure I have understood you on this: requests are transformed into
responses, why did you split transforming incoming requests from
transforming outgoing responses ?
Anyway, the same XML may be outputted using different formats by using
different serializers, since the staged nature of pipelines allows for
great flexibility.
Is this possible all this with Coocon?
I guess so.
Regards,
--------------------
Luca Morandini
www.lucamorandini.it
--------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]