Login  Register

Re: Can anyone tell me where this file will be whats the name of this

Posted by Tom Grahame on Mar 08, 2011; 3:00pm
URL: https://discuss.orbeon.com/Can-anyone-tell-me-where-this-file-will-be-whats-the-name-of-this-tp3341219p3341546.html

Reposting because I missed the raw tags:

Smaran,

There are two ways that I can think of to add attributes to that XML infoset; changing the HTTP request that the request generator is describing and transforming the infoset using XSLT. I think the first way is the one you might be interested in.

Depending upon how crud.xpl is activated in page-flow, you could add URL parameters to a GET request and they would appear in the request infoset. So if your page flow was like this (not tested):

<page id="crud" path-info="/crud" view="crud.xpl"/>

And you made this GET request

http://locahost:8080/orbeon/crud?username=tom&password=insecure

This would appear as part of your request infoset (the rest of the infoset excluded for brevity):
<parameters>
<parameter>
<name>username</name>
<value>tom</value>
</parameter>
<parameter>
<name>password</name>
<value>insecure</value>
</parameter/>
</parameters>

Similarly, if you change any other parts of the HTTP request the crud.xpl receives, like the port, remote address, or anything else, those values will be changed in the request infoset.

I recommend you add a debug attribute to your request generator and then execute crud.xpl with different HTTP requests, whilst watching the output of orbeon.log to see how the XML changes.

<p:processor name="oxf:request">
<p:input name="config">
<config>
<include>/request</include>
</config>
</p:input>
<p:output name="data" id="request" debug="request"/>
</p:processor>

Now if what you're actually trying to achieve is an authentication mechanism, I have had success by reading session parameters in XPL using the scope-generator processor. In my application a Struts action handles the authentication against LDAP and writes a parameter isValid into the session if the authentication is successful. Any pipelines that need to be authenticated are able to read from the session and check for that value:

<p:processor name="oxf:scope-generator">
<p:input name="config">
<config>
<key>isValid</key>
<scope>session</scope>
<session-scope>application</session-scope>
</config>
</p:input>
<p:output name="data" id="isValid"/>
</p:processor>

Hope that helps,

Tom