Getting or Setting Instance ID of a form - Without showing the form first

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

Getting or Setting Instance ID of a form - Without showing the form first

Ron Schultz
I have a need to create a new instance of a form, and having Orbeon return the instance ID of the form so that I can store this instance ID to later present the new form to a user for editing. Is there an HTTP GET or POST that allows me to do this - without ever rendering the form into the UI?

Also - can I set the instance ID of a new form, or should I generally relt on Orbeon to do that for my application?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Getting or Setting Instance ID of a form - Without showing the form first

Erik Bruchez
Administrator
Ron,

When Orbeon Forms creates data in the database via the persistence
API, it always provides its own id. It's basically a hex hash of a
random number.

Now by "new instance of a form", do you mean a new form definition, or
new form data for a given form definition?

Also, I am unsure of your workflow here: which piece of software
creates what? How will the different parts be connected?

-Erik

On Thu, Jun 28, 2012 at 11:51 AM, Ron Schultz <[hidden email]> wrote:

> I have a need to create a new instance of a form, and having Orbeon return
> the instance ID of the form so that I can store this instance ID to later
> present the new form to a user for editing. Is there an HTTP GET or POST
> that allows me to do this - without ever rendering the form into the UI?
>
> Also - can I set the instance ID of a new form, or should I generally relt
> on Orbeon to do that for my application?
>
> Thanks
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Getting-or-Setting-Instance-ID-of-a-form-Without-showing-the-form-first-tp4655383.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
>


--
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: Getting or Setting Instance ID of a form - Without showing the form first

Ron Schultz
Erik,

When Orbeon Forms creates data in the database via the persistence
API, it always provides its own id. It's basically a hex hash of a
random number.

 - Understood

Now by "new instance of a form", do you mean a new form definition, or
new form data for a given form definition?

 - New form data for a given form definition

Also, I am unsure of your workflow here: which piece of software
creates what? How will the different parts be connected?

- My application is calling Orbeon, requesting that Orbeon create and persist a new instance of a form, from the form definition ID my application is passing to Orbeon. I am requesting that Orbeon return to me the ID of the just-created form 'instance', which I will cache and display to the user at a later point. My workflow is an application that is accumulating a set of checklists that will need to be completed at the end of the workflow. I have alternative workflows I can develop to get around this issue - but the workflow is simplified if I can create and store a form 'instance' without necessarily rendering it into the UI.

-Ron
Reply | Threaded
Open this post in threaded view
|

Re: Re: Getting or Setting Instance ID of a form - Without showing the form first

Erik Bruchez
Administrator
> Now by "new instance of a form", do you mean a new form definition, or

> new form data for a given form definition?
>
>  - New form data for a given form definition
>
> Also, I am unsure of your workflow here: which piece of software
> creates what? How will the different parts be connected?
>
> - My application is calling Orbeon, requesting that Orbeon create and
> persist a new instance of a form, from the form definition ID my application
> is passing to Orbeon. I am requesting that Orbeon return to me the ID of the
> just-created form 'instance', which I will cache and display to the user at
> a later point. My workflow is an application that is accumulating a set of
> checklists that will need to be completed at the end of the workflow. I have
> alternative workflows I can develop to get around this issue - but the
> workflow is simplified if I can create and store a form 'instance' without
> necessarily rendering it into the UI.
You can just PUT an XML document to the persistence API and pick the
id yourself. The URLs look like this:

http://localhost:8080/orbeon/fr/service/persistence/crud/[APPLICATION_NAME]/[FORM_NAME]/data/[FORM_DATA_ID]/data.xml

or, with 3.9:

http://localhost:8080/orbeon/fr/service/exist/crud/[APPLICATION_NAME]/[FORM_NAME]/data/[FORM_DATA_ID]/data.xml

Just provide a sufficiently random id as document id. Orbeon Forms
uses this to produce random ids:

  digest(string(random(true)), 'MD5', 'hex')

-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
OW2 mailing lists service home page: http://www.ow2.org/wws