Create design elements using dxl?

Hi!

This might be a tricky question to formulate, but i’ll do my best. The thing I want to achieve is this:

In my database I have a “template” design element (a form) and a document containing specific information. Using these two I would like to create a new design element in the database, that is, I want to create a new design element in the database based on the “template” form, using the information in the document.

My first idea to on how to solve this is the following:

  1. Use DXL to export the “template” form to a DXL file.

  2. Modify the DXL file based on the information in the document. This includes creating new actions in the action bar, together with some @Formulas to be used in the action.

  3. Import the dxl file to the database, creating a new design element in the database.

So far I have found that points 1 and 3 can be done rather easily. My problem is point 2, any ideas? Can it be done via “normal” text file modification of the dxl file? Or is there another (and better) way to solve this?

I don’t feel skilled enough in using dxl techniques to answer this question myself, so any input or point of direction as to where I should continue my search is welcome!

Regards

Oscar Johson

Subject: Create design elements using dxl?

Given that you are using R7 it would say this “might” be possible, however in R6 I would tell you to not bother really.

I spent a long time developing some code to Export an existing database to DXL, modify the design and then import the changes (specifically modify the database properties) - a simple concept really.

The code I have works, albeit it is quite intensive and can take anywhere up to 45-60 seconds to complete - depending on the template size. The reason it takes so log is the resulting DXL from the NotesDOMParser can contain illegal escape characters (eg &, <, >, etc). So the DXL must be parsed using the NotesSAXParser events to remove all the XML escape characters.

Hopefully, this wont be a problem in R7 - in which case your job should be a lot easier. In theory you should just need to use the NotesDOM objects to search and then modify your database - no need to use the NotesSAXParser at all - you don’t need to output you DXL to a text file, this is simply too difficult to modify anyway.

Knowledge of XML and obviously DXL and the Notes DOM will help you.

Even though I have my code working, I’ve still found problems running it still when corrupt hidden design elements are encountered - which essentially makes the code useless for old databases that have been updated time and time again by various people.

The code I have may help you though, you may find it on OpenNTF.org > http://www.openntf.org/Projects/codebin/codebin.nsf/CodeByDate/FD64305180C62B38862571CD0069EC1C

Good Luck - there’s very little information out there on how to do this and from what I can tell, I’m one of very few who have attempted it.