Integrating Orbeon with existing servlets

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

Integrating Orbeon with existing servlets

Adam Flinton-2
Dear All,

We have a system build from a central servlet which renders XML model
files into XHTML. The XHTML includes links which includes an XPATH to
the original fragment of XML in the pre-rendered XML document.

This document is held in the controller servlet as a DOM in a hashtable.

The flow is that

1)  Someone clicks on a link.
2) The link posts the XPath and url/name of document (along with a
number to denote the operation is an extract) to the controller servlet (cs)
3) The cs uses the XPath & the url to find the relevant dom, extract the
relevant piece of xml as a string.
4)  The cs then opens a popup/another jsp providing it with the relevant
xml as a string contained in a form.
5) The JSP extracts the xml & ddoes whatever it does (e.g. if it was an
XHTML WYSIWYG it provides it to Tiny_mce so it can be edited).
6) When the user is finished, the popup/jsp posts back to the cs the
changed xml, the xpath, the url of the original document & a number
denoting the required operation is an insert.
7) The cs then sets the value in the dom keyed by the url at the
position keyed by the xpath to be the new value.
8) The cs then rerenders & the user's browser then refreshes.


What I'd like to be able to do is to use XForms/Orbeon to produce all
the popups as XForms.


A) I'd like to be send the extracted xml to an orbeon hosted xform to
function as the xform's model along with the xpath & file url.
B) I'd have to be able accept, hold & then post back the xpath & file
url outside of the model (or as a second hidden model).


The main thing is to be able to post model/instance info to an orbeon
hosted xform from a non-orbeon jsp/servlet.

Any ideas?


TIA


Adam





--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Integrating Orbeon with existing servlets

Erik Bruchez
Administrator
Adam Flinton wrote:

> Dear All,
>
> We have a system build from a central servlet which renders XML model
> files into XHTML. The XHTML includes links which includes an XPATH to
> the original fragment of XML in the pre-rendered XML document.
>
> This document is held in the controller servlet as a DOM in a hashtable.
>
> The flow is that
>
> 1)  Someone clicks on a link.
> 2) The link posts the XPath and url/name of document (along with a
> number to denote the operation is an extract) to the controller servlet
> (cs)
> 3) The cs uses the XPath & the url to find the relevant dom, extract the
> relevant piece of xml as a string.
> 4)  The cs then opens a popup/another jsp providing it with the relevant
> xml as a string contained in a form.
> 5) The JSP extracts the xml & ddoes whatever it does (e.g. if it was an
> XHTML WYSIWYG it provides it to Tiny_mce so it can be edited).
> 6) When the user is finished, the popup/jsp posts back to the cs the
> changed xml, the xpath, the url of the original document & a number
> denoting the required operation is an insert.
> 7) The cs then sets the value in the dom keyed by the url at the
> position keyed by the xpath to be the new value.
> 8) The cs then rerenders & the user's browser then refreshes.
>
>
> What I'd like to be able to do is to use XForms/Orbeon to produce all
> the popups as XForms.
>
>
> A) I'd like to be send the extracted xml to an orbeon hosted xform to
> function as the xform's model along with the xpath & file url.
> B) I'd have to be able accept, hold & then post back the xpath & file
> url outside of the model (or as a second hidden model).
>
>
> The main thing is to be able to post model/instance info to an orbeon
> hosted xform from a non-orbeon jsp/servlet.
>
> Any ideas?
One way of doing it:

o Have your current code that produces XML store the resulting XML in
the Servlet Request object.

o Forward the request to a path in your webapp (or in another webapp)
which is handled by OPS.

o Write an page model XML pipeline with OPS which fetches the XML using
the Scope generator (it supports DOM and dom4j among others) and returns
it on its "data" output.

o In your page view, whether a static XHTML with XInclude, or an XSLT
view, include the resulting XML as an XForms model or instance.

There are other ways, such as using an XForms submission upon
xforms-ready to call your Servlet or JSP page, assuming it can return on
its output well-formed XML. You could also use the OPS Servlet Include
generator, or Servlet Filter generator.

I would try to use forwarding or an XForms submission upon xforms-ready
first.

-Erik




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Integrating Orbeon with existing servlets

Adam Flinton-2
Thanks. Giving it a go now.

Adam

Erik Bruchez wrote:

> Adam Flinton wrote:
>> Dear All,
>>
>> We have a system build from a central servlet which renders XML model
>> files into XHTML. The XHTML includes links which includes an XPATH to
>> the original fragment of XML in the pre-rendered XML document.
>>
>> This document is held in the controller servlet as a DOM in a hashtable.
>>
>> The flow is that
>>
>> 1)  Someone clicks on a link.
>> 2) The link posts the XPath and url/name of document (along with a
>> number to denote the operation is an extract) to the controller
>> servlet (cs)
>> 3) The cs uses the XPath & the url to find the relevant dom, extract
>> the relevant piece of xml as a string.
>> 4)  The cs then opens a popup/another jsp providing it with the
>> relevant xml as a string contained in a form.
>> 5) The JSP extracts the xml & ddoes whatever it does (e.g. if it was
>> an XHTML WYSIWYG it provides it to Tiny_mce so it can be edited).
>> 6) When the user is finished, the popup/jsp posts back to the cs the
>> changed xml, the xpath, the url of the original document & a number
>> denoting the required operation is an insert.
>> 7) The cs then sets the value in the dom keyed by the url at the
>> position keyed by the xpath to be the new value.
>> 8) The cs then rerenders & the user's browser then refreshes.
>>
>>
>> What I'd like to be able to do is to use XForms/Orbeon to produce all
>> the popups as XForms.
>>
>>
>> A) I'd like to be send the extracted xml to an orbeon hosted xform to
>> function as the xform's model along with the xpath & file url.
>> B) I'd have to be able accept, hold & then post back the xpath & file
>> url outside of the model (or as a second hidden model).
>>
>>
>> The main thing is to be able to post model/instance info to an orbeon
>> hosted xform from a non-orbeon jsp/servlet.
>>
>> Any ideas?
>
> One way of doing it:
>
> o Have your current code that produces XML store the resulting XML in
> the Servlet Request object.
>
> o Forward the request to a path in your webapp (or in another webapp)
> which is handled by OPS.
>
> o Write an page model XML pipeline with OPS which fetches the XML
> using the Scope generator (it supports DOM and dom4j among others) and
> returns it on its "data" output.
>
> o In your page view, whether a static XHTML with XInclude, or an XSLT
> view, include the resulting XML as an XForms model or instance.
>
> There are other ways, such as using an XForms submission upon
> xforms-ready to call your Servlet or JSP page, assuming it can return
> on its output well-formed XML. You could also use the OPS Servlet
> Include generator, or Servlet Filter generator.
>
> I would try to use forwarding or an XForms submission upon
> xforms-ready first.
>
> -Erik
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws