I was discussing Notes development over the weekend with a buddy and former colleague. He developed a kiosk application off a Domino database, but ran into some trouble styling (CSS) the layout of the view to pick choices. He ended up using the Notes URL with ReadViewEntries to generate the XML, but he ran it through some other platform's XSL translation to build the XML to lay out in columns much like a newspaper. I told him to try running it through the NotesXSLTransformer class.
Here's how I would have approached it so as to keep everything inside Notes:
Start with your database and create a view of the documents you want to use. Mark all the documents with a key value. In a LotusScript Agent, make a NotesDocumentCollection from your view (using getAllDocumentsByKey) so you can use it to create a NotesDXLExporter object. Use the NotesXSLTransformer class to pull in your NotesDXLExporter, your XSL, and output it to a NotesRichTextItem in a new document.
From there its just a matter of understanding the DXL of the NotesDocumentCollection and designing an XSL to transform it into HTML. The rich-text field could be wrapped with HTML on the form and your XSL could focus on just the data from the view, allowing you to do more formatting with CSS. The document could be the first document in a view of a database set to open to the first document. You could then link to the documents using a URL that references the document UNID node in the DXL. If you wanted to incorporate AJAX into it, you could use the XSL to generate custom XML from the DXL or use the JSON parameter on a view URL to pop up a floating DIV with data retrieved using AJAX.
The agent could run on schedule depending on how frequently the data changes. Its kind of kludgey when you consider all the functionality you get from Domino out of the box, but it does address some of the limitations of notes views on the web.
All of this would hold up fairly well, that is, until ND 8.5 and X-Pages changes everything.
Tuesday, July 8, 2008
Subscribe to:
Post Comments (Atom)

2 comments:
Or... instead of having to grapple with DXL, you could instead perhaps use your view (with a single column) to hold the XML for each item, one per document. Then, in your code, build up a big string of XML by starting it off with the opening XML stuff (declarations etc.), iterating round your view entries for the guts, then appending any closing XML required. Chuck your big XML string into a NotesStream object, which can then be used as the input to the Transformer object.
This way, you are using pure XML in the transformation. I have recently used this "big string of XML" approach to XSLT on the Domino server (albeit I took my XML from a NotesRichTextItem), and it scaled well for large XML documents.
Ian,
That's a viable option too. However, I don't think DXL is so bad that you can't tame it with a little XSL...
Post a Comment