Google IT Mail IT PermaLinkHow To Extend Domino Authentication For Websites, Single Sign-On and Persistent Sessions03:41:10
Written By : Stephan H. WisselCategory : Java
Location : Singapore
There is an excellent article over at Agileview, the blog of Agileware. If you are not into Websphere or DSAPI, you now have an option. A must read!
(0)

Google IT Mail IT PermaLinkImporting MS Excel into Lotus Notes via XML -- the code17:58:36
Written By : Stephan H. WisselCategory : XML
Location : Singapore

In August we published a XSLT stylesheet, that can transfom Excel XML into a more record like XML structure. The missing part is the Notes side of the exercise, which I will show today. There is a functional database in the download section. The agent code reads some values from a configuration document and applies the listed transformations to the xml before invoking the sax parser to read the values. We opted for multipe transformation runs to be able to massage the data after it has been transformed from the rather crude Excel XML form.

But you are not limited to Excel. Any XML you can transform into the <record><field>... format can be imported.


Let's look at the core of the agent code:


       'make sure all conversion files are detached

       Call DetachTransformationFiles(tempDir,doc,transformationNames)


       'Pipelined call to XSLT Transformation an SAX Parser

       Call TransformFileToSax(transformationNames,fileNames(0),doc, xsltParameters)        


After detaching the XSLT files to the system temp directory we run a cascaded transform:


Function TransformFileToSax(transformationNames As Variant,fileName As String, doc As NotesDocument, Parameters List As String) As Boolean

       'Transformes the input file in a series of transformation, one each for each name in transformationNames

       'Then hands over the stream to the Sax parser for further processing

       Dim s As New NotesSession

       Dim i As Integer

       Dim sourceStream As NotesStream        

       Dim tempDir As String        

       Dim transformers() As NotesXSLTransformer

       Dim styleStreams() As NotesStream

       Dim loopcount As Integer

       Dim saxParser As NotesSAXParser

       
       On Error Goto Err_TransformFileToSax

       
       'Create the Import Definition

       Set obj_ImportDefinition = New clsImportDefinition(doc) '
<-- this is where the magic is
       
       'Create the Sax parser

       Set saxParser = s.CreateSAXParser()

       On Event SAX_Characters From saxParser Call SAXCharacters

       On Event SAX_EndElement From saxParser Call SAXEndElement

       On Event SAX_StartElement From saxParser Call SAXStartElement

       On Event SAX_EndDocument From saxParser Call SAXEndDocument

       
       
       If Isempty(transformationNames) Then

               'No transformation has to be done, just load a stream and hand it to the sax parser

               Set sourceStream = s.CreateStream

               Call sourceStream.Open(fileName)

               Call saxParser.SetInput(sourceStream)

               Call saxParser.Process

               Goto Exit_TransformFileToSax

       End If

       
       'We need to feed the result of the first transformation to the second, second to third etc.

       'We will use an array of transformers and use the pipelineing capabilities of NotesXSLT to chain them

       
       
       tempDir = Environ("Temp")+"\"

       loopcount = Ubound(transformationNames) 'How many loops do we have

       Redim transformers(loopcount) 'We initialize the exact number of transformers...

       Redim styleStreams(loopcount) 'Also the exact numbers of styles

       
       Set sourceStream = s.CreateStream 'the source file

       Call sourceStream.Open(fileName,"Unicode") 'Open the source

       
       
'Now the chaining loop <-- this is the interesting part, we chain the Notes Streams from file i/o until SAX Parser,
       For i = 0 To loopcount Step 1

               'Create the transformer

               Set transformers(i) = s.CreateXSLTransformer

               'Feed in the parameters

               Forall p In Parameters

                       Call transformers(i).AddParameter(Listtag(p), p)

               End Forall

               
               'Create the style sheet and link it

               Set styleStreams(i) = s.CreateStream

               Call styleStreams(i).Open(tempDir+transformationNames(i),"Unicode")

               Call transformers(i).SetStylesheet(styleStreams(i))

               
               'Link the input

               If i = 0 Then

                       Call transformers(i).SetInput(sourceStream)

               Else

                       Call transformers(i).SetInput(transformers(i-1))

               End If

       Next

       
       'Link the final output --- all other outputs are linked via input of the next one

       Call transformers(loopcount).SetOutput(saxParser)

       
       
       'Process

       Call transformers(0).Process '
Just start the first one, pipelining will take care of the others
       
       'Wind down

       Call SourceStream.Close

       For i = 0 To loopcount

               Call styleStreams(i).close

       Next

       
       TransformFileToSax = True 'If we got here it worked

       
Exit_TransformFileToSax:

       Exit Function

       
Err_TransformFileToSax:

       Print Error$ + " in TransformFileToSax"

       TransformFileToSax = False

       Resume exit_TransformFileToSax

       
End Function


The Sax stuff is quite simple...

Read More . . .
(2)

PermaLinkTransforming DXL to a record/field structure.
Written By : Stephan H. WisselCategory : XML
Location : Singapore

Gary is updating his samples to Domino 6.x. One challenge he encountered is how to transform DXL to something that looks more like a record. In LotusScript you chain a NotesDXLExporter with a NotesXSLTransformer and apply a stylesheet. Here it gets a little tricky. Since Notes knows multi-values you are never too sure what you will get. Also there is MIME and RichText. Excluding these two, the following stylesheet does the trick (might be incomplete):

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"

   xmlns:d="http://www.lotus.com/dxl">

   <xsl:template match="/">

       <records>

           <xsl:apply-templates select="//d:document"/>

       </records>

   </xsl:template>

   <xsl:template match="d:document">

       <xsl:element name="record">

           <xsl:attribute name="form">

               <xsl:value-of select="@form"/>

           </xsl:attribute>

           <xsl:attribute name="unid">

               <xsl:value-of select="d:noteinfo/@unid"/>

           </xsl:attribute>

           <xsl:apply-templates select="d:item"/>

       </xsl:element>

   </xsl:template>

   <xsl:template match="d:item">

       <xsl:element name="field">

           <xsl:attribute name="name">

               <xsl:value-of select="@name"/>

           </xsl:attribute>

           <!-- here comes the tricky part - get the field type and the values -->

           <xsl:attribute name="type">

               <xsl:value-of select="name(child::*[1])" />

           </xsl:attribute>

           <xsl:apply-templates />

       </xsl:element>

   </xsl:template>

   <!-- Process the various data types -->

   <xsl:template match="d:textlist">

       <xsl:apply-templates select="d:text"/>

   </xsl:template>

   <xsl:template match="d:text[position()=1]"><xsl:value-of select="."/></xsl:template>

   <!-- We use ; separators for multivalues -->

   <xsl:template match="d:text[position()!=1]">; <xsl:value-of select="."/></xsl:template>

   <xsl:template match="d:datetimelist">

       <xsl:apply-templates select=".//d:datetime"/>

   </xsl:template>

   <xsl:template match="d:datetime[position()=1]"><xsl:value-of select="."/></xsl:template>

   <!-- We use ; separators for multivalues -->

   <xsl:template match="d:datetime[position()!=1]">; <xsl:value-of select="."/></xsl:template>

   <xsl:template match="d:numberlist">

       <xsl:apply-templates select="d:number"/>

   </xsl:template>

   <xsl:template match="d:number[position()=1]"><xsl:value-of select="."/></xsl:template>

   <!-- We use ; separators for multivalues -->

   <xsl:template match="d:number[position()!=1]">; <xsl:value-of select="."/></xsl:template>

   <!-- exclude rawitemdata for now, we are only interested in native fields -->

   <xsl:template match="d:item[d:rawitemdata]" />

</xsl:stylesheet>


(Get it in the download section)

(1)

PermaLinkImporting MS Excel into Lotus Notes via XML16:43:01
Written By : Stephan H. WisselCategory : XML
Location : Singapore
A very typical task in any Notes environment is to import MS-Excel into Lotus Notes. While the client sports import filters (with an eventual round trip through the venerable 1-2-3 format, the server doesn't allow an import. OLE is rarely an option since (rightfully) any administrator rather runs naked into the CEO's office than to allow desktop applications (read MS Office) to be installed on the server.
Since Office 2000 there is a new possibility: One could save an MS-Excel file as XML Spreadsheet and use XML processing to extract the data. However the rather harmless looking table:

A picture named M2
turns into quite a LOT of XML. Before even thinking of processing it we need to clean-up the code.

Read More . . .
(8)

PermaLinkDomino as XML Documents09:37:27
Written By : Stephan H. WisselCategory : XML
Location : Singapore
Richard and Brian had their take on Domino documents as XML. In my comment to Brian's post I suggested to use webDAV to achieve that today. Using webDAV Domino databases and folders could be displayed as folders (not so sure about views) and Domino documents as XML documents. webDAV comes with support for access control, so Domino's security (readers/authors/acl) would be in force. You could even use filters (a.k.a. XSLT transformations), so the XML could be domain specific rather than raw XML.
A prove of concept servlet doesn't seem too much magic. What would one do with such a capability?
(4)

PermaLinkLegacy code?09:14:13
Written By : Stephan H. WisselCategory : Concepts
Location : Singapore
"Before we get started, do you know what 'Legacy Code' means? It's code that works".
Via Ben
(2)

PermaLinkGetting a Gannt chart out of Domino11:34:41
Written By : Stephan H. WisselCategory : Java
Location : Singapore

Alan Bell of Dominux Consulting describes how to use jfree.org's Java libraries to produce a Gannt chart in Domino.
(0)

PermaLinkDetailed documentation how to connect Tomcat 5.5 to Domino14:38:48
Written By : Stephan H. WisselCategory : Java
Location : Singapore
Dan Simmonds just published a detailed documentation about his experience with connecting Tomcat 5.5 and Domino 6.5.1. A must read.
(0)

Site purpose and disclaimer
You consider to extend or replace your Domino infrastructure. You found a lot of information about messaging migration. You didn't find much about the applications, other than tool vendors advertisements. You realized that Domino migration is an emotional mine field. Bookmark this site, we will provide information and discuss the move from Domino to J2EE and other environments (both retaining and replacing Domino). We focus on applications, not on messaging.

The articles on this site mention products and phrases, that might be subject to copyright or trademarks. So we acknowledge, that the copyrights belong to the owner of the respective copyright or trademark.The links on this page are provided for convenience and are constitute no endorsement of the content of the target site.

So once your ready to discuss if and/or how to move away from Domino contact us.
Search
Site Contributors
Related Links
Resources
Some of the articles come with sample code or documents. You can get them in the Downloads section. Please check for the copyright accompanying the files.
Unless mentioned otherwise copyright of all of this site content is subject to a creative commons licence.
By Category
Lotus Domino ND7 RSS News Feed RSS Validator OpenNTF BlogSphere
Monthly Archive
Ads by Google