Example for xxforms:get-request-parameter

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

Example for xxforms:get-request-parameter

Fleming Ho
Hi there,

Is there a simple example on how to use xxforms:get-request-parameter ?? I'm assuming this allows me to query a value of a parameter passed in the URL?

My objective is to pass the name of an xml filename that would be used to load the initial instance data from. What would the syntax look like to use this dynamic value in the following code

     <xforms:instance src=???



Thanks in advance.

Fleming




--
Untitled Document

"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn



--
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: Example for xxforms:get-request-parameter

Erik Bruchez
Administrator
You can't use this function on xforms:instance/@src, or any XPath  
functions for that matter.

What you can do is react to xforms-ready or xforms-model-construct done:

   http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-initialization

Then the submission can call the function, e.g.:

<xforms:submission id="load-submission" method ="get"
     resource="oxf:/foo/bar/resource-{xxxforms:get-request-
parameter('lang')}.xml"
     replace="instance" instance="my-instance"/>

-Erik

On Apr 4, 2008, at 2:45 PM, Fleming Ho wrote:

> Hi there,
>
> Is there a simple example on how to use xxforms:get-request-
> parameter ?? I'm assuming this allows me to query a value of a  
> parameter passed in the URL?
>
> My objective is to pass the name of an xml filename that would be  
> used to load the initial instance data from. What would the syntax  
> look like to use this dynamic value in the following code
>
>      <xforms:instance src=???
>
>
>
> Thanks in advance.
>
> Fleming
>
>
>
>
> --
> "If we can find money to kill people, you can find money to help  
> people."
> "Keeping people hopeless and pessimistic - see I think there are two  
> ways in which people are controlled - first of all frighten people  
> and secondly demoralize them."
> "An educated, healthy and confident nation is harder to govern." --  
> Tony Benn
>
--
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: Re: Example for xxforms:get-request-parameter

Fleming Ho
Hi Erik,

Here is my sample code

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
    <head>
        <title>XForms Hello</title>
        <xforms:model>
            <xforms:send submission="data-submission" ev:event="xforms-ready" />
            <xforms:instance id="data-instance">
                <data xmlns="">
                    <element />
                </data>
            </xforms:instance>

            <!-- dynamic -->
            <xforms:submission id="data-submission" replace="instance" instance="data-instance" resource=<a class="moz-txt-link-rfc2396E" href="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/{xxforms:get-request-parameter('lang')}.xml">"file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/{xxforms:get-request-parameter('lang')}.xml" method="get" />

            <!--    Hardcoded       
            <xforms:submission id="data-submission" replace="instance" instance="data-instance" action="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/foo.xml" method="get" />
            -->

        </xforms:model>
    </head>
    <body>
    this is the body
    <xforms:input ref="instance('data-instance')/element" incremental="true">
            <xforms:label>PO</xforms:label>
        </xforms:input>
    </body>
</html>

I am trying to pass a URL with (the parameter) in browser of

http://192.168.10.57:8080/orbeon/xforms-hello3/view.xhtml?lang=foo


The contents of Foo.xml is

<?xml version="1.0" encoding="UTF-8"?>
<data>
    <element>1234</element>
</data>

But the PO text box is empty. If I replace the "dynamic" with the "hardcoded" then I get the expected value in the textbox.

I think I'm taking you too literally or I'm most likey am not understanding something. What is wrong with my usage of get-request-parameter statement??

Thanks,


Fleming



Erik Bruchez wrote:
You can't use this function on xforms:instance/@src, or any XPath functions for that matter.

What you can do is react to xforms-ready or xforms-model-construct done:

  http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-initialization

Then the submission can call the function, e.g.:

<xforms:submission id="load-submission" method ="get"
    resource="oxf:/foo/bar/resource-{xxxforms:get-request-parameter('lang')}.xml"
    replace="instance" instance="my-instance"/>

-Erik

On Apr 4, 2008, at 2:45 PM, Fleming Ho wrote:
Hi there,

Is there a simple example on how to use xxforms:get-request-parameter ?? I'm assuming this allows me to query a value of a parameter passed in the URL?

My objective is to pass the name of an xml filename that would be used to load the initial instance data from. What would the syntax look like to use this dynamic value in the following code

     <xforms:instance src=???



Thanks in advance.

Fleming




-- 
"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn


--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/


--
Untitled Document

"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn



--
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: Example for xxforms:get-request-parameter

Alessandro Vernet
Administrator
Fleming,

On Fri, Apr 4, 2008 at 7:48 PM, Fleming Ho <[hidden email]> wrote:
>  My objective is to pass the name of an xml filename that would be used to
> load the initial instance data from. What would the syntax look like to use
> this dynamic value in the following code

As Erik said, right now you can only use
xxxforms:get-request-parameter() inside a handler for xforms-ready or
xforms-model-construct-done. Since you have a handler for
xforms-ready, you can call xxxforms:get-request-parameter() there,
store the result in a node of an instance, and then make a reference
to that node in the AVT you have in the "resource" attribute of your
submission.

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/


--
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: Example for xxforms:get-request-parameter

Erik Bruchez
Administrator
In reply to this post by Fleming Ho
Fleming,

I am not sure your file URL is correct. Why does it start with "/////
192.168.10.57/" ?

-Erik

On Apr 4, 2008, at 7:48 PM, Fleming Ho wrote:

> Hi Erik,
>
> Here is my sample code
>
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml 
> " xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema 
> " xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms 
> ">
>     <head>
>         <title>XForms Hello</title>
>         <xforms:model>
>             <xforms:send submission="data-submission"  
> ev:event="xforms-ready" />
>             <xforms:instance id="data-instance">
>                 <data xmlns="">
>                     <element />
>                 </data>
>             </xforms:instance>
>
>             <!-- dynamic -->
>             <xforms:submission id="data-submission"  
> replace="instance" instance="data-instance" resource="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/
> {xxforms:get-request-parameter('lang')}.xml" method="get" />
>
>             <!--    Hardcoded
>             <xforms:submission id="data-submission"  
> replace="instance" instance="data-instance" action="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/foo.xml
> " method="get" />
>             -->
>
>         </xforms:model>
>     </head>
>     <body>
>     this is the body
>     <xforms:input ref="instance('data-instance')/element"  
> incremental="true">
>             <xforms:label>PO</xforms:label>
>         </xforms:input>
>     </body>
> </html>
>
> I am trying to pass a URL with (the parameter) in browser of
>
> http://192.168.10.57:8080/orbeon/xforms-hello3/view.xhtml?lang=foo
>
>
> The contents of Foo.xml is
>
> <?xml version="1.0" encoding="UTF-8"?>
> <data>
>     <element>1234</element>
> </data>
>
> But the PO text box is empty. If I replace the "dynamic" with the  
> "hardcoded" then I get the expected value in the textbox.
>
> I think I'm taking you too literally or I'm most likey am not  
> understanding something. What is wrong with my usage of get-request-
> parameter statement??
>
> Thanks,
>
>
> Fleming
>
>
>
> Erik Bruchez wrote:
>>
>> You can't use this function on xforms:instance/@src, or any XPath  
>> functions for that matter.
>>
>> What you can do is react to xforms-ready or xforms-model-construct  
>> done:
>>
>>   http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-initialization
>>
>> Then the submission can call the function, e.g.:
>>
>> <xforms:submission id="load-submission" method ="get"
>>     resource="oxf:/foo/bar/resource-{xxxforms:get-request-
>> parameter('lang')}.xml"
>>     replace="instance" instance="my-instance"/>
>>
>> -Erik
>>
>> On Apr 4, 2008, at 2:45 PM, Fleming Ho wrote:
>>> Hi there,
>>>
>>> Is there a simple example on how to use xxforms:get-request-
>>> parameter ?? I'm assuming this allows me to query a value of a  
>>> parameter passed in the URL?
>>>
>>> My objective is to pass the name of an xml filename that would be  
>>> used to load the initial instance data from. What would the syntax  
>>> look like to use this dynamic value in the following code
>>>
>>>      <xforms:instance src=???
>>>
>>>
>>>
>>> Thanks in advance.
>>>
>>> Fleming
>>>
>>>
>>>
>>>
>>> --
>>> "If we can find money to kill people, you can find money to help  
>>> people."
>>> "Keeping people hopeless and pessimistic - see I think there are  
>>> two ways in which people are controlled - first of all frighten  
>>> people and secondly demoralize them."
>>> "An educated, healthy and confident nation is harder to govern."  
>>> -- Tony Benn
>>>
>>
>> --
>> Orbeon Forms - Web Forms for the Enterprise Done the Right Way
>> http://www.orbeon.com/
>>
>
> --
> "If we can find money to kill people, you can find money to help  
> people."
> "Keeping people hopeless and pessimistic - see I think there are two  
> ways in which people are controlled - first of all frighten people  
> and secondly demoralize them."
> "An educated, healthy and confident nation is harder to govern." --  
> Tony Benn
>
> --
> 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: Re: Re: Re: Example for xxforms:get-request-parameter

Fleming Ho
Hi Eric,

It's a networked resource, and that's the IP of the computer. It works, though when it's a hardcoded path. I probably don't understand how to use the get-request function. I'm hoping you can provide a literal example.

Thanks.

Fleming


Erik Bruchez wrote:
Fleming,

I am not sure your file URL is correct. Why does it start with "/////192.168.10.57/" ?

-Erik

On Apr 4, 2008, at 7:48 PM, Fleming Ho wrote:
Hi Erik,

Here is my sample code

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
    <head>
        <title>XForms Hello</title>
        <xforms:model>
            <xforms:send submission="data-submission" ev:event="xforms-ready" />
            <xforms:instance id="data-instance">
                <data xmlns="">
                    <element />
                </data>
            </xforms:instance>

            <!-- dynamic -->
            <xforms:submission id="data-submission" replace="instance" instance="data-instance" resource=<a class="moz-txt-link-rfc2396E" href="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/{xxforms:get-request-parameter('lang')}.xml">"file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/{xxforms:get-request-parameter('lang')}.xml" method="get" />

            <!--    Hardcoded
            <xforms:submission id="data-submission" replace="instance" instance="data-instance" action="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/foo.xml" method="get" />
            -->

        </xforms:model>
    </head>
    <body>
    this is the body
    <xforms:input ref="instance('data-instance')/element" incremental="true">
            <xforms:label>PO</xforms:label>
        </xforms:input>
    </body>
</html>

I am trying to pass a URL with (the parameter) in browser of

http://192.168.10.57:8080/orbeon/xforms-hello3/view.xhtml?lang=foo


The contents of Foo.xml is

<?xml version="1.0" encoding="UTF-8"?>
<data>
    <element>1234</element>
</data>

But the PO text box is empty. If I replace the "dynamic" with the "hardcoded" then I get the expected value in the textbox.

I think I'm taking you too literally or I'm most likey am not understanding something. What is wrong with my usage of get-request-parameter statement??

Thanks,


Fleming



Erik Bruchez wrote:

You can't use this function on xforms:instance/@src, or any XPath functions for that matter.

What you can do is react to xforms-ready or xforms-model-construct done:

  http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-initialization

Then the submission can call the function, e.g.:

<xforms:submission id="load-submission" method ="get"
    resource="oxf:/foo/bar/resource-{xxxforms:get-request-parameter('lang')}.xml"
    replace="instance" instance="my-instance"/>

-Erik

On Apr 4, 2008, at 2:45 PM, Fleming Ho wrote:
Hi there,

Is there a simple example on how to use xxforms:get-request-parameter ?? I'm assuming this allows me to query a value of a parameter passed in the URL?

My objective is to pass the name of an xml filename that would be used to load the initial instance data from. What would the syntax look like to use this dynamic value in the following code

     <xforms:instance src=???



Thanks in advance.

Fleming




-- 
"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn


-- 
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/


-- 
"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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/


--
Untitled Document

"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn



--
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: Re: Example for xxforms:get-request-parameter

Erik Bruchez
Administrator
I see, makes sense. What version of Orbeon Forms are you using? get-
request-parameter() is a recent addition.

Also, try to enable logging and check the logs to see what happens:

   http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-logging

-Erik

On Apr 5, 2008, at 9:07 AM, Fleming Ho wrote:

> Hi Eric,
>
> It's a networked resource, and that's the IP of the computer. It  
> works, though when it's a hardcoded path. I probably don't  
> understand how to use the get-request function. I'm hoping you can  
> provide a literal example.
>
> Thanks.
>
> Fleming
>
>
> Erik Bruchez wrote:
>>
>> Fleming,
>>
>> I am not sure your file URL is correct. Why does it start with  
>> "/////192.168.10.57/" ?
>>
>> -Erik
>>
>> On Apr 4, 2008, at 7:48 PM, Fleming Ho wrote:
>>> Hi Erik,
>>>
>>> Here is my sample code
>>>
>>> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml 
>>> " xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema 
>>> " xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms 
>>> ">
>>>     <head>
>>>         <title>XForms Hello</title>
>>>         <xforms:model>
>>>             <xforms:send submission="data-submission"  
>>> ev:event="xforms-ready" />
>>>             <xforms:instance id="data-instance">
>>>                 <data xmlns="">
>>>                     <element />
>>>                 </data>
>>>             </xforms:instance>
>>>
>>>             <!-- dynamic -->
>>>             <xforms:submission id="data-submission"  
>>> replace="instance" instance="data-instance" resource="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/
>>> {xxforms:get-request-parameter('lang')}.xml" method="get" />
>>>
>>>             <!--    Hardcoded
>>>             <xforms:submission id="data-submission"  
>>> replace="instance" instance="data-instance" action="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/foo.xml
>>> " method="get" />
>>>             -->
>>>
>>>         </xforms:model>
>>>     </head>
>>>     <body>
>>>     this is the body
>>>     <xforms:input ref="instance('data-instance')/element"  
>>> incremental="true">
>>>             <xforms:label>PO</xforms:label>
>>>         </xforms:input>
>>>     </body>
>>> </html>
>>>
>>> I am trying to pass a URL with (the parameter) in browser of
>>>
>>> http://192.168.10.57:8080/orbeon/xforms-hello3/view.xhtml?lang=foo
>>>
>>>
>>> The contents of Foo.xml is
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <data>
>>>     <element>1234</element>
>>> </data>
>>>
>>> But the PO text box is empty. If I replace the "dynamic" with the  
>>> "hardcoded" then I get the expected value in the textbox.
>>>
>>> I think I'm taking you too literally or I'm most likey am not  
>>> understanding something. What is wrong with my usage of get-
>>> request-parameter statement??
>>>
>>> Thanks,
>>>
>>>
>>> Fleming
>>>
>>>
>>>
>>> Erik Bruchez wrote:
>>>>
>>>> You can't use this function on xforms:instance/@src, or any XPath  
>>>> functions for that matter.
>>>>
>>>> What you can do is react to xforms-ready or xforms-model-
>>>> construct done:
>>>>
>>>>   http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-initialization
>>>>
>>>> Then the submission can call the function, e.g.:
>>>>
>>>> <xforms:submission id="load-submission" method ="get"
>>>>     resource="oxf:/foo/bar/resource-{xxxforms:get-request-
>>>> parameter('lang')}.xml"
>>>>     replace="instance" instance="my-instance"/>
>>>>
>>>> -Erik
>>>>
>>>> On Apr 4, 2008, at 2:45 PM, Fleming Ho wrote:
>>>>> Hi there,
>>>>>
>>>>> Is there a simple example on how to use xxforms:get-request-
>>>>> parameter ?? I'm assuming this allows me to query a value of a  
>>>>> parameter passed in the URL?
>>>>>
>>>>> My objective is to pass the name of an xml filename that would  
>>>>> be used to load the initial instance data from. What would the  
>>>>> syntax look like to use this dynamic value in the following code
>>>>>
>>>>>      <xforms:instance src=???
>>>>>
>>>>>
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Fleming
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> "If we can find money to kill people, you can find money to help  
>>>>> people."
>>>>> "Keeping people hopeless and pessimistic - see I think there are  
>>>>> two ways in which people are controlled - first of all frighten  
>>>>> people and secondly demoralize them."
>>>>> "An educated, healthy and confident nation is harder to govern."  
>>>>> -- Tony Benn
>>>>>
>>>>
>>>> --
>>>> Orbeon Forms - Web Forms for the Enterprise Done the Right Way
>>>> http://www.orbeon.com/
>>>>
>>>
>>> --
>>> "If we can find money to kill people, you can find money to help  
>>> people."
>>> "Keeping people hopeless and pessimistic - see I think there are  
>>> two ways in which people are controlled - first of all frighten  
>>> people and secondly demoralize them."
>>> "An educated, healthy and confident nation is harder to govern."  
>>> -- Tony Benn
>>>
>>> --
>>> 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/
>>
>
> --
> "If we can find money to kill people, you can find money to help  
> people."
> "Keeping people hopeless and pessimistic - see I think there are two  
> ways in which people are controlled - first of all frighten people  
> and secondly demoralize them."
> "An educated, healthy and confident nation is harder to govern." --  
> Tony Benn
>
> --
> 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: Re: Example for xxforms:get-request-parameter

Fleming Ho
I'm using 3.6.

Thanks for the tip.

Fleming



Erik Bruchez wrote:
I see, makes sense. What version of Orbeon Forms are you using? get-request-parameter() is a recent addition.

Also, try to enable logging and check the logs to see what happens:

  http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-logging

-Erik

On Apr 5, 2008, at 9:07 AM, Fleming Ho wrote:
Hi Eric,

It's a networked resource, and that's the IP of the computer. It works, though when it's a hardcoded path. I probably don't understand how to use the get-request function. I'm hoping you can provide a literal example.

Thanks.

Fleming


Erik Bruchez wrote:

Fleming,

I am not sure your file URL is correct. Why does it start with "/////192.168.10.57/" ?

-Erik

On Apr 4, 2008, at 7:48 PM, Fleming Ho wrote:
Hi Erik,

Here is my sample code

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
    <head>
        <title>XForms Hello</title>
        <xforms:model>
            <xforms:send submission="data-submission" ev:event="xforms-ready" />
            <xforms:instance id="data-instance">
                <data xmlns="">
                    <element />
                </data>
            </xforms:instance>

            <!-- dynamic -->
            <xforms:submission id="data-submission" replace="instance" instance="data-instance" resource=<a class="moz-txt-link-rfc2396E" href="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/{xxforms:get-request-parameter('lang')}.xml">"file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/{xxforms:get-request-parameter('lang')}.xml" method="get" />

            <!--    Hardcoded
            <xforms:submission id="data-submission" replace="instance" instance="data-instance" action="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/foo.xml" method="get" />
            -->

        </xforms:model>
    </head>
    <body>
    this is the body
    <xforms:input ref="instance('data-instance')/element" incremental="true">
            <xforms:label>PO</xforms:label>
        </xforms:input>
    </body>
</html>

I am trying to pass a URL with (the parameter) in browser of

http://192.168.10.57:8080/orbeon/xforms-hello3/view.xhtml?lang=foo


The contents of Foo.xml is

<?xml version="1.0" encoding="UTF-8"?>
<data>
    <element>1234</element>
</data>

But the PO text box is empty. If I replace the "dynamic" with the "hardcoded" then I get the expected value in the textbox.

I think I'm taking you too literally or I'm most likey am not understanding something. What is wrong with my usage of get-request-parameter statement??

Thanks,


Fleming



Erik Bruchez wrote:

You can't use this function on xforms:instance/@src, or any XPath functions for that matter.

What you can do is react to xforms-ready or xforms-model-construct done:

  http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-initialization

Then the submission can call the function, e.g.:

<xforms:submission id="load-submission" method ="get"
    resource="oxf:/foo/bar/resource-{xxxforms:get-request-parameter('lang')}.xml"
    replace="instance" instance="my-instance"/>

-Erik

On Apr 4, 2008, at 2:45 PM, Fleming Ho wrote:
Hi there,

Is there a simple example on how to use xxforms:get-request-parameter ?? I'm assuming this allows me to query a value of a parameter passed in the URL?

My objective is to pass the name of an xml filename that would be used to load the initial instance data from. What would the syntax look like to use this dynamic value in the following code

     <xforms:instance src=???



Thanks in advance.

Fleming




-- 
"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn


-- 
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/


-- 
"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn

-- 
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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/


-- 
"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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/


--
Untitled Document

"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn



--
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: Example for xxforms:get-request-parameter

Erik Bruchez
Administrator
This function was not yet implemented in 3.6. Try a nightly build:

http://forge.objectweb.org/nightlybuilds/ops/ops/

-Erik

On Apr 5, 2008, at 9:48 AM, Fleming Ho wrote:

> I'm using 3.6.
>
> Thanks for the tip.
>
> Fleming
>
>
>
> Erik Bruchez wrote:
>>
>> I see, makes sense. What version of Orbeon Forms are you using? get-
>> request-parameter() is a recent addition.
>>
>> Also, try to enable logging and check the logs to see what happens:
>>
>>   http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-logging
>>
>> -Erik
>>
>> On Apr 5, 2008, at 9:07 AM, Fleming Ho wrote:
>>> Hi Eric,
>>>
>>> It's a networked resource, and that's the IP of the computer. It  
>>> works, though when it's a hardcoded path. I probably don't  
>>> understand how to use the get-request function. I'm hoping you can  
>>> provide a literal example.
>>>
>>> Thanks.
>>>
>>> Fleming
>>>
>>>
>>> Erik Bruchez wrote:
>>>>
>>>> Fleming,
>>>>
>>>> I am not sure your file URL is correct. Why does it start with  
>>>> "/////192.168.10.57/" ?
>>>>
>>>> -Erik
>>>>
>>>> On Apr 4, 2008, at 7:48 PM, Fleming Ho wrote:
>>>>> Hi Erik,
>>>>>
>>>>> Here is my sample code
>>>>>
>>>>> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml 
>>>>> " xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema 
>>>>> " xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms 
>>>>> ">
>>>>>     <head>
>>>>>         <title>XForms Hello</title>
>>>>>         <xforms:model>
>>>>>             <xforms:send submission="data-submission"  
>>>>> ev:event="xforms-ready" />
>>>>>             <xforms:instance id="data-instance">
>>>>>                 <data xmlns="">
>>>>>                     <element />
>>>>>                 </data>
>>>>>             </xforms:instance>
>>>>>
>>>>>             <!-- dynamic -->
>>>>>             <xforms:submission id="data-submission"  
>>>>> replace="instance" instance="data-instance" resource="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/
>>>>> {xxforms:get-request-parameter('lang')}.xml" method="get" />
>>>>>
>>>>>             <!--    Hardcoded
>>>>>             <xforms:submission id="data-submission"  
>>>>> replace="instance" instance="data-instance" action="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/foo.xml
>>>>> " method="get" />
>>>>>             -->
>>>>>
>>>>>         </xforms:model>
>>>>>     </head>
>>>>>     <body>
>>>>>     this is the body
>>>>>     <xforms:input ref="instance('data-instance')/element"  
>>>>> incremental="true">
>>>>>             <xforms:label>PO</xforms:label>
>>>>>         </xforms:input>
>>>>>     </body>
>>>>> </html>
>>>>>
>>>>> I am trying to pass a URL with (the parameter) in browser of
>>>>>
>>>>> http://192.168.10.57:8080/orbeon/xforms-hello3/view.xhtml?lang=foo
>>>>>
>>>>>
>>>>> The contents of Foo.xml is
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <data>
>>>>>     <element>1234</element>
>>>>> </data>
>>>>>
>>>>> But the PO text box is empty. If I replace the "dynamic" with  
>>>>> the "hardcoded" then I get the expected value in the textbox.
>>>>>
>>>>> I think I'm taking you too literally or I'm most likey am not  
>>>>> understanding something. What is wrong with my usage of get-
>>>>> request-parameter statement??
>>>>>
>>>>> Thanks,
>>>>>
>>>>>
>>>>> Fleming
>>>>>
>>>>>
>>>>>
>>>>> Erik Bruchez wrote:
>>>>>>
>>>>>> You can't use this function on xforms:instance/@src, or any  
>>>>>> XPath functions for that matter.
>>>>>>
>>>>>> What you can do is react to xforms-ready or xforms-model-
>>>>>> construct done:
>>>>>>
>>>>>>   http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-initialization
>>>>>>
>>>>>> Then the submission can call the function, e.g.:
>>>>>>
>>>>>> <xforms:submission id="load-submission" method ="get"
>>>>>>     resource="oxf:/foo/bar/resource-{xxxforms:get-request-
>>>>>> parameter('lang')}.xml"
>>>>>>     replace="instance" instance="my-instance"/>
>>>>>>
>>>>>> -Erik
>>>>>>
>>>>>> On Apr 4, 2008, at 2:45 PM, Fleming Ho wrote:
>>>>>>> Hi there,
>>>>>>>
>>>>>>> Is there a simple example on how to use xxforms:get-request-
>>>>>>> parameter ?? I'm assuming this allows me to query a value of a  
>>>>>>> parameter passed in the URL?
>>>>>>>
>>>>>>> My objective is to pass the name of an xml filename that would  
>>>>>>> be used to load the initial instance data from. What would the  
>>>>>>> syntax look like to use this dynamic value in the following code
>>>>>>>
>>>>>>>      <xforms:instance src=???
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks in advance.
>>>>>>>
>>>>>>> Fleming
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> "If we can find money to kill people, you can find money to  
>>>>>>> help people."
>>>>>>> "Keeping people hopeless and pessimistic - see I think there  
>>>>>>> are two ways in which people are controlled - first of all  
>>>>>>> frighten people and secondly demoralize them."
>>>>>>> "An educated, healthy and confident nation is harder to  
>>>>>>> govern." -- Tony Benn
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Orbeon Forms - Web Forms for the Enterprise Done the Right Way
>>>>>> http://www.orbeon.com/
>>>>>>
>>>>>
>>>>> --
>>>>> "If we can find money to kill people, you can find money to help  
>>>>> people."
>>>>> "Keeping people hopeless and pessimistic - see I think there are  
>>>>> two ways in which people are controlled - first of all frighten  
>>>>> people and secondly demoralize them."
>>>>> "An educated, healthy and confident nation is harder to govern."  
>>>>> -- Tony Benn
>>>>>
>>>>> --
>>>>> You receive this message as a subscriber of the ops-
>>>>> [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/
>>>>
>>>
>>> --
>>> "If we can find money to kill people, you can find money to help  
>>> people."
>>> "Keeping people hopeless and pessimistic - see I think there are  
>>> two ways in which people are controlled - first of all frighten  
>>> people and secondly demoralize them."
>>> "An educated, healthy and confident nation is harder to govern."  
>>> -- Tony Benn
>>>
>>> --
>>> 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/
>>
>
> --
> "If we can find money to kill people, you can find money to help  
> people."
> "Keeping people hopeless and pessimistic - see I think there are two  
> ways in which people are controlled - first of all frighten people  
> and secondly demoralize them."
> "An educated, healthy and confident nation is harder to govern." --  
> Tony Benn
>
> --
> 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: Re: Re: Re: Example for xxforms:get-request-parameter

Fleming Ho
Oh? That would explain everything. I must've been reading the wrong changelog. :-)

Thanks,

Fleming


Erik Bruchez wrote:
This function was not yet implemented in 3.6. Try a nightly build:

http://forge.objectweb.org/nightlybuilds/ops/ops/

-Erik

On Apr 5, 2008, at 9:48 AM, Fleming Ho wrote:
I'm using 3.6.

Thanks for the tip.

Fleming



Erik Bruchez wrote:

I see, makes sense. What version of Orbeon Forms are you using? get-request-parameter() is a recent addition.

Also, try to enable logging and check the logs to see what happens:

  http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-logging

-Erik

On Apr 5, 2008, at 9:07 AM, Fleming Ho wrote:
Hi Eric,

It's a networked resource, and that's the IP of the computer. It works, though when it's a hardcoded path. I probably don't understand how to use the get-request function. I'm hoping you can provide a literal example.

Thanks.

Fleming


Erik Bruchez wrote:

Fleming,

I am not sure your file URL is correct. Why does it start with "/////192.168.10.57/" ?

-Erik

On Apr 4, 2008, at 7:48 PM, Fleming Ho wrote:
Hi Erik,

Here is my sample code

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
    <head>
        <title>XForms Hello</title>
        <xforms:model>
            <xforms:send submission="data-submission" ev:event="xforms-ready" />
            <xforms:instance id="data-instance">
                <data xmlns="">
                    <element />
                </data>
            </xforms:instance>

            <!-- dynamic -->
            <xforms:submission id="data-submission" replace="instance" instance="data-instance" resource=<a class="moz-txt-link-rfc2396E" href="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/{xxforms:get-request-parameter('lang')}.xml">"file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/{xxforms:get-request-parameter('lang')}.xml" method="get" />

            <!--    Hardcoded
            <xforms:submission id="data-submission" replace="instance" instance="data-instance" action="file://///192.168.10.57/applications/j2ee-modules/orbeon/WEB-INF/resources/apps/xforms-hello3/foo.xml" method="get" />
            -->

        </xforms:model>
    </head>
    <body>
    this is the body
    <xforms:input ref="instance('data-instance')/element" incremental="true">
            <xforms:label>PO</xforms:label>
        </xforms:input>
    </body>
</html>

I am trying to pass a URL with (the parameter) in browser of

http://192.168.10.57:8080/orbeon/xforms-hello3/view.xhtml?lang=foo


The contents of Foo.xml is

<?xml version="1.0" encoding="UTF-8"?>
<data>
    <element>1234</element>
</data>

But the PO text box is empty. If I replace the "dynamic" with the "hardcoded" then I get the expected value in the textbox.

I think I'm taking you too literally or I'm most likey am not understanding something. What is wrong with my usage of get-request-parameter statement??

Thanks,


Fleming



Erik Bruchez wrote:

You can't use this function on xforms:instance/@src, or any XPath functions for that matter.

What you can do is react to xforms-ready or xforms-model-construct done:

  http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-initialization

Then the submission can call the function, e.g.:

<xforms:submission id="load-submission" method ="get"
    resource="oxf:/foo/bar/resource-{xxxforms:get-request-parameter('lang')}.xml"
    replace="instance" instance="my-instance"/>

-Erik

On Apr 4, 2008, at 2:45 PM, Fleming Ho wrote:
Hi there,

Is there a simple example on how to use xxforms:get-request-parameter ?? I'm assuming this allows me to query a value of a parameter passed in the URL?

My objective is to pass the name of an xml filename that would be used to load the initial instance data from. What would the syntax look like to use this dynamic value in the following code

     <xforms:instance src=???



Thanks in advance.

Fleming




-- 
"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn


-- 
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/


-- 
"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn

-- 
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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/


-- 
"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn

-- 
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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/


-- 
"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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/


--
Untitled Document

"If we can find money to kill people, you can find money to help people."
"Keeping people hopeless and pessimistic - see I think there are two ways in which people are controlled - first of all frighten people and secondly demoralize them."
"An educated, healthy and confident nation is harder to govern." -- Tony Benn



--
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