this is in fact the way the forms are created with the formwizard. Here the textdocument that served as a base for the database form is killed after the document definition is copied to the database document.
Best regards
Berend
Frank Schönheit wrote:
Hi Bo,
I'm cc'ing Berend Cornelius, since he's the author of the FormWizard. I myself can hardly answer detailed question about the wizard code ...
Also, I'm cc'ing dev@dba.openoffice.org, since the question is of more general nature, so others may have some things to add or some things to learn ... hope you do not mind.
For reasons of introducing the topic to other readers (Bo is trying to programmatically create form documents in a Java program, and examined the FormWizard source for this purpose), I allow myself to full-quote your mail below.
As said, I cannot debate with you based on concrete method names of the form wizard, but from I know about how the form wizard works:
I think it first stores a text document in a temporary location, and creates the form/controls in this document. Until here, this text document does not yet know that it's going to be part of a DB document.
Then, the wizard creates a so-called document definition in a DB document, initializing it with the name (stream?) of the temporary file. The document definition then copies the temporary file into the DB storage.
From then on, you do not need to care for the temporary document anymore. All you should need to do is to XStorable::store the DB document itself, it should automatically care for its embedded form.
If this helps you less than I hope :), and if others cannot bring more light into it, I will have a look into the wizard code to have a base for discussion.
Ciao Frank
I have been checking the code for few days, there is a question confused me, hope you do not mind that I have to ask you.
I created a simple program to insert a form into a database file. 1. create a FormDocument (I changed constructor to accept null WizardDialog) 2. connect it with the datasource(file name) 3. set table name,fieldnames,fieldColumns of FormMetaData 4. add StyleApplier(I also changed StyleApplier class, to make it accept a FormDocument as a parameter of the constructor) 5. call FormDocument.initialize to initialize a form 6. call FormDocument.finalizeForms to finialize 7. then, I think I need to save the form, so call FormDBMetaData.storeDatabaseDocumentToTempPath. I know that this method only save the document to temp path, then 8. I think maybe I should add the forms, so call FormDBMetaData.addFormDocument
then, I confused by the situation,since form is part of the database document, should I save it separately? if I should, how can I do it? what is the XHierarchicalNameAccess related to this? after create the forms, should I save the database document again? if I should, should I use XStorable again, like the way to save the datasource?
I know I am just getting there ;), maybe it is not:|. again, hope you do not mind, since I am new to openoffice programming.
thanks a lot.
Bo.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]