Form runner as portlet welcome page

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

Form runner as portlet welcome page

EL-6
Hi,

How can I change the portlet welcome page to a form runner form?

I'm assuming I have to change the page-flow-portlet.xml; however I
don't understand how to adjust it to show a form-runner form.

The page-flow-portlet.xml defines the homepage as such:

    <page id="home" path-info="/" model="apps/portlet-welcome/page-flow.xml"/>

Changing this to link to one of the example forms works fine:

    <page id="home" path-info="/" model="apps/xforms-calculator/page-flow.xml"/>

However, how can I make it use a form runner form like the bookshelf
form (/fr/orbeon/bookshelf/new/)?

Hope you can help,
Ernst





--
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: Form runner as portlet welcome page

Alessandro Vernet
Administrator
Ernst,

On Apr 5, 2009, at 3:25 PM, EL wrote:

> How can I change the portlet welcome page to a form runner form?
>
> I'm assuming I have to change the page-flow-portlet.xml; however I
> don't understand how to adjust it to show a form-runner form.
>
> The page-flow-portlet.xml defines the homepage as such:
>
>    <page id="home" path-info="/" model="apps/portlet-welcome/page-
> flow.xml"/>

Try editing page-flow-portlet.xml, add at the beginning (remove the  
existing page with id="home"):

     <page id="home" path-info="/">
         <action><result page="fr"/></action>
     </page>

Then after the page id="apps", add (with whatever path you want to go  
to):

     <page id="fr" path-info="/fr/orbeon/bookshelf/summary/"/>

This is a "dummy page": because it is after the page id="apps", it  
will never match anything, but is used to do the redirection. You'll  
let us know if this works for you.

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: Form runner as portlet welcome page

EL-6
Hello Alessandro,

Thank you for your reply; I've given your suggestion a try, however it
results in an IllegalStateException.

2009-04-09 19:46:07,673 ERROR ProcessorService  - Exception at line 20, column 30 of oxf:/page-flow-portlet.xml (executing processor: name='{http://www.orbeon.com/oxf/processors}redirect')
java.lang.IllegalStateException
        at org.orbeon.oxf.portlet.PortletExternalContext$DirectResponseTemp.sendRedirect(PortletExternalContext.java:616)
        at org.orbeon.oxf.processor.RedirectProcessor.start(RedirectProcessor.java:68)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$11.run(PipelineProcessor.java:644)
        at org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:519)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:641)
        at org.orbeon.oxf.processor.pipeline.PipelineProcessor$1.getInput(PipelineProcessor.java:136)
        ...

Line 20 is the line with the action.

Just to make sure its not my Orbeon version I've tried this with
todays nightly build on Liferay 5.1.2. Reading another thread in this
mailing list suggests that this error means the portlet isn't
returning any data; but I don't know why that would be happening.

The call stack has the following info:
oxf:/page-flow-portlet.xml      20      30
executing processor
name → {http://www.orbeon.com/oxf/processors}redirect

oxf:/config/prologue-portlet.xpl        42      47      
executing processor
name → {http://www.orbeon.com/oxf/processors}page-flow
<p:processor name="oxf:page-flow">...</p:processor>

Below is my current page-flow-portlet.xml

<config xmlns="http://www.orbeon.com/oxf/controller"
        xmlns:xu="http://www.xmldb.org/xupdate"
        xmlns:oxf="http://www.orbeon.com/oxf/processors">

    <!-- Home / welcome application -->
    <page id="home" path-info="/">
        <action><result page="fr"/></action>
    </page>

    <!-- Dispatch request to a specific application -->
    <page id="apps" path-info="/([^/]+)/.*" matcher="oxf:perl5-matcher" model="apps/${1}/page-flow.xml"/>

    <!-- Test redirect to bookshelf demo -->
    <page id="fr" path-info="/fr/orbeon/bookshelf/summary/"/>
       
    <!-- "Not Found" page displayed when no page matches the request path -->
    <page id="not-found" path-info="/not-found" view="/config/not-found.xhtml"/>

    <epilogue url="/config/epilogue.xpl"/>
    <not-found-handler page="not-found"/>
</config>

Any hints on how to resolve this or what could be going wrong?

Ernst



--
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: Form runner as portlet welcome page

Alessandro Vernet
Administrator
Ernst,

On Apr 9, 2009, at 1:30 PM, EL wrote:

> Thank you for your reply; I've given your suggestion a try, however it
> results in an IllegalStateException.
>
> 2009-04-09 19:46:07,673 ERROR ProcessorService  - Exception at line  
> 20, column 30 of oxf:/page-flow-portlet.xml (executing processor:  
> name='{http://www.orbeon.com/oxf/processors}redirect')
> java.lang.IllegalStateException
>        at org.orbeon.oxf.portlet.PortletExternalContext
> $DirectResponseTemp.sendRedirect(PortletExternalContext.java:616)
>        at  
> org
> .orbeon.oxf.processor.RedirectProcessor.start(RedirectProcessor.java:
> 68)
>        at org.orbeon.oxf.processor.pipeline.PipelineProcessor
> $11.run(PipelineProcessor.java:644)
>        at  
> org
> .orbeon
> .oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:519)
>        at  
> org
> .orbeon
> .oxf
> .processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:
> 641)
>        at org.orbeon.oxf.processor.pipeline.PipelineProcessor
> $1.getInput(PipelineProcessor.java:136)
>        ...
It looks like redirects with the Redirect processor are not supported  
yet when running as a portlet. We had to try :). I guess you could  
hack around this by having a home page which includes a button that  
runs an <xforms:load> to go to the Form Runner page. One step further  
you can have some JavaScript that "clicks" the button automatically  
for you.

Or, better (and more fun!), you can checkout the Java code from CVS,  
and implement  
PortletExternalContext.DirectResponseTemp.sendRedirect(). If want to  
go that route and have any question relative to the code, please feel  
free to ask here; we'll do our best to help.

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