Sharing new technologies and best practices

 
alt

Chris Connor

 
Follow ChrisJConnor on Twitter
Chat with me

XPages Case Study Application - Procurement Tracking - A Hybrid NSF / SQL Application

Chris Connor  November 21 2012 05:27:56 AM
A while back I raised a point regarding application design for an XPages application that one of my customers were considering. This was a procurement / contract tracking application that was to track spend / values over a annual periods etc (Not really the sort of application that is best suited to the NSF structure). However, we were keen to build on existing XPages resources and RAD benefits such as

1. Security driven by Groups and the ACL
2. Use the One UI and the Extension Library as a starting point for UI design
3. Build and extend our own libraries of OSGI code that can be used for future applications
4. Being a large Notes user make use of current Domino Web Infrastructure
5. Make use of internal support resources available from a Domino Administration perspective
6. Build on internal Notes / Java skills that are available

The list could go on...But one major headache remained - The "NSF" data structure - its not really built for this.

From experience we should not bend this data structure to do this - the main data structure had to be the NSF.

I intend in posting in the near future a series of blogs (and perhaps video) will provide some insight into how I....

1. Used Java to build a data access layer initially modelled for Notes for prototyping but then switched to MS-SQL.
2. Built Custom Controls and Java for customisable Query Screens and Reports in Excel - Direct from SQL using stored procedures.
3. Built Java libraries for a host of useful (and re-usable) custom converters, validators.
4. Used Phase Listeners, Value Change Listeners and Scoped Objects to write a full audit trail to SQL - for every field!
5. Used beans as controllers for various application operations

The purpose of this exercise with my client was not only to deliver this application but also to provide a template for future use that covers a wide range of application use cases for most situations. Also vital in this process was the skilling and enabling of the internal team for future projects.

Hopefully these blog posts / videos etc will prove useful to others considering this path! (Any questions, comments or areas you would like me to cover would be most welcome)
Comments

1Paul Withers  11/21/2012 6:00:17 AM  XPages Case Study Application - Procurement Tracking - A Hybrid NSF / SQL Application

Sounds very interesting. Declan's post on ValueChangeListeners was very useful for me for audit trails, although it needed a couple of tweaks.

Are you using the Extension Library for integrating via JDBC?

2ChrisJC  11/21/2012 6:05:43 AM  XPages Case Study Application - Procurement Tracking - A Hybrid NSF / SQL Application

Paul,

Thanks - Decs post was of real help initially.

Re "Extension Library" - I am kind of but with a little twist. Its all done with Java but certainly utilises some of the ExtLib stuff. Hope that makes sense (without going into the nitty gritty right now)...

3Jesper Kiaer  11/21/2012 6:18:12 AM  XPages Case Study Application - Procurement Tracking - A Hybrid NSF / SQL Application

Looking forward to it!

I have a customer with a similar scenario, so I am very interested to hear your solutions.

4ChrisJC  11/21/2012 6:29:54 AM  XPages Case Study Application - Procurement Tracking - A Hybrid NSF / SQL Application

Jesper,

Sure - there is so much to cover in this it may take a bit of time - keen to do it right. Hopefully looking to build up some resources around blog postings, videos, presentations etc. The issue around views / reporting / volumes is an age old one.

However there is a lot around the use of Java throughout the application too that I think may be useful - it does follow on nicely from a presentation I did at LS12.

Again - if there are specifics you would like to focus in on then feel free to ask....

5Nick Wall  11/21/2012 6:43:13 AM  XPages Case Study Application - Procurement Tracking - A Hybrid NSF / SQL Application

Sounds great. I will follow your posts with great interest.

We have a web application that has been up for a while, we generate a LOT of audit data (every single field change, every button press...it's a requirement), which we store in SQL, we get and retrieve this via web services, we batch the data across. We also use a SQL data store for some aspects of the app, accessed via beans and an MVC model (so we can switch between a Domino or SQL data layer), but we are not doing it efficiently. At the moment, the JDBC driver is in the DB, so it opens a connection each time it is accessed, we need to switch this to connection pooling.

I have a test server set up where I tried to set up an OSGI MySQL plugin, but I can't get it to work. I followed chapter 12 of XPages Extension Library Book, but I think I need to try again using DB2 as in their example, there are a lot of steps and my IDE does slightly diff things to book and I guess I am doing something incorrectly. Anyway, would be very interested to hear how you deal with JDBC drivers, connection pooling, clustered environment etc.

If I get my OSGI plugin working (someone had one posted online but had to pull it due to some legal issue) I will post my results. I've just seen this, so need to check out when I have time: { Link }

6ChrisJC  11/21/2012 6:47:19 AM  XPages Case Study Application - Procurement Tracking - A Hybrid NSF / SQL Application

Nick,

Thanks - Great comments.

I setup the OSGI plugin with the MSSQL driver and it works very well - from memory I followed the DB2 steps. Getting the right driver is key I guess.

Maybe as part of the process I should revise and document this configuration. It will at worst act as a reference for me in the future in doing it..

Keen to chat around "optimisation" as this is something there is not a lot of information around in XPages land.

7Baiju Thomas  11/21/2012 8:20:09 AM  XPages Case Study Application - Procurement Tracking - A Hybrid NSF / SQL Application

Nick,

I could setup SQL Server jdbc driver as an OSGi plugin just by following the DB2 steps... It worked the first time. It is a lot of steps, but you just need to follow the documentation...

I am working on an application which uses SQL Server as backend and XPages as the front end. I am using the new JDBC feature in extension library. My approach is to define the JDBCQuery and JDBCRowset for the datasources and once you set them, you could just work with them as you would with an NSF backend. I am trying to minimize the differences beyond this point. So all the validations, conversions ,simple actions etc. will work just the same way as in a regular XPages application with NSF backend.. The only place the code will change is where you set the dataSources. Once the data source is set, it is a bean and you can work with that data just like a notes document or notes view. It is all working great so far, but I have a long way to go before I complete this application.

Upto this point, it all worked perfectly as I had hoped and performance has been great..

8ChrisJC  11/21/2012 8:26:26 AM  XPages Case Study Application - Procurement Tracking - A Hybrid NSF / SQL Application

Baiju,

My app is sort of similar. I have data access classes which read lists of records that relate to a main document in Notes (sort of one to many). All the docs on save are written to SQL. On open of the doc again the "many" records are read into an arraylist for display and maniplution.

All the converters and validators etc dont care about the data storage (as that all happens on save - after conversion and validation has passed).

9Gayathri Viswanathan  11/22/2012 3:22:45 AM  XPages Case Study Application - Procurement Tracking - A Hybrid NSF / SQL Application

Chris,

This would be a great addition to the XPages resources that are being built up. I am working with couple of customers where we are creating POC to convince them that they can leverage their existing domino infrastructure far beyond what they have done before and showing them integrated UI where we have data coming in from SQL has been a good value add. Looking forward to your series to learn more best practices

About Me

Java / Web Development consultant with 17 years experience. Focus on XPages, Java / JSF / J2EE, Websphere Portal, Spring / Hibernate, RCP, jQuery, Dojo, RCP, Eclipse, RAD, Phonegap and general Mobile development. Experienced public speaker at several global events.

My day job is building Web applications for my customers using the best technologies for the job. This blog discusses the issues in delivering these modern collaborative solutions.

I am available for hire through my business BSS IT Solutions. We are an IBM Business Partner based in Scotland serving the UK and beyond!