EntwicklerCamp 2016: AngularJs

14. April 2016 Posted by Bernd Hort

EntwicklerCamp

Bei meinem zweiten Vortrag auf dem EntwicklerCamp habe ich das Thema AngularJS beleuchtet.

AngularJS-large.png

Das JavaScript-Framework erleichtert die Entwicklung von Anwendungen die primär im Browser ablaufen. Zum Austausch der Daten wird REST verwendet. Insofern war dieser Vortrag die ideale Ergänzung zum Vortrag REST Services in Domino.

Wie immer können die Folien und die Beispiel-Anwendung heruntergeladen werden.

 


EntwicklerCamp 2016: AngularJs

14. April 2016 Posted by Bernd Hort

EntwicklerCamp

Bei meinem zweiten Vortrag auf dem EntwicklerCamp habe ich das Thema AngularJS beleuchtet.

AngularJS-large.png

Das JavaScript-Framework erleichtert die Entwicklung von Anwendungen die primär im Browser ablaufen. Zum Austausch der Daten wird REST verwendet. Insofern war dieser Vortrag die ideale Ergänzung zum Vortrag REST Services in Domino.

Wie immer können die Folien und die Beispiel-Anwendung heruntergeladen werden.

 


EntwicklerCamp 2016: REST Services in Domino

14. April 2016 Posted by Bernd Hort

EntwicklerCamp

Nachdem Thomas Bahn gestern schon mit guten Beispiel voran gegegangen ist und seine Folien vom EntwicklerCamp veröffentlicht hat, will ich dies auch tun.

Anfangen möchte ich mit meinem Vortrag zum Thema "REST Services in Domino". In 90 Minuten habe ich ausführlich beschrieben, wie RESTful Webservices in Domino zur Verfügung gestellt werden können.

Wie immer können die Folien und die Beispiel-Anwendung heruntergeladen werden. Basis für diesen Vortrag war mein Vortrag auf der IBM Connect 2016: REST Services in Domino - Key to modern Web Applications. Insofern ist die Beispiel-Anwendung die gleiche wie beim IBM Connect-Vortrag.

 

Beim Öffnen der Beispiel-Anwendung werden alle in der Anwendung implementierten REST Services noch einmal vorgestellt.


EntwicklerCamp 2016: REST Services in Domino

14. April 2016 Posted by Bernd Hort

EntwicklerCamp

Nachdem Thomas Bahn gestern schon mit guten Beispiel voran gegegangen ist und seine Folien vom EntwicklerCamps veröffentlicht hat, will ich dies auch tun.

Anfangen möchte ich mit meinem Vortrag zum Thema "REST Services in Domino". In 90 Minuten habe ich ausführlich beschrieben, wie RESTful Webservices in Domino zur Verfügung gestellt werden können.

Wie immer können die Folien und die Beispiel-Anwendung heruntergeladen werden. Basis für diesen Vortrag war mein Vortrag auf der IBM Connect 2016: REST Services in Domino - Key to modern Web Applications. Insofern ist die Beispiel-Anwendung die gleiche wie beim IBM Connect-Vortrag.

 

Beim Öffnen der Beispiel-Anwendung werden alle in der Anwendung implementierten REST Services noch einmal vorgestellt.


Verwendung eines zentralen Repositories

11. März 2016 Posted by Bernd Hort

Letztens wurde ich gefragt, wie man ein zentrales Repository unter Lotus Notes verwenden kann. Lassen Sie es mich am Beispiel unseres assono Framework erklären.

Unser Framework besteht aus einer Vielzahl von Design-Elementen. Neben Masken, Ansichten, Agenten, Grafiken und Ähnlichem gibt es eine ganze Menge von LotusScript Bibliotheken. Diese werden alle in einer Notes Datenbank "assRepostory 2" verwaltet.

Mit Hilfe des Schablonen-Mechanismus werden jeglichen Änderungen und Erweiterungen in die Anwendungs-Schablonen, wie z.B. für unseren assono Password-Safe Pro, übertragen. Von dort werden sie in die produktive Anwendung übertragen.

Inheritance from a central repository

Lassen Sie mich Ihnen die Details näher bringen.


In unserer zentralen Repository-Datenbank "assRepository 2" ist die Option "Database file is a master template" aktiviert. Der Schablonen-Name darunter ist die wichtigste Information.

Über diesen Namen werden die Abhängigkeiten aufgelöst. Sie sollten also sicherstellen, dass der Name eindeutig ist.

Zentrales Repository - assRepository

Für jede Anwendung, die wir entwickeln, gibt es eine zugehörige Anwendungs-Schablone. In dieser Anwendungs-Schablone müssen zwei Optionen aktiviert sein. Da es sich um eine Schablone handlelt, muss selbstverständlich die Option "Database file is a master template" aktiviert sein.

Darüber hinaus haben wir auch die Option "Inherit design from master template" aktiviert. Underhalb dieser Option steht der Schablonen-Name unseres zentralen Repository "assRepository-2". Wenn der Design-Task nachts um 01:00 Uhr läuft, wird überprüft, ob es im Repository Aktualisierungen gab. Er überprüft auch, ob in der Anwendungs-Schablone Design-Elemente fehlen, die im Repository vorhanden sind.

Jedes Mal, wenn wir ein neues Feature entwickelt haben und alle Tests erfolgreich durchlaufen wurden, packen wir anschließend alle zugehörigen Design-Elemente in dieses Repository. Der Design-Task kümmert sich um die Verteilung in die Anwendungs-Schablonen.

Lassen Sie mich ewtas sehr klar betonen. Weil der Design-Task automatisch jede Nacht läuft, stellen wir absolut sicher, dass nur komplett entwickelte und erfolgreich getestete Features und Aktualisierungen in das Repository übertragen werden. Wir empfehlen ausdrücklich die Verwendung einer Versionsverwaltung.

Application template

Ein anderer wichtiger Punkt ist die Option "Prohibit design refresh or replace to modify" für jedes anwendungs-spezifische Design-Element. Diese Option wird automatisch aktiviert, wenn in der Anwednungs-Schablone ein neues Design-Element erstellt wird.

Allerdings sollte beim Kopieren von Design-Elemente besondere Vorsicht geboten sein. Lieber die Option zweimal überprüfen. Ist die Option nicht aktiviert, löscht der Design-Task in der Nacht das Design-Element. Hatte ich die Wichtigkeit von Versionsverwaltung erwähnt?

Prohibit design refresh or replace to modify

Die produktive Anwendung erbt direkt von der Anwendungs-Schablone.

Production application

Vielleicht werde ich das nächste Mal über die Verwendung von Git in diesem Szenario bloggen.

Happy coding!

IBM Connect 2016: REST Services in Domino – Key to modern Web Applications

2. Februar 2016 Posted by Bernd Hort

IBM Connect 2016

As promised the slides and the sample database from my session at IBM Connect 2016 REST Services in Domino - Key to modern Web Applications.

Even if you didn't had the chance to make it to my session, with the slides and specially with the sample database you have a good starting point.

.

IBM Connect 2016 – We’ll be there

17. Dezember 2015 Posted by Bernd Hort

IBM Connect 2016

As in recent years I have the honor to give a sessions at Lotusphere IBM Connect.

AD-1238A: REST Services in Domino - Key to modern Web Applications
Session date Monday, 2016-02-01
Session time 04:45 PM - 05:45 PM
Session location Hilton Orlando, Lake Highland AB
Speaker Bernd Hort, assono GmbH

Any modern Web Application, whether it is implemented in IBM BlueMix or using AngularJS, uses REST services. REST became the de facto standard for interaction between systems.

With the integration of XPages in Domino, there are a lot ways to provide REST services. It is time to take a closer look how we can provide REST services in Domino.

After laying the groundwork with a short introduction to REST, we will discuss how to use the IBM Domino Access Services.

Another way to utilize the REST Services which come with the Extension Library are Custom Rest Services.

Next we will introduce JAX-RS and show how to implement a custom written REST Service in Java.

Looking forward to see you at IBM Connect 2016.


XPages: Java Interfaces Java and Test Driven Development

15. Oktober 2015 Posted by Bernd Hort

A word of warning: the following article is quite lenghty and abstract. It basically says that using Java Interface in your XPages projects leads to better (that means more maintanable) code and that with the help of the OpenNTF project org.openntf.junit.xsp a developer can utilize Java Interfaces to write better test code for their XPages projects.


I have to confess that when I started with Java Development some time ago I didn't like Java Interfaces. While in some cases I could see that they are useful most of the time they gave me a hard time trying to understand the code of someone else. My usual approach for reading someone else code is to figure out how to invoke the part I'm interested in and then take a close look at the parameters that are passed to the method and the return value. Interfaces due to their nature shield the implementation.. But that the part I was interested in. Searching for the current implementation made it more complicated.

Since working with XPages my preferences had completely changed. Like most of the Notes developer which start with Java my code used to be small. If you write some Notes Agent to invoke a Web Service or generate a PDF document there is normally not much need for an elaborated design of your class hierarchy.

But nowadays as we developed our own XPages framework totally Java based the rules and approaches must cope with the arising complexity. One aspect were Java Interfaces helps us is the Open/closed principle. Simply speaking the Open/close principal state that code should be open for extension but closed for modification. With modification are those meant that leads to changes in calling methods and therefore are costly and error-prone. If you find a better way to implement an algorithm inside your class no one will complain. But if there is change in your API resulting into the necessity to change code in a lot of calling methods things might get messy.

By using Interfaces as parameters and return values it is like having a contract. The caller of your method can rely on whatever will be passed to the method and returned from it will work as long as it implements the Interface. If you write a new class which is way faster than your old code you can use it instead without worrying that you break something. This is true as long as the new code implements the same Interface. If you find a cool new OpenSource library which you would like to use instead and it does not implement the Interface, you can simply write a wrapper for it.

To believe nothing breaks by your change is one thing. To know it, is another thing. This is were Test Driven Development and JUnit Testing comes in. The idea to walk away from any change you made and to be absolute confident that everything works is amazing.

My first steps using JUnit were a little bit frustrating because there is no way to run JUnit test in Domino Designer directly for your XPages Java code due to the virtual file system a NSF is from Eclipse point of view. So I had to export my Java code and then run JUnit tests in a stand alone Eclipse.

I really was delighted when I read about the OpenNTF project org.openntf.junit.xsp. This project allows to execute the JUnit Tests from within an XPage.

One of the challenges with writing test code is that with systems running in a special environment like XPages you have to find a way to have living objects from this environment. A way around this issue is to use a mock object. And again with Java Interfaces this is easy. Instead of basing an existing Notes document to your test code you could pass a mock up object since lotus.domino.Document is a Java Interface. So there is no need to have a Notes Session, a Notes Database and a existing Notes Document that meets your test requirements for now and all the future to pass your JUnit test.

Christian Güdemann did a great job integrating EasyMock into org.openntf.junit.xsp. Read more in his blog post "org.openntf.junit.xsp – now with EasyMock support".

Have a closer look into using Java Interfaces today. They really help you.

Happy coding!

Freies E-book: Development Tips and Best Practices for XPages

25. September 2015 Posted by Bernd Hort

socialbizUG_logo.jpg

Die SocialBiz User Group hat mehrere Texte zum Thema XPages in einem Free E-book: Development Tips and Best Practices for XPages zusammengestellt.

Nun ratet einmal, wessen Präsentation von der IBM ConnectED 2015 Teil dieser Zusammenstellung ist?

IBM ConnectED 2015: BP 108 - Be Open - Use Web Services and REST in XPages Applications


OpenNTF XPages Extension Library und Domino 9.0.1 FP3 / FP4

26. August 2015 Posted by Bernd Hort

Auf der Download Seite für die OpenNTF XPages Extension Library befindet sich ein kleiner Hinweis bei den letzten beiden Releases 901v00_12.20150311-1316 and 901v00_13.20150611-0803:

“Please be aware of technote SWG21696682 as it affects the installation of the Extension Library if the UpdateSite.nsf method is used.”

Mit diesem Hinweis gemeint ist, dass wenn Sie eine UpdateSite.nsf auf einem Domino 9.0.1 Server mit FP3 oder FP4 verwenden, um eine Extension Library zu installieren, Sie in Schwierigkeiten sind.

Bei beiden Fix Packs verhindert eine Änderung in den Sicherheitseinstellungen für die Verwendung des Befehls java.classforName in der JVM das eine Extension Library geladen wird. Auf der Serverkonsole gibt es keine Fehlermeldung oder sonsts einen Hinweis. Die Extension Library steht einfach nicht zur Verfügung.

Für das FP4 ist die Lösung sehr einfach: Installieren Sie den JVM Patch SR16FP7 so wie in der IBM technote “Interim Fixes & JVM patches for 9.0.1.x versions of IBM Notes, Domino, iNotes & Notes Browser Plug-in” beschrieben ist.

Nach der Installation des JVM Patch SR16FP7 werden Sie auch wieder die geliebte Meldung auf der Konsole sehen: “...NSF Based plugins are being installed in the OSGi runtime...”


Fehler bei der Installation des Notes 9 Client Fix Pack 4 “Version Mismatch”

14. August 2015 Posted by Bernd Hort

Notes_90x90.png

Auf einem frisch installierten Windows und einem frisch installierten Notes Admin and Designer Client 9.0.1 habe ich versucht das Fix Pack 4 zu installieren. Leider erhielt ich die folgende Fehlermeldung.

Error - version mismatch. Expected to find version: "20131022.0932", found version(s): "20131015.0605"

Die einzigen beiden IBM Technotes zu dem Thema waren LO80281: Version Mismatch When Installing 901 FP1 und Notes fix or hotfix installation fails with "Error - version mismatch.".

Der Vorschlag das Notes Install Cleanup Executable (NICE) Tool zu benutzen, war auf einem frisch installierten Windows und frisch installiertem Notes Client nicht gerade erfolgversprechend.

Glücklicherweise habe ich einen Blog Eintrag von Dmytro Pastovenskyi 8.5.1. FP1 found problem during installation. Error: version mismatch. Expected to find version "20090929.1223", found version(s): "20091002.1006" gefunden.

Er schlug vor das Fix Pack auszupacken und in das Verzeichnis deployhotfix zu wechseln.

fix.ini-in-hotfix-directory.png

In dem Verzeichnis befindet sich die fix.ini. Einfach die Zeile ForVersion zu ForVersion=20131015.0605 ändern.

fix.ini.png

Nach dem Speichern der fix.ini lief die Installation durch. I habe anschließend auch noch die JVM gepatched wie in der IBM Technote Interim Fixes & JVM patches for 9.0.1.x versions of IBM Notes, Domino, iNotes & Notes Browser Plug-in. beschrieben.

Bisher läuft der Client absolut stabil. Tatsächlich schreibe ich diesen Blog-Post gerade auf besagtem Notes Client.


LotusScript Web Services and NullPointerException

7. August 2015 Posted by Bernd Hort

DominoDesigner_90x90.png

Recently I worked on a demo application for a customer to show how to use Web Service Consumer in LotusScript. At one point I got a java.lang.NullPointerException error. It took me quite some time to figure out the reason for this error. So this blog post should help anyone how might run in the same problem. Because frankly the solution was really simple once I had found it.

I give you the summary first and the full technical explanation later in this blog post. So even if you are not interested in the details the main point to take away is:

LotusScript Web Services Consumer and Provider use internally Java and Java is case sensitive. If you do not obey this you might loose some hours of your life time chasing an error where no error is.

Here are the technical details.


One part of the demo were the different styles to use to generate the WSDL file from a Web Service Provider. There is a great article from IBM developerWorks Which style of WSDL should I use? on this topic. Highly recommended!

To be able to show the differences between RPC/encoded and Document/literal style I implemented two different Web Service Providers. Both providers had the same identical LotusScript code.

Then I implemented two Web Service Consumers just by importing the WSDL file from the previous generated Web Service Providers. Here are the two methods from the Web Service Consumers.

Web Service Consumer calling a RPC/encoded Web Service Provider
Web-Service-Provider-RPC-encoded-Settings.png

Function checkout_status(auftragnr As String) As String
  If Not IsDebugMode Then On Error Goto errorHandler
  On Error lsERR_NOTES_WSENGINE_UNINIT_METHOD_ARG Goto wsErrorHandler
  On Error lsERR_NOTES_WSENGINE_NOTINIT Goto wsErrorHandler
  On Error lsERR_NOTES_WSENGINE_ERROR Goto wsErrorHandler
  On Error lsERR_NOTES_WSENGINE_METHOD_ERROR Goto wsErrorHandler
  On Error lsERR_NOTES_WSENGINE_METHOD_FAULT Goto wsErrorHandler
  
  Let checkout_status = Service.Invoke("checkout_status", auftragnr)
  
  Exit Function
  
errorHandler:
  If HandleErrorWithContext(CreateErrorContext(Nothing,|auftragnr: "| & auftragnr & |"| )) = RESUME_NEXT_LINE Then Resume Next
  Call RethrowError()
  Exit Function
  
wsErrorHandler:
  If HandleErrorWithContext(CreateErrorContext(Nothing,|auftragnr: "| & auftragnr & |"| )) = RESUME_NEXT_LINE Then Resume Next
  Call CreateWebServiceLogEntry(Me, |auftragnr: "| & auftragnr & |"|, Nothing)
  Call RethrowError()
End Function

Web Service Consumer calling a Document/literal Web Service Provider
Web-Service-Provider-RPC-encoded-Settings.png

Function checkout_status(auftragnr As String) As String
  If Not IsDebugMode Then On Error Goto errorHandler
  On Error lsERR_NOTES_WSENGINE_UNINIT_METHOD_ARG Goto wsErrorHandler
  On Error lsERR_NOTES_WSENGINE_NOTINIT Goto wsErrorHandler
  On Error lsERR_NOTES_WSENGINE_ERROR Goto wsErrorHandler
  On Error lsERR_NOTES_WSENGINE_METHOD_ERROR Goto wsErrorHandler
  On Error lsERR_NOTES_WSENGINE_METHOD_FAULT Goto wsErrorHandler
  
  Let checkout_status = Service.Invoke("CHECKOUT_STATUS", auftragnr)
  
  Exit Function
  
errorHandler:
  If HandleErrorWithContext(CreateErrorContext(Nothing,|auftragnr: "| & auftragnr & |"| )) = RESUME_NEXT_LINE Then Resume Next
  Call RethrowError()
  Exit Function
  
wsErrorHandler:
  If HandleErrorWithContext(CreateErrorContext(Nothing,|auftragnr: "| & auftragnr & |"| )) = RESUME_NEXT_LINE Then Resume Next
  Call CreateWebServiceLogEntry(Me, |auftragnr: "| & auftragnr & |"|, Nothing)
  Call RethrowError()
End Function

Can you spot the difference? I guess it is easier after giving you the solution.

In the Document/literal version the line for actually calling the Web Service must be
Let CHECKOUT_STATUS = Service.Invoke("CHECKOUT_STATUS", auftragnr)
with capital CHECKOUT_STATUS.

I found out because I took the original generated code and enhanced it with some error handling. Since there could be not code without properly error handling. This is specially true for calling Web Service.

Since I'm a lazy programmer I copied the code from the one Web Service Consumer to the next not looking at the case. I was very confusing that the first Web Service Consumer worked and the second one returned a java.lang.NullPointerException.

After checking for all kind of reasons I finally started again with a new Web Service Consumer and then found the difference in the case.

The reason behind is the internal use of Java. While calling Service.Invoke in the background the Java Reflection API is used to find the corresponding method to call. Those two different WSDL styles lead to two different method names: checkout_status and CHECKOUT_STATUS. In LotusScript the case of a method name makes no difference. In Java it can mean you can spend hours looking for an error.

By the way if I had used Java in the first place to program the Web Service Consumer (or Provider) I would not have had this problem.

IBM Notes und Windows 10

31. Juli 2015 Posted by Bernd Hort

Notes_90x90.png

Laut dem IBM Collaboration Solutions Support blog bereitet die IBM gerade eine offizielle Technote vor mit den folgenden Aussagen

  • Der Notes-Client unterstützt Windows 10 ab dem Release 9.0.1 Fix Pack 4
  • iNotes und das Notes Browser Plug-in wird Windows 10 ab dem kommenden Release 9.0.1 Fix Pack 5 unterstützen

About Windows 10 support for Notes, iNotes & Notes Browser Plug-in

Wie immer werden wir Sie auf dem Laufenden halten.


Gerüchte: IBM Connect 2016 in Orlando

23. Juni 2015 Posted by Bernd Hort

Die Leser dieses Blogs kennen ihn als Quelle von harten technischen Fakten. Manchmal sind aber auch Gerüchte einfach zu gut, um sie nicht weiter zu verbreiten.

Nach der IBM ConnectED 2015 war nicht klar, wie und ob es eine vergleichbare Konferenz im nächsten Jahr geben wird. Es verdichten sich die Hinweise darauf, dass es eine Antwort auf diese Frage gibt.

IBM Connect2016 Save the date

Der gewöhnlich sehr gut informierte Volker Weber hat im richtigen Moment aufgepasst und einen Hinweis auf die IBM Connect 2016 Konferenz in Orlando entdeckt.

Der Veranstaltungsort sind anscheinend nicht mehr das Disney Dolphin and Swan Hotel. Statt dessen könnte die Konferenz jetzt im Hilton stattfinden.

Auf der offiziellen Webseite ist die Ankündigung nicht mehr zu lesen. Aber der offizielle Twitter Account zeigt immer noch den Teaser.

Wir werden Sie auf dem Laufenden halten.

Wo auch immer die Konferenz stattfinden wird, wir werden mit dabei sein.


EntwicklerCamp 2015: XPages – WebServices und REST

4. März 2015 Posted by Bernd Hort

EntwicklerCamp

Der letzte Tag des EntwicklerCamps ist gekommen. Heute war mein zweiter Vortrag zum Thema "XPages - WebServices und REST". In 90 Minuten habe ich ausführlich beschrieben, wie Webservices und RESTful Webservices innerhalb von XPages konsumiert werden können. Die erste Hälfte des Vortrages konzentrierte sich auf das Backend mittels Java. In der zweiten Hälfte habe ich den Blick auf JavaScript im Browser gerichtet.

Wie immer können die Folien und die Beispiel-Anwendung heruntergeladen werden. Basis für diesen Vortrag war mein Vortrag auf der IBM ConnectED 2015: BP 108 - Be Open - Use Web Services and REST in XPages Applications. Insofern ist die Beispiel-Anwendung die gleiche wie beim IBM ConnectED-Vortrag.

 

In der Beispiel-Anwendung befinden sich nicht nur XPages, um die Webservices und RESTful Webservices zu konsumieren. Damit die Beispiele auch bei Ihnen ohne Probleme laufen, sind ein Webservice und drei RESTful Webservices implementiert.