Hi,
I would like to know how to access the metadata of the form such as app name, form name, title etc. If I see the XHTML source in the Form Builder (using Edit Source link), it looks like this: <xforms:instance id="fr-form-metadata" xxforms:readonly="true"> <metadata> <application-name>testapp</application-name> <form-name>testform</form-name> <title xml:lang="en">Application for Citizenship</title> <description xml:lang="en"/> <author/> <logo mediatype="" filename="" size=""/> </metadata> </xforms:instance> I would like to access this metadata programmatically in a Java serverside file (say, in my REST API persistence layer). Optionally, I would also like to know how to add new metadata while designing this form. For example, in my case, I want to store the department name this form belongs to. Can I simply add the tag <department>My Department</department> to the XHTML source? Is there any automatic way of doing this since I will have to do this on hundreds of forms. Any help would be appreciated. Cheers, K |
Out of curiosity I searched the forum and found these two threads .. there might be other ways ..
http://orbeon-forms-ops-users.24843.n4.nabble.com/Integrating-custom-jsps-with-Orbeon-Form-Runner-td3010153.html http://orbeon-forms-ops-users.24843.n4.nabble.com/including-the-form-name-in-the-submitted-XML-workflow-send-td2327974.html#a2538958 From the second thread above it seems that there is some project in the orbeon team's work in progress .. http://wiki.orbeon.com/forms/projects/form-runner-builder/form-runner-data-envelope
|
Administrator
|
In reply to this post by ktangirala
This information is in the form definition, as you noticed.
Now if you want to access this from your persistence layer upon e.g. a save, you could: * load the form definition (easy if it's handled by your persistence layer as well)
* parse the resulting XML * search for the <metadata> element and its sub-elements in the form definition The Form Runner summary page actually does something similar: in order to learn about which form fields to show, etc. it also loads the form definition.
That metadata section was initially designed for Form Builder/Runner use only. We have recently started thinking about adding support for an envelope: That would be more appropriate for what you are looking to do, but unfortunately it's not yet implemented. This said, if you add your <department> element, Form Builder/Runner won't complain.
-Erik On Mon, Jan 17, 2011 at 3:29 AM, ktangirala <[hidden email]> wrote:
-- 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, DL and Erik for your replies. Understood the solution to my problem.
K |
Free forum by Nabble | Edit this page |