09.20.2018

How a SmartNSF custom route can be used to create a redirector, in my case to open the corresponding Notes-document

Tags: SmartNSF Java
0

I am – to nobody’s surprise – a big fan of SmartNSF. Here the other day I had to come up with a solution to make a web-URL redirect to a Notes-URL (you know, notes://…) and thus open a document in the Notes client. Why? A modernized Notes application surface it’s data on the web, but the users still needs to be able to see the real document in the Notes client. There are several ways to do this with traditional Notes development. However, I wanted to see how I can do this with a simple java class, all controlled by a SmartNSF custom rule.

For example, the URL http://someserver.com/DocumentDatabase.nsf/xsp/.xrest/doc_v1/5921-A4 will grab the document ID “5921-A4” and lookup the document behind the scenes, and grab the NotesURL such as Notes://SomeDominoServerName/C12573EF007A4D9D/B3612539371CB37AC125830D002A4BF9/67FD0734318B98A4C12582B900208F1F. The latter URL will normally open the specified document UNID in the Notes client, at least after you have confirmed security warnings like these;

image

How is it done?

10.31.2017

Wow! SmartNSF (BETA-5) can now call java directly, and work with the parameters with ease!

Tags: Lotus Domino Java SmartNSF
0

This evening it was time to test the latest and greatest version of SmartNSF – BETA 5. When you have installed it (via an updatesite database for the server) and via a local update site in your Designer, you get some cool new features. First of all, intellisense seems to work very good so now it is much easier to get the available methods etc.

But, the really cool feature in this version is the support for CUSTOM strategies. This means that you can define a route like this (the example below is directly from the discussion.nsf sample database enclosed in the SmartNSF zip);

SNAGHTML2c2833ab

The URI infos will call the Info-class in the package org.opennrf.smartnsf. This means that an URL like  http://www.vcode.no/test/discussion.nsf/xsp/.xrest/infos (note; URL is shown just for illustration purposes, and is not active) will call the java code shown below;

image

(Click on image to enlarge)

10.16.2017

Bark-bark!! The LotusScript CWebContentConsumer now support REST Service POSTs with files++

Tags: LotusScript Java
0

A couple of days ago I wrote the blog-post Teach the old dog some new tricks: Let LotusScript consume REST Services the easy way. I thank you all for the good feedback! Nice to see that some old school, classic Notes development, still got some traction Smile

Well, I was in the spirit to add some features today too!

First and foremost you now have the ability to add a payload to the PostJson, PostXML and PostHTML. By payload I mean a text string of any kind, but typically a JSON or XML. In a way you can think of it as a way of uploading a file or text together with other request headers or URL parameters.

This means that code like this;

image

… results in this;

image

Note that the payload isn't tagged a a proper multipart MIME or anything, but perhaps you can add that yourself with a combination of the new support methods for base64 encoding and decoding? You now have these additional methods;

  • EncodeStringAsBase64. Encode a string as base64. Build your own multipart XML or MIME structure, and combine that with one or more AddRequestHeaders? Or stuff the base64-encoded string as a payload directly with SetPayload.
  • EncodeFileAsBase64. Encode a whole file as base64. Remember that this hasn't been tested on huge files or anything Smile
  • DecodeBase64String. Decode a base64-encoded string back to it's textual form.
  • DecodeBase64StringToFile. Finally decode a base64-encoded string directly into a file on your disk.

I also added DownloadFileFromURL which can download any file from the specified URL and store it on disk as a file.

The demo-agents in the downloadable sample-database has been updated to use SetPayload, and the other methods are now demoed in a third agent with the name "Test Support Methods".

Happy coding!

10.13.2017

Teach the old dog some new tricks: Let LotusScript consume REST Services the easy way

Tags: LotusScript Java
0

This article shows you how to consume REST Services in LotusScript like this:

SNAGHTML110bfb33

You can both GET and POST with the classes.

Behind the scenes this is accomplished with two script libraries. One back-end worker class made with Java (class:CWebContentConsumerJava) which does all the heavy lifting, and a LotusScript wrapper class (class:CWebContentConsumer) which uses the LotusScript-to-Java bridge LS2J to interface the back-end java directly.

Click on “Read more” to read the details.

01.19.2016

Classic Notes: How to write a "reveal java home" java agent in Domino

Tags: Lotus Notes Java
0

Just to get you going and reveal the whereabouts of the Domino JVM on your computer. Can for example be used when you try to fix any PKIX path building failed - related problems Smile 

Read much more about that error in the post Classic Notes: How to import self signed certificates into your Domino Java environment.

01.19.2016

Classic Notes: How to import self signed certificates into your Domino Java environment

Tags: Lotus Notes Java
0

If you get errors like “PKIX path building failed”... such as ...

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

... you may have a problem with self-signed certificates in your Java environment. Read more about how to fix this in this article!

I show you how to export certificates with Chrome, and how to add this to your so-called keystore in your Java environment. In the end you will have both your Eclipse and Domino environment accept the self-signed certificate.

UPDATE Jan 19th, 2016 15:31 CET:  René Winkelmeyer informed me about his blog where he has already described a much more elegant appoach for Domino - which also survives an update! ... Head over to his blog and check it out. Thanks a lot René for the pointer! René's blog points you further to Simon O'Doherty’s answer on Serverfault (Hi Simon, long time since the “chineese API syndrome” Smile).

11.21.2013

Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J - Part 3

Tags: LotusScript Java Connections
0

This part 3 of 3 in the article series “Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J”.

Read the others here:

Part 1

Part 2

11.21.2013

Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J - Part 2

Tags: LotusScript Java Connections
0

This part 2 of 3 in the article series “Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J”.

Read the others here:

Part 1

Part 3

11.21.2013

Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J - Part 1

Tags: LotusScript Java Connections
0

This part 1 of 3 in the article series “Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J”.

Read the others here:

Part 2

Part 3

… embark! …

You have seen the cool IBM Social Business Toolkit (IBM SBT), and you played around with the ??bercool Playground application. You dive into the code and quickly discover that you need some Java or JavaScript knowledge.

- Ooops, but I am mostly doing LotusScript, you say … what now?

Perhaps you ask a question on StackOverflow to see if anybody has some advice for your scenario (just completely out of the sky – perhaps something similar to this question Smilefjes). The chances are that you’d get a lot of advice abandoning your old and tired LotusScript  in favor for the much more modern Java language. Your challenge is that you have a lot of LotusScript code that you would love to enhance with the new cool IBM SBT possibilities, and perhaps not the time to take the heavy plunge into learning a new language.

This article – which assumes a whole bunch of details are in place – will show you how to have this small piece of LotusScript code …

SNAGHTMLcc5370

… put an entry into an Activity Stream in a specified community like this;

SNAGHTML61694e

02.16.2013

Test

Tags: Web Services Java LotusScript
0
Test

Tags

Calendar