Hi,
Can anyone help with this? We're pretty new to using Orbeon and are having some fun trying to configure it. We are connecting Orbeon Forms to a custom persistence API. As part of this, we'd like certain HTTP headers added by our platform to be passed through the Form Builder to this persistence layer, ideally with the opportunity to inspect/modify them along the way. I've had a look at various ways of tying this into auth servlets, but can't seem to get this to work. So far, the closest I can get to what I'd like to do is to add a custom epilogue file with something like: [snip] <p:processor name="oxf:request"> <p:input name="config"> <config> <include>/request</include> </config> </p:input> <p:output name="data" id="request"/> </p:processor> <p:processor name="oxf:html-converter"> <p:input name="config"> <config> <encoding>utf-8</encoding> </config> </p:input> <p:input name="data" href="#xformed-data"/> <p:output name="data" id="converted"/> </p:processor> <p:processor name="oxf:http-serializer"> <p:input name="config"> <config> <force-content-type>true</force-content-type> <content-type>text/html</content-type> <header> <name>header1</name> <value>/request/headers/header[name = 'header1ext']/text()</value> </header> <header> <name>header2</name> <value>/request/headers/header[name = 'header2ext']/text()</value> </header> <header> <name>header3</name> <value>/request/headers/header[name = 'header3ext']/text()</value> </header> </config> </p:input> <p:input name="data" href="#converted"/> </p:processor> [/snip] As far as I can tell, this ought to look at the incoming headers and put those on the outgoing request, but this doesn't seem to happen. Like I said, this is from Form Builder; these headers will identify the user building the form and allow us to do some access management at the back end too. For "normal" xform submission, I have: [snip] <property as="xs:string" name="oxf.http.forward-headers" value="header1 header2 header3"/> [/snip] In my properties-local.xml. We're using Orbeon 4.0.0.beta2-CE. Many thanks, Phil. |
Found the solution to this by poring through some back posts, etc.
I had to make a local version of crud.xml, tailored for our "custom" persistence setup at: /WEB-INF/resources/apps/fr/persistence/special/crud.xpl I made sure that my properties-local.xml file referenced "custom" in place of "exist" and did the same within my new cloned crud.xpl At the end of this file, there is a reference to a http-serializer processor - stuck my headers in there and saw them from my persistence layer: <p:processor name="oxf:http-serializer"> <p:input name="config"> <config> <cache-control> <use-local-cache>false</use-local-cache> </cache-control> <header> <name>header1</name> <value>/request/headers/header[name = 'header1ext']/text()</value> </header> <header> <name>header2</name> <value>/request/headers/header[name = 'header2ext']/text()</value> </header> <header> <name>header3</name> <value>/request/headers/header[name = 'header3ext']/text()</value> </header> </config> </p:input> <p:input name="data" href="#converted"/> </p:processor> Wasn't easy to come across details of crud.xpl and hacking the persistence layer, though. Cheers, Phil. |
Administrator
|
Hi Phil, I am surprised that you have to go through this, as with 4.0 headers are passed to the persistence API, so it should be enough that your headers is listed in the oxf.xforms.forward-submission-headers property. And the code you're quoting with the http-serializer makes sure that some headers (not sure where they come from) are returned from the persistence layer, not sent to it. I must be missing something here, and since this is working for you, maybe you shouldn't worry about it!
Alex On Mon, Jan 28, 2013 at 6:29 AM, pc3356 <[hidden email]> wrote: Found the solution to this by poring through some back posts, etc. Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi Alex,
Yes, setting the "oxf.xforms.forward-submission-headers" appropriately did seem to work (incidentally, this property doesn't seem to be documented with the bulk of the rest of the properties, only in a page about authentication) - our requirement is slightly evolved from what I originally thought, simple pass-through. We need to rename the incoming header to a new name; I'm going to try a couple of things to achieve this - I suspect that this might be possible with a combination of forward-submission-headers/forward-headers (for the new names) and an http-serializer in either the epilogue.xpl or crud.xpl (to add headers from the old ones, as per my example above). Does this sound reasonable, or will I need a more radical approach? I'd prefer not to have to write a custom processor if I can avoid it. Cheers, Phil. |
Administrator
|
Hi Phil, I am wondering if you could use the (excellent!) UrlRewriteFilter to add a new header based on the value of an existing header, and then just ask Orbeon Forms to forward that new header. I think I'd rather do that than write a new persistence layer or a new processor. If UrlRewriteFilter doesn't do the trick, you could write your own filter that does that.
Alex On Mon, Jan 28, 2013 at 11:10 PM, pc3356 <[hidden email]> wrote: Hi Alex, Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi Alex,
I'd been looking at tuckey for some other things, but I don't think it's quite suitable for our stack here. Instead, I wrote a simple filter that overrides the various getHeader methods of the HttpServletRequestWrapper and dropped it into the web.xml. I used the maven overlay plugin to create an overlay directory structure to pull this and other dependencies in. Cheers! Phil. |
Administrator
|
Hi Phil,
Sure, doing your own filter works as well! I am glad you solved this one. Alex On Wed, Feb 6, 2013 at 9:09 AM, pc3356 <[hidden email]> wrote: > Hi Alex, > > I'd been looking at tuckey for some other things, but I don't think it's > quite suitable for our stack here. > > Instead, I wrote a simple filter that overrides the various getHeader > methods of the HttpServletRequestWrapper and dropped it into the web.xml. > > I used the maven overlay plugin to create an overlay directory structure to > pull this and other dependencies in. > > Cheers! > > Phil. > > > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Form-Builder-and-HTTP-headers-tp4656208p4656242.html > Sent from the Orbeon Forms (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 > -- Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |