Getting started with the xpages extension library


If you have been working with IBM Lotus Notes development – you will know that the main development focus is with Xpages – the Java Server Faces technology which has been built into 8.5.2 releases. You will probably also know that a couple of resources have been made available to help you get started with xpages web and client development. The first is the demo database which you can get from here off the OpenNtf web site and the second is the xpages extension library which adds more features and functionality to the design process for xpages web apps.

 Please note that the first download you are looking for needs you to select the “Releases” option on the left and then on the “release” to get the file you are after. The image below  shows the current options ..

so in this case 1.0.3 is the latest. Click on that to download and save to a folder for later. This will help you confirm if you have everything you need to test the extension library later.

Once downloaded – put a copy of the .nsf file contained in it into your LOCAL notes data folder – you should use the Domino Designer 8.5.2 to open and sign the nsf. This is important !

 When completed open the file in the notes client and you should be rewarded with the xpages demo running in the Notes client.

Hang on – I thought you said that xpages was a web technology using Java Server Faces.

Okay – the reason we are doing it this way is to prove that each of the components works. If you want to view the xpages demo via a web browser – you can either preview it from inside designer or follow the next step to view it as intended from the Domino  server via a browser. Your next step is to create a replica from the version you just opened – do this from the workspace and make the destination your Domino 8.5.2 server (note that I have not tested with anything other than 8.5.2 both on the server and client).

Now that you have the  database on the server – use IE to open the file – http://servername/xpages.nsf should do the trick if you haven’t changed the databases names and you have dns setup for the notes server names resolution. If not use the full name for example http://mynotesserver.something.com/xpages.nsf. Hopefully you will be looking at the notes xpages demo by now.

So thats phase one complete – but weren’t we talking about the Extension library for Xpages. Okay we have some more work to do then.

Get the extension library from here on OpenNtf 

In this case its name is 2/6/2011 – so save that to a folder where we can extract the appropriate items.  Extracting the zip file gives us a number of items but the first we have to deal with it the nsf file. Again copy that to your local clients notes data folder. Open in designer and sign.  I had one other thing that I needed to do – on the database design – change the default launch option for the app opened in the notes client to be the same designated xpage that would be used for the web client. Replicate a copy to the Domino server once you have done that.

Don’t try to open yet as we are not finished. In designer use  the  file application / install option – select search for new features to install – select the add zip / jar location and browse to the folder where you extracted the Extension library files to. Select the updateSite.zip file and follow the default instructions through to get the application installed. Once finished restart designer – its important to restart.

Next comes the gotcha – if you are going to look at the app locally through a web browser if will fail with an error so do this even if you will be doing mainly server based development and preview – lest you forget and spend time debugging something which isn’t actually wrong.

The error should be something like this

Cannot find the library com.ibm.xsp.extlib.library, required by the application XPagesExt.nsf.

Sooooooo….

Copy the library plugins and feature from where they are installed into the Designer (the contents of both folders)

NotesDataworkspaceapplicationseclipse

[the workspace used by the running Designer instance]

to
NotesDatadominoworkspaceapplicationseclipse

[the workspace used by the Designer web preview server]

Then restart Designer.

Now you can preview your extension library application either in Notes or web browser locally.

So finally for the last step  – getting a copy running from the server. You already have the database in place but you need the extension library files on the server in the correct place. Copy the jar file from the updatesite.zip file to the server and place in in the features folder as shown below.

Last and not least either restart the server or restart the http task on the server with Tell Http restart.

You are  finally  ready to test the nsf from the domino server with a browser. http://servername/xpagesext.nsf.

If you have been able to get the demo open both locally in notes and web and from the server via a browser – put your feet up and have a coffee – you earned it !!

More on this application later …