It’s been quiet in LotusScript.doc land but…

…I have been hard at work and I’m getting close to a pre-release of LotusScript.doc v.2.

LotusScript.doc v. 2 is being completely rewritten from scratch (in Java), supports multi-threading and handles a wide array of new design elements compared to the 1.0.x code stream. The code and comment parsing is done and I’m currently working some of the more esoteric parsing bugs out.

One of the design goals for version 2 is also adding support for other output formats than the “traditional” framed HTML view. Writing custom output formats will also be possible using a template engine. I’m planning to ship the following documentation formats:

  • XML
  • Traditional framed HTML
  • A more comprehensive HTML report
  • PDF
  • DocBook

The main XML format is almost done and it’s what I wanted to show of today and is what I’m showing above. Click the image (or here) for a larger version. The larger XML snippet shows:

  • Ability to see which subforms are used from which forms
  • Ability to see which embedded views are used from which forms/pages and what their singlecategory formula is (if any)
  • Support for buttons (anonymous and named)
  • Support for actions (in action bar and as shared actions)
  • Ability to see which shared actions are used from which action bars
  • Support for subforms

The list of new features is quite a lot longer including vast performance improvements but lets not get carried away. Of cause the XML format will also carry the code comments.

Exporting DXL for databases with Java web services

Today I needed to export a database application containing a web service written in Java as DXL. How stupid of me to think that I could do this with only Notes.jar on my build path… Doing such an export will make your code throw java.lang.ClassNotFoundExceptions unless you have the following libraries on your build path:

  • jvm/lib/ext/notes.jar (not much surprise there)
  • jvm/lib/ext/websvc.jar (due to missing lotus.domino.websvc.client.Service)
  • jvm/lib/ext/mail.jar (due to missing java.mail.Multipart from lotus.domino.ws.ServiceContext)
  • jvm/lib/ext/jsdk.jar (due to missing javax.servlet.http.HttpServlet)
  • jvm/lib/xml.jar (due to missing org.apache.xerces.parsers.SAXParser)

The above was found by diagnosing and reading ClassNotFoundExceptions in Eclipse at runtime since ClassNotFoundException is a runtime exception.

Now back to exporting…

Effective API Design presentation by Joshua Bloch

Although from JavaPolis 2005 this is still a very nice presentation by one of the gurus in the field of API design, Joshua Bloch. The presentation runs about 70 minutes but is well worth it.

Summary: “A well-written API can be a great asset to the organization that wrote it and to all that use it. Given the importance of good API design, surprisingly little has been written on the subject. In this talk (recorded at Javapolis), Java library designer Joshua Bloch teaches how to design good APIs, with many examples of what good and bad APIs look like.”

Effective API Design

Discovering Notes 8: Web service enabled script libraries


In a recent edition of the LotusUsergroup.org newsletter Julian listed some of the new AppDev features of Notes 8. Among them were the new web service enabled script libraries.

Basically what you do is simply pointing a script library to a WSDL file and some stub code is automatically generated for you. Then when you use the script library from agents etc. the methods you call will automatically be forwarded to the actual web service without you worrying about SOAP, HTTP etc. It actually is that easy!

To test it out I found an example of a public stock quote web service (http://www.webservicex.net/stockquote.asmx?WSDL) and used that for an example.

Start by creating a new empty LotusScript script library. Now click the “WSDL…” button at the bottom of Domino Designer and simply select “Import WSDL”. Now paste the above URL into the filename field and click Open (it’s really nice that you can actually simply paste the WSDL URL into the dialog instead of first saving the WSDL to a local file). Now your script library should look like this:

%INCLUDE "lsxsd.lss"
Const n4 = "http://www.webserviceX.NET/"
Class StockQuoteSoap_n4 As PortTypeBase

  Sub NEW
    Call Service.Initialize ("HttpWwwWebserviceXNETStockQuote", _
    "StockQuote.StockQuoteSoap", _
    "http://www.webservicex.net/stockquote.asmx", _
    "StockQuoteSoap_n4")

  End Sub

  Function GetQuote(symbol As XSD_STRING) As XSD_STRING
    Set GetQuote = Service.Invoke("GetQuote", symbol)
  End Function

End Class

Now save the script library and call it “Stock quote”.

Create a LotusScript agent and in Options import the script library (Use “Stock quote”). Now we want to call the script library which is done using code like this:

Sub Initialize
  Dim ws As New NotesUIWorkspace
  Dim sq As New StockQuoteSoap_n4()
  Dim symbol As String
  Dim symbols(2) As String
  symbols(0) = "IBM"
  symbols(1) = "JAVA"
  symbols(2) = "AAPL"
  symbol = ws.Prompt(4, "Stock symbol", _
    "Select stock for quote...", "", symbols)
  If symbol = "" Then
    Exit Sub
  Else
    Print "Using symbol: " + symbol
  End If

  Dim sh As New XSD_STRING()
  Call sh.setValueFromString(symbol)
  Set sh = sq.GetQuote(sh)
  Msgbox sh.getValueAsString()
End Sub

Now when you run the agent and you select a stock symbol it will actually automatically go out to the web service, get the quote and return it to the caller. All this with the code I just showed you. Nice!

Stand by for a post on the nitty, gritty details…

Eclipse PHP tooling

The Eclipse Foundation releases PHP tooling.

Quote: “Eclipse has long been enriched by the wide number of programming languages supported” says Mike Milinkovich, general director of the Eclipse organization. “The release of PDT 1.0 is great news as it will allow the estimated 4.5 million PHP developers to begin using Eclipse-based tools and greatly expand the entire Eclipse community.”

Discovering Notes 8: More spill-over from Eclipse


What’s going on? Well that’s the question… Did you notice the animated gif in the lower-right corner of your Notes 8 client that looks like this:

It is the new progress tab and by clicking on the orange ball you can get the progress bar to display in full screen mode like shown below. The cool thing is that you can see all the different operations that may be occurring at any one time. In this example below I’m only replicating but you can see that I just finished copying a database as well. In previous releases you only had the one progress bar at the bottom which meant that you couldn’t see simultaneous operations.

If you click “Show” in the upper right corner of the tab, select Preference there’s even more fun to be had… 🙂