Le mercredi 19 janvier 2005 � 12:08 +0100, Erik Bruchez a �crit :
> Eric van der Vlist wrote:
> 

> > 
> > Am I right to think that the PFC doesn't support client side redirect?
> 
> No it does. You can control how redirects are done in the PFC (this doc 
> has yet to be moved to the right place):
> 
>    http://www.orbeon.com/ois/doc/home-changes-25#pfc
> 
> Here you have to make sure the method used is "redirect", either set at 
> the top level of your page-flow.xml, or at the action result level.

Seems to be working pretty well!

> Now the PFC is also able to do a redirect to a page using <param> 
> elements, by substituting the parameter names into the correct regexp 
> groups. But you should make sure the value is available in the XForms 
> instance, i.e. when you do your <result page="display"/>, you should 
> also set /form/document-id in the "display" page's XForms instance.

I must still have missed something, then!

Here is what I am doing...

In page-flow.xml:

    <page id="apiculteur" path-info="/apiculteurs/apiculteur/([^/]*)/" 
matcher="oxf:perl5-matcher"
        xforms="xforms-model.xml" model="apiculteur.xpl" 
view="apiculteur-view.xsl">
        <param ref="/form/document-id"/>
    </page>
...
   <page id="nouveau" path-info="/apiculteurs/nouveau" xforms="xforms-model.xml"
        view="xforms-view.xsl">
        <action
            when="/form/action = 'save' and not(/form/document//[EMAIL 
PROTECTED]:valid = 'false' and not(ancestor-or-self::[EMAIL PROTECTED]:relevant 
= 'false'])]) "
            action="save-new-document.xpl">
            <result page="apiculteur"/>
        </action>
        <action
            when="/form/action = 'save' and /form/document//[EMAIL 
PROTECTED]:valid = 'false' and not(ancestor-or-self::[EMAIL PROTECTED]:relevant 
= 'false'])] ">
            <result>
                <xu:update select="/form/message">save-failure</xu:update>
                <xu:update select="/form/show-errors">true</xu:update>
                <xu:remove select="/form/document//@*[local-name() = 'error']"/>
            </result>
        </action>
        <action when="/form/action = 'liste'" action="goto-liste.xpl"/>
        <action when="/form/action = 'affiche'" action="goto-liste.xpl"/>
    </page>

in save-new-apiculteur.xpl:

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline";
    xmlns:oxf="http://www.orbeon.com/oxf/processors";
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:xdb="http://orbeon.org/oxf/xml/xmldb";
    xmlns:bk="http://apiculteurs.info/namespace/";
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
    <p:param name="instance" type="input"/>
    <p:param name="data" type="output"/>

... and, just to test:

   <p:processor name="oxf:identity">
        <p:input name="data" >
            <form>
                <document-id>foo</document-id>
                <action/>
            </form>
            </p:input>
        <p:output name="data" ref="data"/>
    </p:processor>
</p:config>

Now, when I fill out the form to create a document and save it, Iget
redirected to http://localhost:8280/orbeon/apiculteurs/apiculteur/?%
24instance=Wsi7LEu0o9mxyg%2F2ipTw69sa1q9z%2BB6LIVGn4qXXUn3aw8kbgFbq%
2FcZ9JfwsbVPqPjdCiQukAiYQ%0AsDmrxU1FejCQ6oTuNT0xFRN%2BdPm4REI%
2F7QhTn93a0Oaok1zB0dvwI2yG4Y42L7te9bLYcbWDYzga%0AxLd%2FzJ%
2FaGlUuj5x7eouIY7I0X%2B3JCNQeq00X3XEBv3Y74ftQ0oepdRiQJAO0m53yc%
2FTBQGWWq92G%0AdKB2XdoDH3%
2FY7bbWJBvByaAf7p0jjdTotlbycg0pA52hERGCqieC4bEUep1U0gGuSTxQOtRkoBxV%
0AhpR0MSft4FaQ9nSCS%2FWsfVk%2B5%2FmFb2oXcnKOW9vRhsWU%
2Bi0hFCApq9ZTrOUhhKCdRjh1Y9SCbI9e%0AhtbebfKjRezsL04%
2FqP95qN2xdSxxC8hmjf7fuo1O12WkWVXyEfCWRUqkZZ%2FysKSc0Pt8vBQluQB3%
0AmawFKP0ZTbVAed6D4vQvL%2F%2BgZxmMNzbo%2FmVcK2E5RTY26tnuzL%
2BhvXTZ1aERtrZRtZ00ski9njfV%0AtPuY7gch%2FaZ%2FETy7AZUeJHst0N%2FC1K%
2F0s2c%2BdmgrLJurL5N%2Fcfl%2BR87t5JC61MjhkrA%2F%2BNNq9Xba%
0A56mYQwq2BZ0dTqVMOXrGJmy%2FoAuuW%2F66&%
24key=10l40yhtt9KLCHf4JBTt9WLAdJqtllQH and I get an exception:


class org.orbeon.oxf.common.ValidationException
Condition failed for every branch of choose: [/result/matches = 'true']

When I am using the, oxf:redirect I can make sure that the URL stays
readable and correct, ie:
http://localhost:8280/orbeon/apiculteurs/apiculteur/foo/ 

Is there a way to achieve the same effect with the PFC?

Thanks,

Eric

-- 
Read me on Advogato.
                                         http://advogato.org/person/vdv/
------------------------------------------------------------------------
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
------------------------------------------------------------------------



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
orbeon-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to