IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

CAE palette report screenshotAt Lotusphere I demoed an application to read XML files and report a summary of their contents; the files in question are the "palette" files created by the Notes 8 Composite Application Editor tool. Like many XML files, this one has its quirks -- some attribute values in it are double-encoded, so that e.g. "<" is represented in the XML as "&amp;lt;" rather than the usual "&lt;". Apart from that, though, this is a pretty straightforward sample of using object-oriented LotusScript code to manage multiple XML files to pull data out of them, extract and store XML snippets, and plug them back in and save. The application I envision for this is that you could store the XML for one or more components (in a field in a Notes database, for instance), and write code to automatically check whether the user already had that component, and if not, insert it.

The interesting code is in the script library "Class CAEPalette", which is called from the (Display My Palette) agent. As the name suggests, the agent isn't making any modifications to the palette -- just pulling information from it -- but the methods to extract and insert chunks of XML are in the library. In particular, you might look at the CopyTree function, and the InsertXML function which calls it; these are generally useful in cases where you're combining XML from multiple sources. If they aren't all children of the same DOMDocument, you can't simply call AppendChild or Clone.

Here's the application: CA Palette Sample.zip

A reminder: before version 7.0.3 / 8.0.1, the LotusScript DOM parser didn't correctly handle apostrophes in attribute values when serializing. This may have some effect on this code, depending on the data in your palette files.

Andre Guirard | 19 February 2008 03:03:00 AM ET | Home, Plymouth, MN, USA | Comments (1)


 Comments

1) Path not found..
Alain | 12/26/2008 1:23:26 PM

.. in CAEPalette class constructor

 Add a Comment
Subject:
   
Name:
Comment:  (No HTML - Links will be converted if prefixed http://)
 
Remember Me?     Cancel

Search this blog 

Disclaimer 

    About IBM Privacy Contact