A few Years of XPage Developement – Part 3


Enter Domino version 9.0.x and goodbye to the “Lotus”

The first thing I heard about the newest version of Domino was that the term “Lotus” was banned.  The second was regarding the debugging functionality.  Since that was my single most influential headache, I decided that I would do a bit of testing and build a Demonstration database for the 2013 Connect Comes 2U hosted by holistic-net in Hannover and SOFTWERK in Fürth.  The demonstration was primarily a padawan level database written by a Jedi Knight level developer.  Key controls were implemented with default values and simple data binding.  Using the Application Layout and the OneUI themes, a front end was created very quickly.  Because limited JavaScript code was used, the debugger was not an issue at that point, though I did make limited use of it.  The most awesome point about this particular demonstration database was that CRUD operations were performed on data stored in a MySQL database.  Even though the database design was relatively simple, the GUI design itself was impressive and took an unbelievable 2 weeks to implement.

With a few words of praise from the boss, the wonder of a new Domino version that showed great potential, and the desire to graduate to “Jedi Master” status, I took on another project and entered Tier 3.   Tier 3 is marked by excessive use of Java Code and a limited use of JavaScript.  The debate between which is best has been touched upon by many a blogger, and so I am not going to get into that at all, but I will say that the IDE, based on eclipse, is very java ready.  Most of the problems I had with JavaScript were no longer an issue when implemented in Java.  The ‘if’ statement issue, explained under Solar, is caught by the java compiler as are many other similar errors.  If you state that a variable is of type “Document” it can never be set accidently to a “DocumentCollection” value and so on.  This is my primary reasoning behind standing behind java implementation of XPage functionality as opposed to JavaScript.

Once it became clear that I would be given a second Customer XPage project, I started to dive into the Java Code and create my own utility classes.  This single preparation project led to another and both of them were used for the customer project.  The first of these has been titled “holisticXutils” or “hxu”.  hxu is primarily a java jar containing Java helper classes.  It provides shortcuts for working with vectors, strings, and Notes Names.  It provides functionality to help with document locking, logging, development, and property files.  It contains custom controls that help with Scrollable Panels, code logging directly visible on the browser to those with the correct ACL role, and a few JavaScript helpers as well.

A few big strides were taken in this Project.  Most notable, all JavaScript is written in an Object Oriented Style.  One big issue that is currently seen while supporting the Solar project is that all JavaScript functions are written in one massive SSJS library file.  All code is written directly after another.  Adding to the fact that these functions are not listed alphabetically, it takes forever to find what you need if you are unsure how the function was named and cannot use the ‘find’ function.  Writing all code in an object oriented style allows for an application that is, simply put, maintainable, even if it does introduce some problems of its own, i.e. nested function calls are not listed on the left side panel.

Version 0 of hxu was primarily testing and getting comfortable with the IBM Domino API.  This is not easily done for someone who only ever coded in LotusScript.  If you type in “View” in the IDE, you get a View object in many different packages.  It took me a while to figure out that the correct one is in the lotus.domino package.  Getting a handle on the session was also not very intuitive, but simple now that I did it almost a thousand times or more.  Version 1 was the first version used in an actual project.  It did not assume that the extension libraries were installed, but it did require OpenLog from Paul Withers.  (Available on openNTF).  Thanks Mr. Withers!  Version 2.x expanded the Logging functionality and required an update to the databases that implemented version 1.x.  It included Logging into my second preparation Project, holistic XLogger, or “Xlogger”, or “hxl”.  We will have to get into version 3 in a moment.

One huge problem that I had was logging.  I successfully used openLog and the tools provided by Mr Withers to track uncaught errors, but this functionality did not go deep enough for me.  I wanted    the ability to document each user’s session.  I wanted to know what browser he used, which version, and a list of all things done so that I can easily diagnose any problem that arose during productive use of an application I create.  Logging things to the Server log is a questionable practice at best, and an absolute no-go at worst.  I had already implemented all of this in my debugging custom control; all I needed was a way to expand this functionality to save information programmatically to a single document created for the user’s session.  With a quick update to hxu, it was possible to create a single logging function that saved data in multiple places at one time.  These places can also be configured using designer in the appropriate .properties file.

After these two preparation projects – hxu and hxl, I felt confident in my ability as a Jedy Master level XPage developer.  I had all the tools I needed to be successful.  Logging, Java, JavaScript, Extension Libraries, I was a dog on the track waiting for the gates to open and a final “do it” from men in charge.  The Customer Project River was given a go and off I went.

Tagged , , , , . Bookmark the permalink.

About reederProgramming

I already have an about me page, so I will just put a quick bit of info here. I am a Notes/Domino developer at holistic-net GmbH located in Hannover, Germany. I use Java primarily at home and as often as I can at work. I have dabbled in C# and a few other languages and platforms. This website started out as a place for me to quickly store and access some of my most important how-tos and has started to become a place where I can really help others too!

Leave a Reply

Your email address will not be published. Required fields are marked *