I’m trying to port some Lotusscript agents to Java and I have a problem. I managed to get this one technique to work in a LS agent but it seems to depend on OLE/COM/IE/Bill Gates or whatever you may call it. How to do this from Java?
I am using MIME to build HTML-ish reports in emails, and it’s nice to apply CSS to them from stylesheets stored in the NSF. This works nicely if the server is running HTTP. I think I got the tip from a Rich Schwartz article as well as another ADVISOR article a few years back. The snip below is taken out of context but it’s working - I just want to know if anything like this is possible with Java.
There is certainly no such thing as a “createObject” function in Java that lets you instantiate an MSXML XMLHTTP object as far as I can tell - or is there? Is there some other way to use this CSS resource to build the MIME body from a Java agent?
-------- LS code snip --------
Const StyleFile = |belgianstyle.css|
Sub WriteHtmlHeadCSS( dtb As NotesDatabase)
Dim body As NotesMIMEEntity
Dim stream As NotesStream
Dim http As Variant
Dim temp As Variant
Dim xml As String
Dim xmlString As String
Dim i As Double
Dim statusNum As Double
Dim statusText As String
Call strm.WriteText (|<html><head><title>Sample HTML email via MIME</title>|)
' --- instantiate an MSXML XMLHTTP object to get the the css page
Set Http = CreateObject("WinHTTP.WinHTTPRequest.5.1")
temp = http.Open("GET", Strleft(dtb.Httpurl , "?") + "/" + StyleFile, False)
Call http.Send()
statusNum = http.status
statusText = http.statusText
xml = http.responseText
xmlString = Cstr(xml)
Call strm.WriteText(xmlString )
Call strm.WriteText (|</head>|)
End Sub