Sharing new technologies and best practices

 
alt

Chris Connor

 
Follow ChrisJConnor on Twitter
Chat with me

Speaking at BLUG 2013

Chris Connor  February 12 2013 02:32:23 AM
Delighted to say that I am speaking at BLUG 2013. I will be presenting on one of my favourite subjects - building hybrid NSF / SQL applications with Java, XPages and the extension Library. It follows on from my last posting. I am hoping the work I do for this presentation will act as a springboard to start to produce the series of articles that I mentioned in my last blog.

Will be great to attend my first BLUG - heard so much good stuff about it. Also looking forward catching up with all the usual suspects and meeting some new ones....

Great thing is - it coincides with a certain landmark birthday (the one that no-one must mention). That is a week later - good excuse to try out some of the much talked of local beers!

Hope to see you there!

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)

Websphere portal 7.0 / RAD 8.0.4 and file uploads with <hx:fileUpload>

Chris Connor  August 7 2012 02:02:46 AM

Been working on a rather interesting proof of concept application with Websphere Portal 7 and RAD 8.0. All going well connecting MS SQL Server 2008 via JPA and building JSF based portlets. Once major concern though is the use of the . At the moment something strange occurs if you simply add it to the page - no content in the portlet is displayed on the screen!

Basic control - blank screen is rendered in all main browsers (IE, Firefox and Chrome). The error in Firefox is as follows

this.eventService is undefined
com.ibm.pb is undefined
com.ibm.data is undefined
com.ibm.pb is undefined
dojo.byId("ibm-menu-links") is null
<%@taglib
uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model"
prefix="portlet-client-model"%>
I know there are some issues around 8.0.4 and fileUploads - this is fundamental though!!
 
Code is attached in a text file below.
 
Appreciate any comments or feedback if you have similar experience.

Releational Database options for Reporting and Scaling / Performance with XPages and General Notes / Domino

Chris Connor  May 22 2012 03:38:41 AM
At the moment considering options for XPages application architecture for a customer. Forming options based around the need for building reports (traditionally a poor area in Lotus Notes). Client is very keen on the use of relational database access for this so that they can easily write queries to give them the reports the need with SQL / stored procedures or use standard "Reporting Tools" to access the structured data.

Based on this I was considering evaluating

1. DomSQL - built for this very purpose. Uses SQLLite to "duplicate" view data. Some initial things to consider are
(a) Easy to setup - Install some OSGI plugins on the server for XPages and configure some XML settings
(b) Synch happens with Notes / Non Notes without having to do anything
(c) Performance - a concern. Dont think this is the sort of thing we can just start to "switch on" on a production server without serious consideration of traffic / transactions, databases / data volumes etc.
2. Build some scheduled / triggered agents that move the data between both RDBMS data and NSF (one way from NSF to RDBMS)
3. Writing some sort of triggered event (on save of the document) in XPages that pushes the data over to the RDBMS  (Say their corporate SQLServer / Oracle database structure)
4. Using the Relation Data Access stuff released last year to read / write to the SQL store.

These options all mean "duplication of data" on both sides of the system

Don't really see that as a big issue - as you can still take advantage of the XPages framework for workflow / mail and RAD. Its only a subset of the data that would be copied to the relational structure (towards the end of the project once we start honing reporting requirements). All of the points (except 1) involve writing code to push data to the RDBMS - there is a time and cost factor here.

Will be progressing these investigations - hopefully document findings here on approaches. Keen to hear your thoughts / comments...




getCurrentElement() null issue in Java UI Classes for Eclipse

Chris Connor  May 21 2012 11:38:50 AM
Seems to be this behaviour is a "feature" of the product which may be fixed over time.

A similar threads on DeveloperWorks forum (or Notes.net as I still like to call it..)

Kevin Duan  http://www-10.lotus.com/ldd/nd8forum.nsf/5f27803bba85d8e285256bf10054620d/e0da559819b54d0b852579a20034ce5c?OpenDocument

Also being hinted at in some other places that the view behaviour is unreliable at best.

 At the moment (until I can come up with a better idea) I am running some code as follows for this condition in the job thread

        if(elem==null){
                return Status.CANCEL_STATUS;
        }
....
....
....
return Status.OK_STATUS;


I then check in my calling code to see what the jobs status was returning as follows

if(job.getResult().equals(Status.CANCEL_STATUS)){
                MessageDialog.openInformation(composite.getShell(),"Document Not Uploaded","Document NOT Uploaded. Instead of running this process from a view please retry again from an open document.");
}

This is far from ideal. However, it is at least catching the null situation and informing the user. It is also allowing the user to attempt to perform the action from the view screen.

Anyone know of a better approach?


Plugin Development with Java UI Classes

Chris Connor  May 21 2012 08:19:42 AM
Been working on an eclipse plugin which extends the right click menu. The idea is that it sends (creates) a bookmark type document in a central XPages "Knowledge base" database based upon the selected document.

So the user right clicks to select a document and chooses the "Bookmark" option below

Image:Plugin Development with Java UI Classes
Which provides this dialog

Image:Plugin Development with Java UI Classes

The bookmark document contains simply

1. A subject describing the document
2. A Tag for the document (category)
3. A "Notes URL" link to take the user to the source document

The idea is that people can then search the knowledge base using the tags etc and then open the source document for more info.

So this works on the basis that the URL is built from the selected document (this is where the issue lies... It is running a piece of code that does

NotesUIWorkspace ws = new NotesUIWorkspace();
NotesUIElement elem = ws.getCurrentElement();

Now - if I run the process direct from the Eclipse "Run Configuration" it works fine. If I build the plugin and then install it some strange behaviour can be observed in that "elem" sometimes returns null when run from a view on "Selected Documents".

Note it always returns a valid value if ran on an open document in the Notes UI (ie from the document through the form).  

It sometimes resolves itself to return a correct value (sometimes on subsequent runs, sometimes requires you to open a document and run it THEN try it on a view / document).

Its fairly intermittent and extremely frustrating!

Anyone had any experience / knowledge of this?

XPages DataModels and Exporting to Excel

Chris Connor  May 4 2012 02:44:41 AM
Been doing a lot of work in XPages around Exporting - so naturally built a Java Class to run as a managed bean to do this. It extends the widely documented concept of SSJS Agents in that a button redirects to a page which renders the content as Excel or whatever.

So I thought - let the Excel class have different methods to do different things such as Export a view, a document collection and even the data used in a repeat control (essentially what is on screen). Package it up as an OSGI plugin and it can work for any app - sounds great.

However, the main problem that I am having with this centres around the repeat control export concept which is tied to a dataModel object. Consider the following piece of Java Code.

        public DataModel getRepeatModel(String repeatid) {
                this.repeat = (XspDataIterator) JSFUtil.findComponent(repeatid);
                this.datamodel = this.repeat.getDataModel();
                System.out.println("Repeat rows is "+this.repeat.getRows());
                System.out.println("Data Model Row Count on initial get is = "+this.datamodel.getRowCount());
                return this.datamodel;
        }


Frstly the repeat.getRows() returns 30 = which is to be expected as that is the number of rows that we specifiy in the repeat control. Thats fine ... but....

It seems the dataModel.getRowCount returns 246 documents - even although there are 500+ there. I believe (not confirmed -Wei mentioned this in my blog a while back a while ago that he was having a similar issue) that there is some sort of buffering going on - this could be stopping the processing past this number. Is there a way around this? Is there a better way?

The javax.faces.model.DataModel class is a standard JSF class with methods for things like getRowData() and setRowIndex() which allow you to traverse the structure and seem ideal for this sort of task. Of course if it IS buffering then I am sort of stuck and its workaround time...

One simple idea to get around this could be to to pass in the exact same Full Text Search String that is present for the repeat control. Then I would write a method that runs a second full text search and then process that data. I did something similar a while ago for XDesk on OpenNTF  with its excel export (as we are basically doing a double hit - one to display the data in the repeat from and then again another to export it). It is a full text search so performs well though....but not "optimal" - hate the idea of doing a double hit.

Any ideas on the dataModel class or a different approach would be welcome!

Sure an efficient approach that runs as an OSGI plugin to be shared over all your apps would benefit everyone!

Relational XPages access for Hybrid Application access

Chris Connor  April 19 2012 03:39:11 AM
Reaching out to the community as I am looking to canvass opinion on the best options for a project I am considering. Preference of technology is XPages. This fits with my clients ambitions and skills although they have some experience in Spring MVC and Websphere Portal (options that I can help with too).

Keen on the idea of a hybrid option with XPages. By that I mean

NSF / Domino
1. Workflow support (using standard Java OSGI libraries we have developed)
2. Rapid Application Development
3. Flexible Data Storage for Forms type processes
4. Built in Domino Data / Security

RDBMS
1. Best for storing transactional type data
2. Good for storing / working with data that relies on relationships
3. Good at handling large volumes of data

To me a hybrid model with XPages makes sense.For this piece I see there being a few options

1. Use the new Extension Library tools made available via the extension library
2. Use JDBC to process the data (not great option - memory leaks, boilerplate code etc)
3. Explore the use of Hibernate (not really a "supported" configuration)

Reporting being a key part of this can be handled over NSF and / or RDBMS with the traditional "servlet" type approach in XPages, Spring MVC or Websphere Portal. This means pushing the output to Excel / PDF.

Or do we look at another platform? Spring MVC / Websphere Portal (the technologies of choice).

Appreciate your thoughts / comments and experiences!

Open Source / Free CMS and Commerce Engine

Chris Connor  April 18 2012 03:48:16 AM
Firstly apologies for the silence - usual consultant thing of being very busy hence no time - that is no excuse though...

Been doing a lot of varied work recently on top of the usual XPages stuff. WebSphere Portal, Spring / Hibernate, Spring MVC stuff. Hope to incorporate that into this blog soon.

Anyway...

Thought I would throw out a request to see if anyone could recommend or point towards a free open source CMS / shopping cart type application - preferably built on the Java platform (although open to ideas on that too).

Really aimed at delivering a low cost solution that is easily "tweaked" for a small business selling medical products. Sorry have nothing more specific - all ideas welcome!

LS12 Slides for SHOW111 - How YOU deliver mobile applications the easy way with XPages Web Apps

Chris Connor  January 23 2012 07:17:08 AM
Again thanks to everyone who attended the session. Really pleased with the great feedback so far.

The following link is link to the slides from the presentation. Will be developing and contributing the Blog Reader App to OpenNTF in the coming weeks so look out!

Link to Presentation

Link zip of associated files

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!