I'm running Orbeon 3.6 as a separate service from my JSP application. I
have a simple Java controller that does some processing and then directs the flow to the next page. I am reading the XML response from the previous page with the code below. Can anyone tell me how, after I make changes to the XML, I can pass the new version into the following page? // Check the XML payload ServletInputStream xmlStream = request.getInputStream(); InputStreamReader xmlStreamReader = new InputStreamReader(xmlStream); BufferedReader xmlReader = new BufferedReader(xmlStreamReader); StringBuffer xml = new StringBuffer(); String line = null; while((line = xmlReader.readLine()) != null) { xml.append(line+"\n"); } System.out.println("\t XML Payload: " + xml.toString()); Thanks, Dustin -- 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 |
Administrator
|
Dustin,
On Jan 14, 2008 10:04 PM, Dustin Henson <[hidden email]> wrote: > I'm running Orbeon 3.6 as a separate service from my JSP application. I > have a simple Java controller that does some processing and then directs > the flow to the next page. I am reading the XML response from the > previous page with the code below. Can anyone tell me how, after I make > changes to the XML, I can pass the new version into the following page? > > // Check the XML payload > ServletInputStream xmlStream = request.getInputStream(); > InputStreamReader xmlStreamReader = new InputStreamReader(xmlStream); > BufferedReader xmlReader = new BufferedReader(xmlStreamReader); > > StringBuffer xml = new StringBuffer(); > String line = null; > while((line = xmlReader.readLine()) != null) > { > xml.append(line+"\n"); > } > System.out.println("\t XML Payload: " + xml.toString()); to post it back to another URL on the same server; is that it? In Java you should be able to do that doing a forward with the servlet API. Maybe I am asking too many questions :), but I am wondering why you would need to do that, and if there is another way to do it within Orbeon that wouldn't require you to write Java code. Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise 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 |
Hi Alex, The problem: I haven't found any documentation on how to pass data from a JSP page in a separate WAR so that Orbeon will include it in the final page. I'm continuing to try different approaches to pass the XML on, but I though I'd through it up to the list to see if anyone has already done this.
On 1/15/08, Alessandro Vernet <[hidden email]> wrote:
Dustin, -- 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 |
Administrator
|
Dustin,
On Jan 15, 2008 8:04 PM, Dustin Henson <[hidden email]> wrote: > The problem: > Right now XML exchange from page to page is broken. The java application > sees the XML, but it does not flow into the following data entry page to > have additional data added to it. I could probably accomplish this with > standard Orbeon configuration, but the controller will also need to insert > data into the XML document. For instance the java code will need to add a > dynamically generated transaction number to the XML that the user can keep > for his records. > > I haven't found any documentation on how to pass data from a JSP page in a > separate WAR so that Orbeon will include it in the final page. I'm > continuing to try different approaches to pass the XML on, but I though I'd > through it up to the list to see if anyone has already done this. http://www.orbeon.com/ops/doc/reference-xforms-java). Is that right? If you are, HTTP requests from the browser are always handled by your own servlet. If you have an XML document that you want to "pass to XFoms", you can "write it" inside an <xforms:instance> ... your XML here ... </xforms:instance>. Or am I misunderstanding your setup? Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise 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 |
Hi Alex,
Yes, that is exactly it and that is the guide I followed, plus a few needed tweaks I found in the forums to make paths work.. Last night I figured out that I had to insert the XML into a <xforms:instance id="default-instance"> tag. The problem I'm having what that is Orbeon is not handling the XML the same when it is hard coded in the tag as when it is in a file. Switching from : <xforms:instance src="/myapp/xml/who.xml" id="default-instance"/> To: <xforms:instance id="default-instance"> <IDTIncident xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/idtheft/xml/who.xsd"> <IncidentIdentifier></IncidentIdentifier> <IncidentReportingDate></IncidentReportingDate> <IncidentReportingTime></IncidentReportingTime> <IncidentDate></IncidentDate> <IncidentTime>00:00:00</IncidentTime> ... other data in who.xml </IDTIncident> </xforms:instance> On the resulting pages the data entry fields are missing and only their labels are showing. Any idea what would cause this? Thanks, Dustin On 1/17/08, Alessandro Vernet <[hidden email]> wrote: Dustin, -- 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 |
Administrator
|
Yes, try to add xmlns="" on the <IDTIncident> element.
-Erik On Jan 18, 2008, at 3:37 AM, Dustin Henson wrote: > Hi Alex, > > Yes, that is exactly it and that is the guide I followed, plus a few > needed tweaks I found in the forums to make paths work.. Last night > I figured out that I had to insert the XML into a <xforms:instance > id="default-instance"> tag. The problem I'm having what that is > Orbeon is not handling the XML the same when it is hard coded in the > tag as when it is in a file. > > Switching from : > <xforms:instance src="/myapp/xml/who.xml" id="default-instance"/> > > To: > <xforms:instance id="default-instance"> > <IDTIncident xmlns:xsi="http://www.w3.org/2001/XMLSchema- > instance" xsi:noNamespaceSchemaLocation="/idtheft/xml/who.xsd"> > <IncidentIdentifier></IncidentIdentifier> > <IncidentReportingDate></IncidentReportingDate> > <IncidentReportingTime></IncidentReportingTime> > <IncidentDate></IncidentDate> > <IncidentTime>00:00:00</IncidentTime> > ... other data in who.xml > </IDTIncident> > </xforms:instance> > > On the resulting pages the data entry fields are missing and only > their labels are showing. Any idea what would cause this? > > Thanks, > Dustin > > On 1/17/08, Alessandro Vernet <[hidden email]> wrote: Dustin, > > On Jan 15, 2008 8:04 PM, Dustin Henson <[hidden email]> > wrote: > > The problem: > > Right now XML exchange from page to page is broken. The java > application > > sees the XML, but it does not flow into the following data entry > page to > > have additional data added to it. I could probably accomplish this > with > > standard Orbeon configuration, but the controller will also need > to insert > > data into the XML document. For instance the java code will need > to add a > > dynamically generated transaction number to the XML that the user > can keep > > for his records. > > > > I haven't found any documentation on how to pass data from a JSP > page in a > > separate WAR so that Orbeon will include it in the final page. I'm > > continuing to try different approaches to pass the XML on, but I > though I'd > > through it up to the list to see if anyone has already done this. > > So it seems you are using separate deployment (as documented on > http://www.orbeon.com/ops/doc/reference-xforms-java). Is that right? > If you are, HTTP requests from the browser are always handled by your > own servlet. If you have an XML document that you want to "pass to > XFoms", you can "write it" inside an <xforms:instance> ... your XML > here ... </xforms:instance>. Or am I misunderstanding your setup? > > Alex > -- > Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise > 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 > > > > -- > 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 |
Administrator
|
On Jan 18, 2008 11:50 AM, Erik Bruchez <[hidden email]> wrote:
> Yes, try to add xmlns="" on the <IDTIncident> element. If that is the problem, my favorite recommendation will be not to use default namespaces to avoid this type of problems :). Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise 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 |
Thanks this did the trick. The one catch is that the XML returned by the xforms has the xmlns="" removed from it. It also has <?xml version="1.0" encoding="UTF-8"?> added to the beginning. In order to make the get the XML to flow from page to page I need to remove the XML declaration and add the xmlns="" back in. Thanks, Dustin On 1/23/08, Dustin Henson <[hidden email]> wrote: Thanks this did the trick. -- 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 |
Administrator
|
Dustin,
On Jan 23, 2008 7:55 PM, Dustin Henson <[hidden email]> wrote: > The one catch is that the XML returned by the xforms has the xmlns="" > removed from it. It also has <?xml version="1.0" encoding="UTF-8"?> added to > the beginning. In order to make the get the XML to flow from page to page I > need to remove the XML declaration and add the xmlns="" back in. Right. Unless you don't have a default namespace declared in the page, in which case you can just insert the XML without worrying about a xmlns="". 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 |
Free forum by Nabble | Edit this page |