Accessing the form's metadata and being able to add custom metadata
Posted by ktangirala on Jan 17, 2011; 11:29am
URL: https://discuss.orbeon.com/Accessing-the-form-s-metadata-and-being-able-to-add-custom-metadata-tp3221052.html
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