Hello.  I'm working on a project that will need to do something similar to this.
 I haven't quite gotten to the point where I have a solution for this, but I
posed a couple of questions to the XML developer mailing list and here's the
reply I got:

"Yes, initializing an instance from a remote location is possible (given
that that location is reachable).

The dialog that you mention has a "link" check-box. If you link the
instance, it will be retrieved every time the document is loaded. If you
leave it unchecked, the external instance will be copied into the
document and stored there. In case of a document internal instance,
changes that a user makes to the instance data via bound form controls
will be persisted with the document when it is saved.

When you bind a form control to a node in the data navigator, the
pre-filling that you mention should work. The easist way of creating
such a binding is to drag the node from the navigator onto the document..."

You can add instance data with pre-filled values by clicking the "Instances" tab
at the bottom of the data navigator, then selecting "Add".  This will allow you
to pick an XML file that's local or remote.  If you click "Link", it will update
your XForms form with the values in the XML file each time you open the form.
Otherwise, it imports a copy of the XML file into your document.  When you
reload the form after doing this, you should see the values from the XML file
loaded into your form.
As far as doing this automatically and bundling it with a form goes, there are
surely ways to do it that may involve a little macro writing.  I'll keep you
updated on my progress here, and I'd ask you to kindly do the same.  There is a
lack of documentation on this (I'm probably going to be writing some) so we need
to figure things out as we go.

More info on loading instance data:
http://compiler-error.blogspot.com/2007/07/weekly-summary.html
http://openmrs.org/wiki/Creating_Forms_in_OpenOffice#Importing_the_Template
My project blog to keep an eye on for more info:
http://compiler-error.blogspot.com

-Matthew Harrison

Quoting "Swanson, Dennis" <[EMAIL PROTECTED]>:

> We have a J2EE application where we would like to utilize the XForms
> functionality in OpenOffice to pre-populate a document when it is initially
> opened (preferably from an XML Document).  Everything I have seen thus far
> seems to only allow you to do this by connecting the database as the
> datasource.  The problem is that we don't want to get the data from the
> datasource because it skips all of our security, etc.  Is there anyway to
> open an OO document from a servlet (passing an xml document along with it
> that contains the value we want pre-populate the document with) and have it
> opened as a pre-populated document usisng XForms?  If  anyone can point me
> in the right direction, I'd appreciate it.  I haven't seen any examples
> covering this scenario.
>
>
>
> Thanks,
>
> Dennis
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to