Usage of xxforms:get-request-header & xxforms:get-remote-user

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

Usage of xxforms:get-request-header & xxforms:get-remote-user

Hoi Chong
Hi,
I am running the latest Orbeon 3.7 Nightly (14/2/2009).
I am modifying the welcome/view.xhtml by adding the below code to <head> tag.

                <xforms:model>

                        <xforms:instance id="keyparams">
                                <keyparams xmlns="">
                                        <user-agent/>
                                        <remote-user/>
                                        <user-role/>
                                </keyparams>
                        </xforms:instance>

                       
                        <xforms:setvalue ev:event="xforms-model-construct-done" ref="instance('keyparams')/user-agent" select="xxforms:get-request-header('User-Agent')"/>

                        <xforms:setvalue ev:event="xforms-model-construct-done" ref="instance('keyparams')/remote-user" select="xxforms:get-remote-user()"/>

                </xforms:model>

I am not getting any errors, the Welcome page will appear but the user-agent and remote-user values are not filled in. Which could imply that xxforms:get-request-header & xxforms:get-remote-user are not returning the values.

Before accessing /orbeon/welcome/ I accessed to /orbeon/java-authentication/ to login as a valid user.

Anyone that has successfully use this on Orbeon 3.7 nightly? And what is the right way to use these 2 Orbeon XForms functions?

Thanks.
Hoi Chong
Reply | Threaded
Open this post in threaded view
|

Re: Usage of xxforms:get-request-header & xxforms:get-remote-user

Hoi Chong
Hi,
I found what is the mistake.
The correct syntax to use is...

                        <xforms:setvalue ev:event="xforms-model-construct-done" ref="instance('keyparams')/user-agent" value="xxforms:get-request-header('User-Agent')"/>

                        <xforms:setvalue ev:event="xforms-model-construct-done" ref="instance('keyparams')/remote-user" value="xxforms:get-remote-user()"/>

There are mistakes in this doc page (http://www.orbeon.com/ops/doc/reference-xforms-functions#orbeon-extensions).
setvalue examples are refering to "select" instead of "value".

Regards.




hoichong wrote
Hi,
I am running the latest Orbeon 3.7 Nightly (14/2/2009).
I am modifying the welcome/view.xhtml by adding the below code to <head> tag.

                <xforms:model>

                        <xforms:instance id="keyparams">
                                <keyparams xmlns="">
                                        <user-agent/>
                                        <remote-user/>
                                        <user-role/>
                                </keyparams>
                        </xforms:instance>

                       
                        <xforms:setvalue ev:event="xforms-model-construct-done" ref="instance('keyparams')/user-agent" select="xxforms:get-request-header('User-Agent')"/>

                        <xforms:setvalue ev:event="xforms-model-construct-done" ref="instance('keyparams')/remote-user" select="xxforms:get-remote-user()"/>

                </xforms:model>

I am not getting any errors, the Welcome page will appear but the user-agent and remote-user values are not filled in. Which could imply that xxforms:get-request-header & xxforms:get-remote-user are not returning the values.

Before accessing /orbeon/welcome/ I accessed to /orbeon/java-authentication/ to login as a valid user.

Anyone that has successfully use this on Orbeon 3.7 nightly? And what is the right way to use these 2 Orbeon XForms functions?

Thanks.
Hoi Chong
Reply | Threaded
Open this post in threaded view
|

Re: Re: Usage of xxforms:get-request-header & xxforms:get-remote-user

Alessandro Vernet
Administrator
On Feb 16, 2009, at 4:53 AM, hoichong wrote:

> I found what is the mistake.
> The correct syntax to use is...
>
> <xforms:setvalue ev:event="xforms-model-construct-done"
> ref="instance('keyparams')/user-agent"
> value="xxforms:get-request-header('User-Agent')"/>
>
> <xforms:setvalue ev:event="xforms-model-construct-done"
> ref="instance('keyparams')/remote-user" value="xxforms:get-remote-
> user()"/>
Yes, good point! This is now fixed in CVS. Thanks for letting us know  
about it.

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