Building page-flow using xslt pipeline

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

Building page-flow using xslt pipeline

julian.fawcett
I have been trying to build my page-flow from several constituent files to avoid the repetition of large amounts of xml. I originally tried to do this using XInclude but found that didn't work. I came across this old posting which explained why:

http://mail-archive.objectweb.org/ops-users/2005-03/msg00229.html

So instead I tried the technique using xslt pipelines suggested in that posting.
However when I try this I get an exception...

Type class java.net.MalformedURLException
Message no protocol: /store-request-params-in-session.xpl
Stack Trace java.net.MalformedURLException: no protocol: /store-request-params-in-session.xpl
        at java.net.URL.<init>(URL.java:537)
        at java.net.URL.<init>(URL.java:434)
        at org.orbeon.oxf.resources.URLFactory.createURL(URLFactory.java:44)
        at org.orbeon.oxf.resources.URLFactory.createURL(URLFactory.java:40)
        at org.orbeon.oxf.processor.PageFlowControllerProcessor$StepProcessorCall.<init>(PageFlowControllerProcessor.java:1163)
 etc....

Has anyone else tried this and come across the same problem?

My main static page-flow.xml looks like:

<config xmlns="http://www.orbeon.com/oxf/controller" xmlns:xu="http://www.xmldb.org/xupdate"
    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"  xmlns:oxf="http://www.orbeon.com/oxf/processors" instance-passing="forward">
    <page path-info="/(.*)" matcher="oxf:perl5-matcher" model="build-page-flow.xpl"/>
</config>

So this invokes "build-page-flow.xpl" which generates the page flow using xslt pipelines. The last thing this does is try to pass the xslt output to the oxf:page-flow processor where #page-flow is the id of the xslt output:

    <p:processor name="oxf:page-flow">
        <p:input name="controller" href="#page-flow"/>
    </p:processor>

I have made sure that the page flow generated by the xslt is valid by using an oxf:file-serializer processor to write the generated page flow to a file:

   <p:processor name="oxf:file-serializer" xmlns:p="http://www.orbeon.com/oxf/pipeline">  
        <p:input name="data" href="#page-flow" />  
        <p:input name="config">  
            <config>  
                <file>built-page-flow.xml</file>  
                <directory>d:/development/deployment/jboss-3.2.7/server/default/deploy/orbeon.war/WEB-INF/resources/config</directory>
            </config>  
        </p:input>  
   </p:processor>

If I then change the oxf:page-flow processor to use the generated file as input instead of piping in the output from xlst it works. But this is not a tenable solution.

Can anyone help please?

Joolz Fawcett
[hidden email]



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Building page-flow using xslt pipeline

Erik Bruchez
Administrator
[hidden email] wrote:

 > I have been trying to build my page-flow from several constituent
 > files to avoid the repetition of large amounts of xml. I originally
 > tried to do this using XInclude but found that didn't work. I came
 > across this old posting which explained why:
 >
 > http://mail-archive.objectweb.org/ops-users/2005-03/msg00229.html

Yes. We should still try to make XInclude work correctly with the
PFC. There is a new version of Xerces which is out and is supposed to
implement more of XInclude or, alternatively, we have now our own
XInclude processor we could improve upon.

 > So instead I tried the technique using xslt pipelines suggested in
 > that posting.  However when I try this I get an exception...
 >
 > Type class java.net.MalformedURLException
 > Message no protocol: /store-request-params-in-session.xpl
 > Stack Trace java.net.MalformedURLException: no protocol:
/store-request-params-in-session.xpl
 > at java.net.URL.<init>(URL.java:537)
 > at java.net.URL.<init>(URL.java:434)
 > at org.orbeon.oxf.resources.URLFactory.createURL(URLFactory.java:44)
 > at org.orbeon.oxf.resources.URLFactory.createURL(URLFactory.java:40)
 > at
org.orbeon.oxf.processor.PageFlowControllerProcessor$StepProcessorCall.<init>(PageFlowControllerProcessor.java:1163)
 >  etc....
 >
 > Has anyone else tried this and come across the same problem?

 > My main static page-flow.xml looks like:
 >
 > <config xmlns="http://www.orbeon.com/oxf/controller"
xmlns:xu="http://www.xmldb.org/xupdate"
 >     xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:oxf="http://www.orbeon.com/oxf/processors" instance-passing="forward">
 >     <page path-info="/(.*)" matcher="oxf:perl5-matcher"
model="build-page-flow.xpl"/>
 > </config>
 >
 > So this invokes "build-page-flow.xpl" which generates the page flow
 > using xslt pipelines. The last thing this does is try to pass the
 > xslt output to the oxf:page-flow processor where #page-flow is the
 > id of the xslt output:
 >
 >     <p:processor name="oxf:page-flow">
 >         <p:input name="controller" href="#page-flow"/>
 >     </p:processor>
 >
 > I have made sure that the page flow generated by the xslt is valid
 > by using an oxf:file-serializer processor to write the generated
 > page flow to a file:
 >
 >    <p:processor name="oxf:file-serializer"
xmlns:p="http://www.orbeon.com/oxf/pipeline">
 >         <p:input name="data" href="#page-flow" />
 >         <p:input name="config">
 >             <config>
 >                 <file>built-page-flow.xml</file>
 >
<directory>d:/development/deployment/jboss-3.2.7/server/default/deploy/orbeon.war/WEB-INF/resources/config</directory>
 >             </config>
 >         </p:input>
 >    </p:processor>
 >
 > If I then change the oxf:page-flow processor to use the generated
 > file as input instead of piping in the output from xlst it
 > works. But this is not a tenable solution.
 >
 > Can anyone help please?

The reason this is happening is that some URL resolution tries to
resolve against a missing URL base. Because the PFC configuration is
dynamically generated with an XSLT stylesheet, its output doesn't have
such a URL base.

Can you try putting an "oxf:" protocol in front of your URLs? I.e.,
instead of producing "/store-request-params-in-session.xpl", try to
produce "oxf:/store-request-params-in-session.xpl", etc.?

-Erik



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Building page-flow using xslt pipeline

julian.fawcett
In reply to this post by julian.fawcett
[hidden email] wrote:

>
> [hidden email] wrote:
>
>  > So instead I tried the technique using xslt pipelines suggested in
>  > that posting.  However when I try this I get an exception...
>  >
>  > Type class java.net.MalformedURLException
>  > Message no protocol: /store-request-params-in-session.xpl
>  > Stack Trace java.net.MalformedURLException: no protocol:
> /store-request-params-in-session.xpl
>  > at java.net.URL.<init>(URL.java:537)
>  > at java.net.URL.<init>(URL.java:434)
>  > at
org.orbeon.oxf.resources.URLFactory.createURL(URLFactory.java:44)
>  > at
org.orbeon.oxf.resources.URLFactory.createURL(URLFactory.java:40)
>  > at
>
org.orbeon.oxf.processor.PageFlowControllerProcessor$StepProcessorCall.<
in

> it>(PageFlowControllerProcessor.java:1163)
>  >  etc....
>  >
>  > Has anyone else tried this and come across the same problem?
>
>  > My main static page-flow.xml looks like:
>  >
>  > <config xmlns="http://www.orbeon.com/oxf/controller"
> xmlns:xu="http://www.xmldb.org/xupdate"
>  >     xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
> xmlns:oxf="http://www.orbeon.com/oxf/processors" instance-
> passing="forward">
>  >     <page path-info="/(.*)" matcher="oxf:perl5-matcher"
> model="build-page-flow.xpl"/>
>  > </config>
>  >
>  > So this invokes "build-page-flow.xpl" which generates the page flow
>  > using xslt pipelines. The last thing this does is try to pass the
>  > xslt output to the oxf:page-flow processor where #page-flow is the
>  > id of the xslt output:
>  >
>  >     <p:processor name="oxf:page-flow">
>  >         <p:input name="controller" href="#page-flow"/>
>  >     </p:processor>
>  >
>
> The reason this is happening is that some URL resolution tries to
> resolve against a missing URL base. Because the PFC configuration is
> dynamically generated with an XSLT stylesheet, its output doesn't have
> such a URL base.
>
> Can you try putting an "oxf:" protocol in front of your URLs? I.e.,
> instead of producing "/store-request-params-in-session.xpl", try to
> produce "oxf:/store-request-params-in-session.xpl", etc.?
>
> -Erik
Thanks for your help Erik. I added the "oxf:" protocol as you suggested
and it works fine now.

Joolz




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws