Sharing new technologies with the community

 
alt

Chris Connor

 
Follow ChrisJConnor on Twitter
Chat with me

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

LS12 Slides for BP118 - Using Java to build applications fit for the enterprise

Chris Connor  January 23 2012 06:23:53 AM
Guys thanks for the great feedback on my session - the following link contains the presentation files for your information.

Will be upgrading and publishing the library files in this application onto OpenNTF in the coming weeks. I will also post the instructions on creating and working with OSGI libraries as discussed in my session.

Link to Presentation

Day 1 Lotusphere - Business Development Day

Chris Connor  January 15 2012 07:01:38 AM
Long day yesterday travelling from Glasgow via Dublin to Orlando - pretty smooth to be honest. The "new" immigration process conducted in Dublin meant that when I landed it was straight through to pick up bags - almost like an internal flight!

Anyway "settled in" yesterday evening well. Great evening (although jet lag took its toll) I attempted to soldier on through to around midnight.

Looking forward to the announcements and sessions of the next few days. Will be doing last minute prep around my two sessions if you are interested in attending.

Wed 10:30 - 12:15
SHOW111 - How you deliver Mobile Applications the easy way with XPages and Web apps.
Will walk you through how to build both a 100% web app with the extension library and a hybrid app with PhoneGap.

Thursday 8:30 - 9:30
BP118 - Using Java to build Applications Fit for the enterprise
Will discuss and demonstrate how Java helps provide a scalable platform for developing your XPages applications.



Resource Reservations advice - Wrestling with free time

Chris Connor  December 14 2011 03:57:10 AM

Writing a booking front end using the extension library - the UI works really well and supports browser events for creation, deletion, moving etc.

The issue is "wrestling with free time". Not a lot of good information out there in terms of setting the various field values. In essence I am mailing a document to the room that is setup in the database. I then use the events to save updates / delete to the booking as required. This works well other than.....

The emails that are generated are not very configurable - infact the one on creation of the booking that is sent to the chair gives an error on opening the mail message - I think it is expecting to open a reservation in the actual mailfile instead of the resource reservation database.

Might be easiest to switch the mailing aspect of this off (I still want it to be "reserved" by the free time engine).

Been hunting around in the dark - anyone got any thoughts or advice?


Speaking at LS12 - my first Lotusphere session

Chris Connor  December 6 2011 06:52:35 AM
Delighted to say that I will be presenting two sessions at this years Lotusphere after having attended 3 others in "read only mode". Bit nervous but very excited. It follows several months working up to this point putting in sessions in European LUGs (Denmark and UK) and also other local events in the UK.

Going to be a lot of work between now and the 20th but hopefully it will be rewarding for me and more importantly for those who attend!

Flights need to be booked (probably Aer Lingus - do I ever learn anything from last year?), the ESTA (or whatever they are called - the forms that allow me into the country) need to be completed and a new pair of  (industrial strength) drinking shoes need to be bought. The must be capable of propping me up at various bars for the whole week.

Oh yeah - before I forget the subjects are

1. XPages and Java - focussed around why I have used it and how it really benefits me in doing my job for clients
2. XPages and Mobile Web Applications

Themes that I have been running with for the year and plan to develop further for LS12 and beyond.

Looking forward to meeting the folks lucky enough to attend this year. Also look forward to the news and general interweb chatter that kicks off around the event too!

Turbo Charging your Legacy Notes apps with XPages relational access

Chris Connor  October 14 2011 06:30:45 AM
Now that we have our 8.5.3 environments ready thoughts turn to how do we use XPages to build better applications with the new tools available. I have been involved in a few situations lately where organisations are reviewing their application estate and asking how do we approach "modernising" them. The first cry from everyone is usually "XPages" but quite rightly IT departments are asking what is the best platform for THAT particular application in OUR organisation with OUR current skills. When reviewing the application estate the feedback has generally come back in the form of:-

1. Application works well - needs extending via a "web app" to browser or mobile.
2. Application needs to integrate into our Portal, Intranet, be made available on public Website etc.
3. Application functions badly due to the way it was deployed on the older Notes client

All of the above can be addressed by putting together an XPages "front end" or as in case 3 by rewriting the application to work better with XPages (dojo, jquery, modern web ui tools).

There are however a large number of applications (I am sure we have all seen them) that have underlying problems with the architecture. This usually comes down to two issues

1. Sheer numbers of documents.
2. Complex structure of relationships between data / documents.

I am thinking the huge timesheets database, enormous CRMs with huge numbers of documents and relationships with visits, callbacks etc etc.. Again we have all seen them....

This usually manifests itself in performance issues, applications that are difficult to change and maintain and even more difficult to leverage good reports from. We then see loads of views, loads of categorisation, lots of bloat / index issues, server struggling when a view is rebuilt, requests for reports where information is captured but stupid methods have to be employed to get it ...etc.. etc.

This is where the new XPages Relational Database Access tools come in. Now we can...

1. Use Domino security (readers fields, authors fields, acls) - these are easy to configure and change using the same methods that are in current support / operation with developers and the admin team.
2. Use Domino workflow eg a "main document " could have "related records" that are stored in a relational db somewhere and called for display at the appropriate point.
3. Get better reporting (always a pain as already mentioned). You can use standard reporting tools (Crystal reports etc) for building reports and even delegate more to business users.
4. Handle better volumes of "record" type data.
5. Kick off transactional processes that are in other systems (as well as your own table structure)
6. Build powerful database searches that incorporate a combination of Full Text and SQL queries.

Of course with all of that we can leverage the full benefits of a JSF based Java Web application server built around dojo UI components for cross platform mobile and web applications.

The opportunities are endless. We now have a true web application server and with XWork and further developments in the pipeline I am looking forward to LS12!

Anyone else able to share their own stories around this?

Oh yes - before I forget go to OpenNTF and download the Extension Library and install on 8.5.3. There is good visual material there to help you on your way!

Web Enabled Resource Reservations

Chris Connor  October 10 2011 09:55:30 AM
Currently evaluating some options around providing a custom web interface for Resource Reservations for booking rooms. The requirement also needs to build in some custom workflow / approval processes to provide for overriding bookings. Ideally I am looking for a nice Web user interface that is

1. Nice (Web 2.0 - I hate that expression) modern web experience
2. Works well on mobile devices
3. Built on XPages

Ideally I would like this to be based around dojo - although there is nothing I could find at this stage. I know there would not be too much effort to do this around jQuery as there are a plethora of nice looking calendar tools that use Web Services / XML / JSON or whatever for pushing data backwards and forwards. Paul Withers is also advised on some interesting stuff (from part of his stuff on the new XPages extension library book) from the extension library which takes the iNotes interface and makes it more available via xpages and web services. It has built in controls for events for creating entries, rescheduling etc - so looks interesting.... (Paul bribed sorry asked if I would reference the Excellent Extension Library Book - coming soon on amazon).

Another developer Toby Samples took the jQuery approach using "Full Calendar" - that also looks interesting. There has also been some work on the 8.5.3 template which I have yet to look through. I suspect though that the UI / customisation requirements may exclude that option....  

Anyone else doing anything similar out there?

About Me

Notes / Domino consultant with 15 years experience. Focus on XPages, Java / JSF, RCP, jQuery, Dojo, Mobile development to add to traditional Notes / Domino, HTML, CSS and Javascript skills.

My day job is building Web 2.0 Social business applications for my customers. 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 Lotus Business Partner based in Scotland serving the UK and beyond!