Multi-page XForms in Separate Deployment

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

Multi-page XForms in Separate Deployment

Jeremy Nix
Has anyone designed a site that contained multi-page XForms in a Orbeon
separate deployment integration?  If so, how did you resolve the issue
of needing to keep around the submission XML for multiple pages as the
user made their changes?

I've been attempting various integration points over the past couple
days and keep running into issues; not with Orbeon but with the
underlying technologies involved.  I've tried creating a PageFlow based
application and housing it within the Orbeon install, but I then run
into problems as my main application has to figure out how to feed up
the XML both for the default-submission and for an XSLT transformation.  
I tried using the URLResouceManager, but ran into problems with the fact
that a new session gets created when Orbeon makes the URL request over
to the main web application.  I'm now trying to figure out how I can
save the XML out on the filesystem somewhere so that my Orbeon PageFlow
can pick it up and generate the XHTML form.  We will have multiple users
in this system, each generating XML files that is particular to their
needs, so I now run into the question of how do I dynamically change the
default-submission URL and the URL's referenced in my pipeline to
support this dynamic nature?  Here's a snippet of my pipeline:

<p:processor name="oxf:xslt" xmlns:p="http://www.orbeon.com/oxf/pipeline">
<p:input name="request" href="#reqParams" />
<!-- Can this href be set dynamically? -->
<p:input name="data" href="/myapp/page.jsf" />
<p:input name="config">
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="dataentry.xsl" /> <!-- stylesheet in same dir as xpl -->
<xsl:param name="baseUrl"
select="concat(doc('input:request')/request/scheme, '://',
doc('input:request')/request/server-name, ':',
doc('input:request')/request/server-port, '/')" />
</xsl:stylesheet>
</p:input>
<p:output name="data" ref="data" />
</p:processor>

The above example might be convoluted, but the end goal is to have our
main web application utilize XForms for a small portion of data entry.  
This data entry involves multiple pages, which seem to be supported well
if utilizing Orbeon as your base architecture, but not so much if you
use a separate deployment.

If anyone has any ideas, comments on what you've tried, etc... I'd love
to hear them.

--
------------------------------------------------------------------------
Jeremy Nix
Senior Application Developer
Cincinnati Children's Hospital Medical Center


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Multi-page XForms in Separate Deployment

Alessandro  Vernet
Administrator
Jeremy,

Using separate deployment shouldn't change much here: you can POST the
XML from one page to the next with an <xforms:submission
replace="all">. See the following:
http://wiki.orbeon.com/forms/how-to/navigate-to-search-page. And if
you really want to store XML in the session (which I would really not
recommend, and use only as a last resort measure!), see:
http://wiki.orbeon.com/forms/how-to/store-xml-in-the-session. Does
this help, or did I misunderstand your question?

Alex

On Fri, Jun 25, 2010 at 10:54 AM, Jeremy Nix <[hidden email]> wrote:

> Has anyone designed a site that contained multi-page XForms in a Orbeon
> separate deployment integration?  If so, how did you resolve the issue of
> needing to keep around the submission XML for multiple pages as the user
> made their changes?
>
> I've been attempting various integration points over the past couple days
> and keep running into issues; not with Orbeon but with the underlying
> technologies involved.  I've tried creating a PageFlow based application and
> housing it within the Orbeon install, but I then run into problems as my
> main application has to figure out how to feed up the XML both for the
> default-submission and for an XSLT transformation.  I tried using the
> URLResouceManager, but ran into problems with the fact that a new session
> gets created when Orbeon makes the URL request over to the main web
> application.  I'm now trying to figure out how I can save the XML out on the
> filesystem somewhere so that my Orbeon PageFlow can pick it up and generate
> the XHTML form.  We will have multiple users in this system, each generating
> XML files that is particular to their needs, so I now run into the question
> of how do I dynamically change the default-submission URL and the URL's
> referenced in my pipeline to support this dynamic nature?  Here's a snippet
> of my pipeline:
>
> <p:processor name="oxf:xslt" xmlns:p="http://www.orbeon.com/oxf/pipeline">
> <p:input name="request" href="#reqParams" />
> <!-- Can this href be set dynamically? -->
> <p:input name="data" href="/myapp/page.jsf" />
> <p:input name="config">
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:import href="dataentry.xsl" /> <!-- stylesheet in same dir as xpl -->
> <xsl:param name="baseUrl"
> select="concat(doc('input:request')/request/scheme, '://',
> doc('input:request')/request/server-name, ':',
> doc('input:request')/request/server-port, '/')" />
> </xsl:stylesheet>
> </p:input>
> <p:output name="data" ref="data" />
> </p:processor>
>
> The above example might be convoluted, but the end goal is to have our main
> web application utilize XForms for a small portion of data entry.  This data
> entry involves multiple pages, which seem to be supported well if utilizing
> Orbeon as your base architecture, but not so much if you use a separate
> deployment.
>
> If anyone has any ideas, comments on what you've tried, etc... I'd love to
> hear them.
>
> --
> ------------------------------------------------------------------------
> Jeremy Nix
> Senior Application Developer
> Cincinnati Children's Hospital Medical Center
>
>
> --
> 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, open-source, for the Enterprise -
http://www.orbeon.com/
My 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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Multi-page XForms in Separate Deployment

Alistair Miles-2
In reply to this post by Jeremy Nix
Hi Jeremy,

This is just a thought, and won't solve your basic issue about POSTing
data between pages when using Orbeon under separate deployment, but we
recently developed a multi-page xform (a wizard), and the style we
used was *not* to pass the form state between pages directly via a
POST, or to use a single page with a switch, but rather to create a
new "draft" data resource when the user begins the wizard, then to
save (PUT) the form state before moving the user between pages. This
enables sensible behaviour on browser refresh (you return to the same
step in the wizard with your data as it was at the last page) and also
gives you a list of incomplete drafts should your user want to break
off half-way and finish later.

I.e., (simplified, but hopefully gets the basic idea across)...

[user enters /wizard/page1]

POST /data/drafts
<atom:entry> [... form data template, nothing filled in ...] </atom:entry>

201 Created
Location: /data/drafts/abcd

[user fills in some fields, then navigates away from /wizard/page1, which your XForms intercepts and sends...]

PUT /data/drafts/abcd
<atom:entry> [... form data ...] </atom:entry>

[...before sending the user onto /wizard/page2?draft=/data/drafts/abcd, which sends...]

GET /data/drafts/abcd

[...to fetch the form data on xforms-model-construct-done]

I'm very interested to hear of your continued experience using Orbeon
under separate deployment - we're considering doing the same, as it
makes upgrading Orbeon much easier, so very useful to hear about the
issues you encounter.

Cheers

Alistair

On Fri, Jun 25, 2010 at 01:54:29PM -0400, Jeremy Nix wrote:

> Has anyone designed a site that contained multi-page XForms in a
> Orbeon separate deployment integration?  If so, how did you resolve
> the issue of needing to keep around the submission XML for multiple
> pages as the user made their changes?
>
> I've been attempting various integration points over the past couple
> days and keep running into issues; not with Orbeon but with the
> underlying technologies involved.  I've tried creating a PageFlow
> based application and housing it within the Orbeon install, but I
> then run into problems as my main application has to figure out how
> to feed up the XML both for the default-submission and for an XSLT
> transformation.  I tried using the URLResouceManager, but ran into
> problems with the fact that a new session gets created when Orbeon
> makes the URL request over to the main web application.  I'm now
> trying to figure out how I can save the XML out on the filesystem
> somewhere so that my Orbeon PageFlow can pick it up and generate the
> XHTML form.  We will have multiple users in this system, each
> generating XML files that is particular to their needs, so I now run
> into the question of how do I dynamically change the
> default-submission URL and the URL's referenced in my pipeline to
> support this dynamic nature?  Here's a snippet of my pipeline:
>
> <p:processor name="oxf:xslt" xmlns:p="http://www.orbeon.com/oxf/pipeline">
> <p:input name="request" href="#reqParams" />
> <!-- Can this href be set dynamically? -->
> <p:input name="data" href="/myapp/page.jsf" />
> <p:input name="config">
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:import href="dataentry.xsl" /> <!-- stylesheet in same dir as xpl -->
> <xsl:param name="baseUrl"
> select="concat(doc('input:request')/request/scheme, '://',
> doc('input:request')/request/server-name, ':',
> doc('input:request')/request/server-port, '/')" />
> </xsl:stylesheet>
> </p:input>
> <p:output name="data" ref="data" />
> </p:processor>
>
> The above example might be convoluted, but the end goal is to have
> our main web application utilize XForms for a small portion of data
> entry.  This data entry involves multiple pages, which seem to be
> supported well if utilizing Orbeon as your base architecture, but
> not so much if you use a separate deployment.
>
> If anyone has any ideas, comments on what you've tried, etc... I'd
> love to hear them.
>
> --
> ------------------------------------------------------------------------
> Jeremy Nix
> Senior Application Developer
> Cincinnati Children's Hospital Medical Center

>
> --
> 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


--
Alistair Miles
Head of Epidemiological Informatics
Centre for Genomics and Global Health <http://cggh.org>
The Wellcome Trust Centre for Human Genetics
Roosevelt Drive
Oxford
OX3 7BN
United Kingdom
Web: http://purl.org/net/aliman
Email: [hidden email]
Tel: +44 (0)1865 287669


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Multi-page XForms in Separate Deployment

Jeremy Nix
In reply to this post by Alessandro Vernet
Alex,

I found that the page flow controller option described in the
navigate-to-search-page example did not work for me because of the fact
that my pipeline XSLT transformation was being driving by dynamic source
data(<p:input name="data" href="/myapp/page.jsf" />).  I also had
another issue involving the default submission and the fact that the
link for that had to be dynamic as well.  This dynamic nature made the
page flow controller configuration not possible.  For instance, if I
could create and store these XML files on the filesystem and then
somehow have the page flow components pick up and use those XML files,
that would be one way around this.  I know that its possible to use URL
pattern matching capabilities with the default submission value, but I
can't say that I've come across an example that allowed that same
pattern match to be available for use with dynamic properties such that
I could do something like this:

URL: http://localhost/orbeon/myapp/XML_12345
Page Definition: <page path-info="/myapp/([^/]*)"
matcher="oxf:perl5-matcher"
default-submission="file:///xml_repo/formdata/${1}.xml" />
XSLT Pipeline data input: <p:input name="data"
href="file:///xml_repo/formdefs/${1}.xml" />

As for the session idea.  I did not come across this solution before.  I
do agree that storing XML in the session has its downfalls, but it could
be an option.

I do have a working solution now that basically does what your 1st
option was doing, except within the confines of my application.  So my
workflow is something like this:

1) In MyApp, user chooses form/data to modify.
2) In MyApp, 2 XML files are created; 1 defining form; 1 defining form data.
3) In MyApp, user is redirected to page that:
  a) Looks for any posted XML documents and if found, replaces the
contents of the form data XML.
  b) Performs XSLT transformation to XForms XHTML using the form
definitio XML and any request parameters.
  c) Puts the document into the request ("oxf.xforms.renderer.document")
for Orbeon to process.
  d) This page/url is apart of the OrbeonXFormsFilter, so Orbeons takes
over next in filter chain.
4) In Orbeon, page is rendered. After model-construct, form data XML is
loaded via URL relative to MyApp (works because of OrbeonXFormsFilter).
5) In Orbeon, user performs action to send them to another page.
Submission takes place that sends them back to same URL in Step 3).

The only tricky part here is the fact that the same form definition XML
and XSLT stylesheet are used to generate multiple form pages.  XSLT
params (taken from the request) help define what parts of the form
definition should be rendered.


------------------------------------------------------------------------
Jeremy Nix
Senior Application Developer
Cincinnati Children's Hospital Medical Center

On 06/28/2010 10:46 PM, Alessandro Vernet wrote:

> Jeremy,
>
> Using separate deployment shouldn't change much here: you can POST the
> XML from one page to the next with an<xforms:submission
> replace="all">. See the following:
> http://wiki.orbeon.com/forms/how-to/navigate-to-search-page. And if
> you really want to store XML in the session (which I would really not
> recommend, and use only as a last resort measure!), see:
> http://wiki.orbeon.com/forms/how-to/store-xml-in-the-session. Does
> this help, or did I misunderstand your question?
>
> Alex
>
> On Fri, Jun 25, 2010 at 10:54 AM, Jeremy Nix<[hidden email]>  wrote:
>    
>> Has anyone designed a site that contained multi-page XForms in a Orbeon
>> separate deployment integration?  If so, how did you resolve the issue of
>> needing to keep around the submission XML for multiple pages as the user
>> made their changes?
>>
>> I've been attempting various integration points over the past couple days
>> and keep running into issues; not with Orbeon but with the underlying
>> technologies involved.  I've tried creating a PageFlow based application and
>> housing it within the Orbeon install, but I then run into problems as my
>> main application has to figure out how to feed up the XML both for the
>> default-submission and for an XSLT transformation.  I tried using the
>> URLResouceManager, but ran into problems with the fact that a new session
>> gets created when Orbeon makes the URL request over to the main web
>> application.  I'm now trying to figure out how I can save the XML out on the
>> filesystem somewhere so that my Orbeon PageFlow can pick it up and generate
>> the XHTML form.  We will have multiple users in this system, each generating
>> XML files that is particular to their needs, so I now run into the question
>> of how do I dynamically change the default-submission URL and the URL's
>> referenced in my pipeline to support this dynamic nature?  Here's a snippet
>> of my pipeline:
>>
>> <p:processor name="oxf:xslt" xmlns:p="http://www.orbeon.com/oxf/pipeline">
>> <p:input name="request" href="#reqParams" />
>> <!-- Can this href be set dynamically? -->
>> <p:input name="data" href="/myapp/page.jsf" />
>> <p:input name="config">
>> <xsl:stylesheet version="2.0"
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>> <xsl:import href="dataentry.xsl" />  <!-- stylesheet in same dir as xpl -->
>> <xsl:param name="baseUrl"
>> select="concat(doc('input:request')/request/scheme, '://',
>> doc('input:request')/request/server-name, ':',
>> doc('input:request')/request/server-port, '/')" />
>> </xsl:stylesheet>
>> </p:input>
>> <p:output name="data" ref="data" />
>> </p:processor>
>>
>> The above example might be convoluted, but the end goal is to have our main
>> web application utilize XForms for a small portion of data entry.  This data
>> entry involves multiple pages, which seem to be supported well if utilizing
>> Orbeon as your base architecture, but not so much if you use a separate
>> deployment.
>>
>> If anyone has any ideas, comments on what you've tried, etc... I'd love to
>> hear them.
>>
>> --
>> ------------------------------------------------------------------------
>> Jeremy Nix
>> Senior Application Developer
>> Cincinnati Children's Hospital Medical Center
>>
>>
>> --
>> 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