Hi,

Still playing with Presentation Server... I am now trying to write a
simple web application that will try to follow as much as possible the
REST principles.

One of the things I'd like to do is to give a stable URL to the
documents that are stored in the database, and a document identified by
"foo" would be displayed as http://example.com/doc/foo/, edited as
http://example.com/doc/foo/edit, ...

To do so, I have written a page flow that looks like:

<page id="edit" path-info="/doc/(.*)/(edit)"
  matcher="oxf:perl5-matcher" xforms="xforms-model.xml" model="model.xpl" 
view="xforms-view.xsl">
  <param ref="/form/document-id"/>
  <param ref="/form/action"/>
  <action when="/form/action = 'save'" action="save-apiculteur.xpl"/>
</page>
<page id="display" path-info="/doc/([^/]*)/" matcher="oxf:perl5-matcher"
   xforms="xforms-model.xml" model="model.xpl" view="view.xsl">
   <param ref="/form/document-id"/>
</page>

That's working nicely, but now I'd like to add a result that would
forward the user in display mode after he's saved, ie something such as:

<page id="edit" path-info="/doc/(.*)/(edit)"
  matcher="oxf:perl5-matcher" xforms="xforms-model.xml" model="model.xpl" 
view="xforms-view.xsl">
  <param ref="/form/document-id"/>
  <param ref="/form/action"/>
  <action when="/form/action = 'save'" action="save-apiculteur.xpl">
    <result page="display"/>
  </action>
</page>

However, when I try that, the server seems most confused and sends the
following error when I hit the save action: Condition failed for every
branch of choose: [/result/matches = 'true']

I think I should be able to do what I want to do with the redirect
processor, but given the note:

"It is recommended, whenever possible, to use the Page Flow Controller
to perform page redirections within a Presentation Server application.
The Page Flow Controller provides a much higher-level abstraction of the
notion of redirection than the Redirect Processor."

I am wondering if this is a case where I should use it.

Also, the redirect processor allows me to perform a client side redirect
which can be considered more friendly to the reload and back buttons
than a server side redirect.

Am I right to think that the PFC doesn't support client side redirect?

Thanks,

Eric


-- 
Have you ever thought about unit testing XSLT templates?
                                                     http://xsltunit.org
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
orbeon-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to