Is there a way to throw an exception in xpl

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

Is there a way to throw an exception in xpl

James Gu
Hi, I want to throw an exception in some situation in xpl file. Something like this:

                        <p:choose href="#instance">
                            <p:when test="/test='true'">

                               <p:processor name="oxf:identity">
                                    <p:input name="data" href="instance"/>
                                    <p:output name="data" id="result"/>
                               </p:processor>

                            </p:when>
                            <p:otherwise>
                                 // throw an java exception with some messages.

                            </p:otherwise>
                        </p:choose>

It seems if an error occurs, the java exception will be stored in request and oxf:exception will turn it into an xml.

Is there a processor to create a java exception object and put it request?


Thanks,
James
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to throw an exception in xpl

venkata subrahmanyam
Hi you can siply send one node with xslt processor and displya the same  as follows

                        <p:choose href="#instance">
                            <p:when test="/test='true'">
                                     ................
                               <p:processor name="oxf:identity">
                                    <p:input name="data" href="instance"/>
                                    <p:output name="data" ref="data"/>
                               </p:processor>

                            </p:when>
                            <p:otherwise>


        <p:processor name="oxf:xslt-2.0">
                <p:input name="data"  href="#refreshsession"/>
                <p:input name="config">
                    <query xsl:version="2.0">       
                        <message>This is exception message</message>
                    </query>
                </p:input>
                <p:output name="data" ref="data"/>
         </p:processor>   

                            </p:otherwise>
                        </p:choose>
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to throw an exception in xpl

Erik Bruchez
Administrator
In reply to this post by James Gu
We have an oxf:error processor which just takes a config input. The  
string passed in that config input is passed as parameter to a  
ValidationException. You might want to try this.

-Erik

On Apr 29, 2009, at 2:52 AM, JamesGu wrote:

>
> Hi, I want to throw an exception in some situation in xpl file.  
> Something
> like this:
>
>                        <p:choose href="#instance">
>                            <p:when test="/test='true'">
>
>                               <p:processor name="oxf:identity">
>                                    <p:input name="data"  
> href="instance"/>
>                                    <p:output name="data" id="result"/>
>                               </p:processor>
>
>                            </p:when>
>                            <p:otherwise>
>                                 // throw an java exception with some
> messages.
>
>                            </p:otherwise>
>                        </p:choose>
>
> It seems if an error occurs, the java exception will be stored in  
> request
> and oxf:exception will turn it into an xml.
>
> Is there a processor to create a java exception object and put it  
> request?
>
>
> Thanks,
> James
>
> --
> View this message in context: http://www.nabble.com/Is-there-a-way-to-throw-an-exception-in-xpl-tp23293978p23293978.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> 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 Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
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: Is there a way to throw an exception in xpl

James Gu
Erik,

Thank you! This is exactly what I want. It works well.

James
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to throw an exception in xpl

James Gu
In reply to this post by venkata subrahmanyam

Thank you for your information!

I want it jump out the xpl and go to error page, not continue. I have solved the problem with Erik's help.

Thanks,
James