Approach on page-flow(s) from XPL

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Approach on page-flow(s) from XPL

Jeroen Hoffman
Hi,
I have a portlet that is configured to start at some XPL. Based on a request
parameter, I want to pick different views.

Now, I created a solution in which for each view I have an accompanying
page-flow, which is called from the XPL (see code later). Each page flow points
of course to a specific view.

But rather I want just one page flow, in which the view is picked based on
path-info.

Does anyone have a suggestion on how to accomplish that?

Thanks
Jeroen


My XPL:

<!-- Get request parameter 'view' -->
<p:processor name="oxf:request">
   <p:input name="config">
     <config>
       <include>/request/parameters/parameter[name = 'view']</include>
     </config>
   </p:input>
   <p:output name="data" id="request"/>
</p:processor>
       
<!-- Go to different page flows depending on request parameter -->
<p:choose href="#request">
   <p:when test="/request/parameters/parameter[value = 'finish']">
     <p:processor name="oxf:page-flow">
       <p:input name="controller" href="oxf:page-flow-finish.xml"/>
     </p:processor>
   </p:when>
   <p:when test="/request/parameters/parameter[value = 'new']">
     <p:processor name="oxf:page-flow">
       <p:input name="controller" href="oxf:page-flow-new.xml"/>
     </p:processor>
   </p:when>
   <p:otherwise>
     <p:processor name="oxf:page-flow">
        <p:input name="controller" href="oxf:page-flow.xml"/>
     </p:processor>
   </p:otherwise>
</p:choose>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Approach on page-flow(s) from XPL

Alessandro Vernet
Administrator
Jeoren,

I haven't tested this very code, but something along those lines  
should do the trick:

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:fo="http://www.w3.org/1999/XSL/Format"
     xmlns:xhtml="http://www.w3.org/1999/xhtml"
     xmlns:oxf="http://www.orbeon.com/oxf/processors"
     xmlns:xforms="http://www.w3.org/2002/xforms"
     xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">

     <!-- Get request parameter 'view' -->
     <p:processor name="oxf:request">
         <p:input name="config">
             <config>
                 <include>/request/parameters/parameter[name =  
'view']</include>
             </config>
         </p:input>
         <p:output name="data" id="request"/>
     </p:processor>

     <!-- Go to different page flows depending on request parameter -->
     <p:choose href="#request">
         <p:when test="/request/parameters/parameter[value = 'finish']">
             <p:processor name="oxf:indentiy">
                 <p:input name="data" href="flow-finish.xhtml"/>
                 <p:output name="data" id="view"/>
             </p:processor>
         </p:when>
         <p:when test="/request/parameters/parameter[value = 'new']">
             <p:processor name="oxf:identity">
                 <p:input name="controller" href="new.xhtml"/>
                 <p:output name="data" id="view"/>
             </p:processor>
         </p:when>
         <p:otherwise>
             <p:processor name="oxf:identity">
                 <p:input name="controller" href="other.xhtml"/>
                 <p:output name="data" id="view"/>
             </p:processor>
         </p:otherwise>
     </p:choose>

     <p:processor name="oxf:pipeline">
         <p:input name="data" href="#view"/>
         <p:input name="config" href="/config/epilogue.xpl"/>
     </p:processor>

</p:config>

Alex

On Jan 21, 2009, at 7:39 AM, Jeroen Hoffman wrote:

> Hi,
> I have a portlet that is configured to start at some XPL. Based on a  
> request parameter, I want to pick different views.
>
> Now, I created a solution in which for each view I have an  
> accompanying page-flow, which is called from the XPL (see code  
> later). Each page flow points of course to a specific view.
>
> But rather I want just one page flow, in which the view is picked  
> based on path-info.
>
> Does anyone have a suggestion on how to accomplish that?
>
> Thanks
> Jeroen
>
>
> My XPL:
>
> <!-- Get request parameter 'view' -->
> <p:processor name="oxf:request">
>  <p:input name="config">
>    <config>
>      <include>/request/parameters/parameter[name = 'view']</include>
>    </config>
>  </p:input>
>  <p:output name="data" id="request"/>
> </p:processor>
>
> <!-- Go to different page flows depending on request parameter -->
> <p:choose href="#request">
>  <p:when test="/request/parameters/parameter[value = 'finish']">
>    <p:processor name="oxf:page-flow">
>      <p:input name="controller" href="oxf:page-flow-finish.xml"/>
>    </p:processor>
>  </p:when>
>  <p:when test="/request/parameters/parameter[value = 'new']">
>    <p:processor name="oxf:page-flow">
>      <p:input name="controller" href="oxf:page-flow-new.xml"/>
>    </p:processor>
>  </p:when>
>  <p:otherwise>
>    <p:processor name="oxf:page-flow">
>       <p:input name="controller" href="oxf:page-flow.xml"/>
>    </p:processor>
>  </p:otherwise>
> </p:choose>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Approach on page-flow(s) from XPL

Jeroen Hoffman

Thanks for this suggestion, this would mean I can bypass all page flow files all
together, nice!

I'll have a go at this in a couple of days.

Jeroen


Alessandro Vernet wrote:

> Jeoren,
>
> I haven't tested this very code, but something along those lines should
> do the trick:
>
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     xmlns:fo="http://www.w3.org/1999/XSL/Format"
>     xmlns:xhtml="http://www.w3.org/1999/xhtml"
>     xmlns:oxf="http://www.orbeon.com/oxf/processors"
>     xmlns:xforms="http://www.w3.org/2002/xforms"
>     xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
>
>     <!-- Get request parameter 'view' -->
>     <p:processor name="oxf:request">
>         <p:input name="config">
>             <config>
>                 <include>/request/parameters/parameter[name =
> 'view']</include>
>             </config>
>         </p:input>
>         <p:output name="data" id="request"/>
>     </p:processor>
>
>     <!-- Go to different page flows depending on request parameter -->
>     <p:choose href="#request">
>         <p:when test="/request/parameters/parameter[value = 'finish']">
>             <p:processor name="oxf:indentiy">
>                 <p:input name="data" href="flow-finish.xhtml"/>
>                 <p:output name="data" id="view"/>
>             </p:processor>
>         </p:when>
>         <p:when test="/request/parameters/parameter[value = 'new']">
>             <p:processor name="oxf:identity">
>                 <p:input name="controller" href="new.xhtml"/>
>                 <p:output name="data" id="view"/>
>             </p:processor>
>         </p:when>
>         <p:otherwise>
>             <p:processor name="oxf:identity">
>                 <p:input name="controller" href="other.xhtml"/>
>                 <p:output name="data" id="view"/>
>             </p:processor>
>         </p:otherwise>
>     </p:choose>
>
>     <p:processor name="oxf:pipeline">
>         <p:input name="data" href="#view"/>
>         <p:input name="config" href="/config/epilogue.xpl"/>
>     </p:processor>
>
> </p:config>
>
> Alex
>
> On Jan 21, 2009, at 7:39 AM, Jeroen Hoffman wrote:
>
>> Hi,
>> I have a portlet that is configured to start at some XPL. Based on a
>> request parameter, I want to pick different views.
>>
>> Now, I created a solution in which for each view I have an
>> accompanying page-flow, which is called from the XPL (see code later).
>> Each page flow points of course to a specific view.
>>
>> But rather I want just one page flow, in which the view is picked
>> based on path-info.
>>
>> Does anyone have a suggestion on how to accomplish that?
>>
>> Thanks
>> Jeroen
>>
>>
>> My XPL:
>>
>> <!-- Get request parameter 'view' -->
>> <p:processor name="oxf:request">
>>  <p:input name="config">
>>    <config>
>>      <include>/request/parameters/parameter[name = 'view']</include>
>>    </config>
>>  </p:input>
>>  <p:output name="data" id="request"/>
>> </p:processor>
>>    
>> <!-- Go to different page flows depending on request parameter -->
>> <p:choose href="#request">
>>  <p:when test="/request/parameters/parameter[value = 'finish']">
>>    <p:processor name="oxf:page-flow">
>>      <p:input name="controller" href="oxf:page-flow-finish.xml"/>
>>    </p:processor>
>>  </p:when>
>>  <p:when test="/request/parameters/parameter[value = 'new']">
>>    <p:processor name="oxf:page-flow">
>>      <p:input name="controller" href="oxf:page-flow-new.xml"/>
>>    </p:processor>
>>  </p:when>
>>  <p:otherwise>
>>    <p:processor name="oxf:page-flow">
>>       <p:input name="controller" href="oxf:page-flow.xml"/>
>>    </p:processor>
>>  </p:otherwise>
>> </p:choose>
>>
>> --
>> You receive this message as a subscriber of the [hidden email]
>> mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> Personal Blog: http://avernet.blogspot.com/
> Twitter - http://twitter.com/avernet
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Approach on page-flow(s) from XPL

Alessandro Vernet
Administrator
On Jan 22, 2009, at 2:07 AM, Jeroen Hoffman wrote:

> I'll have a go at this in a couple of days.

You'll let us know how it works out.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Re: Re: Re: Approach on page-flow(s) from XPL

Jeroen Hoffman
Sorry, it didn't work out..
 
Your suggestion code leads to an error on the pipeline processor that is called after the view has been picked. The error message is "Invalid model id: js_cvo_resources-model", where "resources-model" is the id of a model that is imported in the view xhtml using an <xi:include>.
 
Jeroen
 
Call stack:
oxf:/config/xforms-widgets.xsl  29  N/A  
pushing XForms control binding
initializing XForms containing document
 
oxf:/ops/pfc/xforms-epilogue.xpl  134  60  
reading processor output
name ? document
id ? xhtml-data
 
oxf:/ops/pfc/xforms-epilogue.xpl  145  59  
reading processor output
name ? data
ref ? xformed-data
 
oxf:/config/epilogue.xpl  44  58  
reading processor output
name ? xformed-data
id ? xformed-data

oxf:/config/epilogue-portlet.xpl  28  48  
reading processor output
name ? xformed-data
oxf:/config/theme-plain.xsl  N/A  N/A  
executing XSLT transformation
 
oxf:/config/epilogue-portlet.xpl  107  49  
reading processor output
name ? data
id ? themed-data
 
oxf:/config/epilogue-portlet.xpl  112  59  
reading processor output
name ? rewrite-out
id ? rewritten-data
 
oxf:/config/epilogue-portlet.xpl  128  47  
reading processor output
name ? data
id ? html-data
 
oxf:/config/epilogue-portlet.xpl  141  47  
reading processor output
name ? data
id ? converted
 
oxf:/config/epilogue-portlet.xpl  143  45  
executing processor
name ? {http://www.orbeon.com/oxf/processors}http-serializer
 
oxf:/config/epilogue.xpl  74  46  
executing processor
name ? {http://www.orbeon.com/oxf/processors}pipeline
 
oxf:/apps/portlet-mavb-cvo/prologue-detail.xpl  21  37  
executing processor
name ? {http://www.orbeon.com/oxf/processors}pipeline
 

________________________________

Van: Alessandro Vernet [mailto:[hidden email]]
Verzonden: vr 23-1-2009 2:01
Aan: [hidden email]
Onderwerp: [ops-users] Re: Re: Re: Approach on page-flow(s) from XPL



On Jan 22, 2009, at 2:07 AM, Jeroen Hoffman wrote:

> I'll have a go at this in a couple of days.

You'll let us know how it works out.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

winmail.dat (8K) Download Attachment