Dynamic page-flow

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

Dynamic page-flow

Colin O'Brien
Hi,

I have been trying to set up to go to different page flow files at run
time. Something like
<p:processor name="oxf:page-flow">
  <p:input name="controller" href="#desired-flow"/>
</p:processor>

Given I've already unsuccessfully tried a few ways to create
#desired-flow, before I get any deeper into this, I just wanted to
check that I am doing something that is possible?

Thanks in advance
Colin




--
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: Dynamic page-flow

Erik Bruchez
Administrator
Colin,

There is no reason this shouldn't work. What happens if you replace
#desired-flow with a static file?

A caveat is that the result may be fairly slow if your page flow
configuration cannot be cached, because the Page Flow processor takes
some time to "compile" a page flow description into an internal XPL
pipeline.

-Erik

Colin O'Brien wrote:

> Hi,
>
> I have been trying to set up to go to different page flow files at run
> time. Something like
> <p:processor name="oxf:page-flow">
>  <p:input name="controller" href="#desired-flow"/>
> </p:processor>
>
> Given I've already unsuccessfully tried a few ways to create
> #desired-flow, before I get any deeper into this, I just wanted to check
> that I am doing something that is possible?
>
> Thanks in advance
> Colin


--
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: Dynamic page-flow

Colin O'Brien
Hi Erik,

sorry, forgot to say that yes, if I put in a static filename (the test
file I am looking to get dynamically) then it works.

What format will be needed here...?
/dir/flows/thisone.xml
or
file:///dir/flows/thisone.xml
or
<url>
/dir/flows/thisone.xml
</url>

Thanks & regards
Colin


On Oct 5, 2005, at 5:34 AM, Erik Bruchez wrote:

> Colin,
>
> There is no reason this shouldn't work. What happens if you replace
> #desired-flow with a static file?
>
> A caveat is that the result may be fairly slow if your page flow
> configuration cannot be cached, because the Page Flow processor takes
> some time to "compile" a page flow description into an internal XPL
> pipeline.
>
> -Erik
>
> Colin O'Brien wrote:
>> Hi,
>> I have been trying to set up to go to different page flow files at
>> run time. Something like
>> <p:processor name="oxf:page-flow">
>>  <p:input name="controller" href="#desired-flow"/>
>> </p:processor>
>> Given I've already unsuccessfully tried a few ways to create
>> #desired-flow, before I get any deeper into this, I just wanted to
>> check that I am doing something that is possible?
>> Thanks in advance
>> Colin
>



--
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: Dynamic page-flow

Erik Bruchez
Administrator
In XPL, an @href attribute can contain an absolute URL, or an URL
relative to the location the the current XPL file (which can in turn be
a relative path or an absolute path). In summary you can have URLs of
the form:

o Relative path: href="../flows/thisone.xml"
o Absolute path: href="/dir/flows/thisone.xml"
o Absolute resource URL: href="oxf:/dir/flows/thisone.xml"
o Absolute file URL: href="oxf:/dir/flows/thisone.xml"
o Absolute http URL: href="http://www.example.org/dir/flows/thisone.xml"

Etc.

Since your resources are usually loaded through the OPS resource manager
(which means accessible through the "oxf:" protocol), you typically do
not use the "file:" protocol, unless you are trying to access a file
located outside your resources. You

Colin O'Brien wrote:

> Hi Erik,
>
> sorry, forgot to say that yes, if I put in a static filename (the test
> file I am looking to get dynamically) then it works.
>
> What format will be needed here...?
> /dir/flows/thisone.xml
> or
> file:///dir/flows/thisone.xml
> or
> <url>
> /dir/flows/thisone.xml
> </url>
>
> Thanks & regards
> Colin
>
>
> On Oct 5, 2005, at 5:34 AM, Erik Bruchez wrote:
>
>> Colin,
>>
>> There is no reason this shouldn't work. What happens if you replace
>> #desired-flow with a static file?
>>
>> A caveat is that the result may be fairly slow if your page flow
>> configuration cannot be cached, because the Page Flow processor takes
>> some time to "compile" a page flow description into an internal XPL
>> pipeline.
>>
>> -Erik
>>
>> Colin O'Brien wrote:
>>
>>> Hi,
>>> I have been trying to set up to go to different page flow files at
>>> run time. Something like
>>> <p:processor name="oxf:page-flow">
>>>  <p:input name="controller" href="#desired-flow"/>
>>> </p:processor>
>>> Given I've already unsuccessfully tried a few ways to create
>>> #desired-flow, before I get any deeper into this, I just wanted to
>>> check that I am doing something that is possible?
>>> Thanks in advance
>>> Colin
>>
>>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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



--
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: Dynamic page-flow

Colin O'Brien
Hi Erik,

yes, the whole point of the exercise is to get outside of resources.
This may or may not be a good idea, but it is where current non-ops  
content is managed and served from, and so I am looking at building on  
that.

Seems from your (incomplete?) answer, that any typical format for file  
path/URI is acceptable, but an XML snippet is not what it is expecting  
(unlike the url-generator for example).

Thanks again
Colin

On Oct 5, 2005, at 10:58 AM, Erik Bruchez wrote:

> In XPL, an @href attribute can contain an absolute URL, or an URL  
> relative to the location the the current XPL file (which can in turn  
> be a relative path or an absolute path). In summary you can have URLs  
> of the form:
>
> o Relative path: href="../flows/thisone.xml"
> o Absolute path: href="/dir/flows/thisone.xml"
> o Absolute resource URL: href="oxf:/dir/flows/thisone.xml"
> o Absolute file URL: href="oxf:/dir/flows/thisone.xml"
> o Absolute http URL:  
> href="http://www.example.org/dir/flows/thisone.xml"
>
> Etc.
>
> Since your resources are usually loaded through the OPS resource  
> manager (which means accessible through the "oxf:" protocol), you  
> typically do not use the "file:" protocol, unless you are trying to  
> access a file located outside your resources. You
>
> Colin O'Brien wrote:
>> Hi Erik,
>> sorry, forgot to say that yes, if I put in a static filename (the  
>> test file I am looking to get dynamically) then it works.
>> What format will be needed here...?
>> /dir/flows/thisone.xml
>> or
>> file:///dir/flows/thisone.xml
>> or
>> <url>
>> /dir/flows/thisone.xml
>> </url>
>> Thanks & regards
>> Colin
>> On Oct 5, 2005, at 5:34 AM, Erik Bruchez wrote:
>>> Colin,
>>>
>>> There is no reason this shouldn't work. What happens if you replace  
>>> #desired-flow with a static file?
>>>
>>> A caveat is that the result may be fairly slow if your page flow  
>>> configuration cannot be cached, because the Page Flow processor  
>>> takes some time to "compile" a page flow description into an  
>>> internal XPL pipeline.
>>>
>>> -Erik
>>>
>>> Colin O'Brien wrote:
>>>
>>>> Hi,
>>>> I have been trying to set up to go to different page flow files at  
>>>> run time. Something like
>>>> <p:processor name="oxf:page-flow">
>>>>  <p:input name="controller" href="#desired-flow"/>
>>>> </p:processor>
>>>> Given I've already unsuccessfully tried a few ways to create  
>>>> #desired-flow, before I get any deeper into this, I just wanted to  
>>>> check that I am doing something that is possible?
>>>> Thanks in advance
>>>> Colin
>>>
>>>
>> ----------------------------------------------------------------------
>> --
>> --
>> 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
>
>
>
> --
> 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



--
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: Dynamic page-flow

Erik Bruchez
Administrator
The Page Flow Controller processor's "controller" input expects an XML
document following the format of the Page Flow as described here:

   http://www.orbeon.com/ops/doc/reference-page-flow

This is no different from, say, an XSLT processor expecting on its
"config" input an XML document following the XSLT specification, etc.

Of course you can also inline the config in the "controller" input if
you want:

<p:processor name="oxf:page-flow">
   <p:input name="controller">
     <config xmlns="http://www.orbeon.com/oxf/controller">
       <files .../>
       <page .../>
     </config>
   </p:input name="controller">
</p:processor>

But if you meant that you pass the PFC processor a document like
<url>...</url< the answer is no: only the URL generator uses that format.

-Erik

Colin O'Brien wrote:

> Hi Erik,
>
> yes, the whole point of the exercise is to get outside of resources.
> This may or may not be a good idea, but it is where current non-ops  
> content is managed and served from, and so I am looking at building on  
> that.
>
> Seems from your (incomplete?) answer, that any typical format for file  
> path/URI is acceptable, but an XML snippet is not what it is expecting  
> (unlike the url-generator for example).
>
> Thanks again
> Colin
>
> On Oct 5, 2005, at 10:58 AM, Erik Bruchez wrote:
>
>> In XPL, an @href attribute can contain an absolute URL, or an URL  
>> relative to the location the the current XPL file (which can in turn  
>> be a relative path or an absolute path). In summary you can have URLs  
>> of the form:
>>
>> o Relative path: href="../flows/thisone.xml"
>> o Absolute path: href="/dir/flows/thisone.xml"
>> o Absolute resource URL: href="oxf:/dir/flows/thisone.xml"
>> o Absolute file URL: href="oxf:/dir/flows/thisone.xml"
>> o Absolute http URL:  href="http://www.example.org/dir/flows/thisone.xml"
>>
>> Etc.
>>
>> Since your resources are usually loaded through the OPS resource  
>> manager (which means accessible through the "oxf:" protocol), you  
>> typically do not use the "file:" protocol, unless you are trying to  
>> access a file located outside your resources. You
>>
>> Colin O'Brien wrote:
>>
>>> Hi Erik,
>>> sorry, forgot to say that yes, if I put in a static filename (the  
>>> test file I am looking to get dynamically) then it works.
>>> What format will be needed here...?
>>> /dir/flows/thisone.xml
>>> or
>>> file:///dir/flows/thisone.xml
>>> or
>>> <url>
>>> /dir/flows/thisone.xml
>>> </url>
>>> Thanks & regards
>>> Colin
>>> On Oct 5, 2005, at 5:34 AM, Erik Bruchez wrote:
>>>
>>>> Colin,
>>>>
>>>> There is no reason this shouldn't work. What happens if you replace  
>>>> #desired-flow with a static file?
>>>>
>>>> A caveat is that the result may be fairly slow if your page flow  
>>>> configuration cannot be cached, because the Page Flow processor  
>>>> takes some time to "compile" a page flow description into an  
>>>> internal XPL pipeline.
>>>>
>>>> -Erik
>>>>
>>>> Colin O'Brien wrote:
>>>>
>>>>> Hi,
>>>>> I have been trying to set up to go to different page flow files at  
>>>>> run time. Something like
>>>>> <p:processor name="oxf:page-flow">
>>>>>  <p:input name="controller" href="#desired-flow"/>
>>>>> </p:processor>
>>>>> Given I've already unsuccessfully tried a few ways to create  
>>>>> #desired-flow, before I get any deeper into this, I just wanted to  
>>>>> check that I am doing something that is possible?
>>>>> Thanks in advance
>>>>> Colin
>>>>
>>>>
>>>>
>>> ----------------------------------------------------------------------
>>> --
>>> --
>>> 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
>>
>>
>>
>>
>> --
>> 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
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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



--
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: Dynamic page-flow

Colin O'Brien
Hi erik

this is what I was checking...

On Oct 5, 2005, at 1:45 PM, Erik Bruchez wrote:

> But if you meant that you pass the PFC processor a document like
> <url>...</url< the answer is no: only the URL generator uses that
> format.

Had to go out of town yesterday, but now I can get back to figuring out
why I can't get this to work!

Thanks
Colin




--
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: Dynamic page-flow

Colin O'Brien
Hi

now that I have been able to verify everything else going on in this  
pipeline, it seems I am still left with my original problem, how to get  
to a dynamic page flow...

In my pipeline I have
     <p:processor name="oxf:page-flow">
     <p:input name="controller" href="#uri-pageflow"/>
     </p:processor>

uri-pageflow contains
file:///docs/clientdir/local/page-flow.xml

And in the browser I get

Type class java.lang.NullPointerException
Message null
Location oxf:/test3b2/prologue.xpl
Line 181
Column 39
Stack Trace java.lang.NullPointerException
         at  
org.orbeon.oxf.processor.PageFlowControllerProcessor$1.read(PageFlowCont
rollerProcessor.java:92)
         at  
org.orbeon.oxf.processor.ProcessorImpl.readCacheInputAsObject(ProcessorI
mpl.java:464)
         at  
org.orbeon.oxf.processor.PageFlowControllerProcessor.start(PageFlowContr
ollerProcessor.java:87)
         at  
org.orbeon.oxf.processor.pipeline.PipelineProcessor$11.run(PipelineProce
ssor.java:652)
         at  
org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.jav
a:508)
         at  
org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProces
sor.java:649)
         at  
org.orbeon.oxf.pipeline.InitUtils.runProcessor(InitUtils.java:88)
         at  
org.orbeon.oxf.webapp.ProcessorService.service(ProcessorService.java:
95)
         at  
org.orbeon.oxf.servlet.OXFServletDelegate.service(OXFServletDelegate.jav
a:129)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.orbeon.oxf.servlet.OXFServlet.service(OXFServlet.java:74)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
etc

Line 181 is <p:processor name="oxf:page-flow">

If I replace #uri-pageflow with  
file:///docs/clientdir/local/page-flow.xml then it all works.

Hopefully there is a simple explanation but I have not been able to  
find it.

(The only relevant example I have found, examples/dispatch.xpl, uses  
url-generator and feeds the now in memory page flow to the page flow  
controller - from our discussion the other day, that didn't seem to be  
necessary, and I would rather have the consistency of always providing  
a uri/filepath).

Thanks for your help
Colin




--
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: Dynamic page-flow

Alessandro  Vernet
Administrator
Hi Colin,

The document you feed to the "controller" input of the page flow
processor must be the page flow itself, not a document that contains
the URI of the page flow. If you have document that contains a URI
pointing to a page flow, you must use the URL generator first to get
the document from the URI, and then feed that document to the page
flow processor, essentially doing something similar to the code you
have already seen in dispatch.xpl.

Alex

On 10/7/05, Colin O'Brien <[hidden email]> wrote:

> Hi
>
> now that I have been able to verify everything else going on in this
> pipeline, it seems I am still left with my original problem, how to get
> to a dynamic page flow...
>
> In my pipeline I have
>      <p:processor name="oxf:page-flow">
>      <p:input name="controller" href="#uri-pageflow"/>
>      </p:processor>
>
> uri-pageflow contains
> file:///docs/clientdir/local/page-flow.xml
>
> And in the browser I get
>
> Type class java.lang.NullPointerException
> Message null
> Location oxf:/test3b2/prologue.xpl
> Line 181
> Column 39
> Stack Trace java.lang.NullPointerException
>          at
> org.orbeon.oxf.processor.PageFlowControllerProcessor$1.read(PageFlowCont
> rollerProcessor.java:92)
>          at
> org.orbeon.oxf.processor.ProcessorImpl.readCacheInputAsObject(ProcessorI
> mpl.java:464)
>          at
> org.orbeon.oxf.processor.PageFlowControllerProcessor.start(PageFlowContr
> ollerProcessor.java:87)
>          at
> org.orbeon.oxf.processor.pipeline.PipelineProcessor$11.run(PipelineProce
> ssor.java:652)
>          at
> org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.jav
> a:508)
>          at
> org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProces
> sor.java:649)
>          at
> org.orbeon.oxf.pipeline.InitUtils.runProcessor(InitUtils.java:88)
>          at
> org.orbeon.oxf.webapp.ProcessorService.service(ProcessorService.java:
> 95)
>          at
> org.orbeon.oxf.servlet.OXFServletDelegate.service(OXFServletDelegate.jav
> a:129)
>          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>          at org.orbeon.oxf.servlet.OXFServlet.service(OXFServlet.java:74)
>          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>          at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:247)
> etc
>
> Line 181 is <p:processor name="oxf:page-flow">
>
> If I replace #uri-pageflow with
> file:///docs/clientdir/local/page-flow.xml then it all works.
>
> Hopefully there is a simple explanation but I have not been able to
> find it.
>
> (The only relevant example I have found, examples/dispatch.xpl, uses
> url-generator and feeds the now in memory page flow to the page flow
> controller - from our discussion the other day, that didn't seem to be
> necessary, and I would rather have the consistency of always providing
> a uri/filepath).
>
> Thanks for your help
> Colin
>
>
>
>
>
> --
> 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
>
>
>


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet