Domino Design Code Injection - Part 2
In Part 1 I introduced the approach to code injection and some sample LotusScript Code to pull a design element, transform it and push it back. Missing there was the function that actually implemented that method. I'm using a Java class to do that, which I wrap into LS2J. The LotusScript function looks like this:
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
Now let us have a quick look at the Java class.
Option Public Option Declare Uselsx "*javacon" Use "CodeInjector" Function injectCode (rawDXL As String , xPath As String , codeSnippet As String ) As String 'Dummy doesn't do anything Dim jSession As JAVASESSION Dim injectorClass As JAVACLASS Dim injector As JavaObject Set jSession = New JAVASESSION injectCode = rawDXL Set injectorClass = jSession .GetClass ( "DominoXPathInjector" ) Set injector = injectorClass . CreateObject 'Now set the document Call injector .setDocument (rawDXL ) 'and execute the function injectCode = injector .injectCode (codeSnippet , xPath , 4 ) End Function
provided by Julian Robichaux at nsftools.com.
Read more
Posted by Stephan H Wissel on 21 March 2008 | Comments (0) | categories: Show-N-Tell Thursday