Reputation: 95
I am trying to programmatically generate lotusscript (in a form of a scriptable button) from a web application (Java EE) and send it to an end-user who will then run it in his/her Lotus Notes client.
How can I achieve this? Is there an API for me to use in order to embed lotusscript in an email?
Upvotes: 3
Views: 2208
Reputation: 1022
Another option is to embed a URL to open a Page design element with your code (or a call to the agent) in the QueryOpen, so it runs when the page opens.
Notes://myserver.mycompany.com/utilities.nsf/MyTaskLauncher?OpenPage
I'm not sure if it could pass parameter values or if you have to rely on the user's credentials to determine the proper information.
Advantages:
Upvotes: 1
Reputation: 2932
Here is an idea. I haven't tried it and am not certain that it will work:
Document.send()
. When connected to Domino server with CORBA/IIOP, I think this should work.Update
You might be able to skip the DXL part and just modify the LotusScript in the document item. I understood that you have to modify the LotusScript for each recipient. If not then everything is much easier (see Richards answer).
Upvotes: 3
Reputation: 14628
Rather than trying to embed a button, I would consider taking advantage of the 'stored form in document' feature of Notes.
I.e., using Domino Designer I would manually create a database (I'll call it "MyDb.nsf" for convenience). Create a form in this database ("MyForm" for convenience) and set it up with the required fields for an email message (SendTo, Subject, Body, etc.). Then create a button on the form and enter the LotusScript code.
With this done in advance, your code can take advantage of the optional attachForm
parameter in the Document.send() method.
What you would do is open MyDb.nsf in the usual way, then use Database.createDocument()
to create your document in that database, then use Document.ReplaceItemValue("Form","MyForm")
to bind this document to your form. Also set the other Items (e.g., Subject, SendTo, Body) as needed, and when you're all done call Document.send(true)
. This will embed your form in the document and send it, so the LotusScript code will travel in the embedded form that is sent with the message.
I think this might be the best method for you, because I think that this will preserve the signature on the form when it embeds it. I'm not sure about that, but on the other hand I'm much more certain that any other way of sending with CORBA/IIOP will give you an unsigned script (because CORBA/IIOP has no access to the private key needed to sign the document). And an unsigned script will mean that your users get ECL warnings when they execute it -- and that could result in them adding an entry to their ECL to permit unsigned scripts, and that's a bad security practice.
Upvotes: 3