xPages Workshop at Workflow Studios, Dallas, May 20th

Workflow Studios
is sponsoring a special FREE workshop
on developing IBM Lotus Domino web applications using XPages on May 20th
in their Dallas office. It is going to be based around the ‘Learning XPages
blog series that I wrote and who better to give the workshop then the person
who wrote it..

That’s right, I’ll be in Dallas as a
special guest of Workflow Studios to give the workshop and I’m really looking
forward to it. While I won’t be able to cover every single detail we will
be following along the ‘Learning XPages’ tutorial as closely as possible
with a couple of extras thrown in that I have learnt since writing the
blog series.

So if your in the Dallas area and want
to learn about XPages then please join us. Registration
is still open.

Tagged with: ,
Posted in None

Is OpenNTF In Danger Of Jumping The Shark

Back in January at Lotusphere there was
a huge cheer when, during the opening general session, it was announced
that IBM would be providing some resources to and partnering with OpenNTF.
It is something that many in the notes community, especially those who
have active projects on OpenNTF have been vocal about in the past and the
announcement looked like IBM were going to listen to what the people wanted
and help out.

Todays announcement
and OpenNTF redesign, however, makes me feel that OpenNTF has lost some
of it’s roots and is dangerously close to heading in the wrong direction
and alienating the very developers that made it successful.

I like the idea of the catalog of high
quality applications but right now it just contains IBM projects. There
are plenty of other OpenNTF projects that deserved to be in the catalog
from day one including, but not limited to, the OpenNTF Mail Experience,
!!HELP!!, Vacation Requests, OpenLog and even my own BlogSphere project.
Right now all I am seeing is self promotion of IBM projects. This is something
that needs to be rectified quickly before people visiting the site just
see if as a repository for IBM sanctioned templates.

And what exactly is OpenNTF all about,
well in my mind the main reason for OpenNTF are the different projects
but they seem to have taken a back seat to the catalog, yes there are plenty
of ‘half finished’ projects in there, they need to be weeded out but definitely
not forgotten about. Some of those projects contain some great code that
could help somebody out. The active projects need to be brought back out
to the homepage for the site, not just the list of catalog items. These
are the guts of OpenNTF and the projects are what made OpenNTF work. Hopefully
somebody somewhere is working on a redesign of this area and will incorporate
all the ideas that have been mentioned in the IdeaJam area.

My biggest issue however is the red
tape that has sprung up. If I want to ‘commit’ new code for something like
BlogSphere I’m first going to have to get written consent
from my employer. If anybody out there wants to contribute some code for
Blogsphere to me then I’m going to have to do my own due diligence to make
sure that your authorized by your employer to submit the code and that
you in fact own the code your submitting to me. I know this is all cover
your backside sort of stuff but this sort of change should have been discussed
with ALL the current project owners on OpenNTF.

And lets not forget the license, No
more using any license other the Apache Public License V2 except with express
permission of the new steering committee. Not not all open source licenses
are the same. Did you know that under the Apache V2 license anybody can
take your code from OpenNTF, make modifications and then patent their changes
and sell the modified code as part of their products as long as they include
the attributions and original license document, whereas GPL or LGPL states
that they can only distribute the modified work if the distribution is
also a GPL’d or LGPL’d. My take on this is that by forcing the Apache license
IBM can then selectively include certain templates from OpenNTF in the
next release of Notes/Domino if they meet certain standards. How would
you feel if a business partner redistributed the top 50 projects on OpenNTF
as ‘The New Nifty Fifty’ and made a profit on it. Is this something that
project managers would like to see happen? IS the restriction of the Open
Source license to APL V2 a good thing or a bad thing?

OpenNTF has been a great resource since
it’s conception, From it’s humble beginnings as NotesOSS with a single
project based on the mail template till today, OpenNTF has attracted some
brilliant ideas and developers but all this could easily be lost if the
new steering committee is not careful.

So I have one message to the members
of the new steering committee… Don’t forget who OpenNTF is for and what
it’s original purpose was. You are in a position of trust and you can either
steer the site back onto a path of collaborative development or you can
steer it over the edge of a cliff into obscurity and red tape. A group
of 10 people in a steering committee does not make a website, it’s the
users of the site that make the difference.

————-

And to any commenter who wants to say
that if I don’t like the changes I could just pull my projects from the
site, I say this… Yes I could and who knows it might have to come to
that, but there is a committee of 10 people, many of whom will see this
blog entry and with luck many of them will read it, take the concerns on
board and rectify what they can and get things back on track before they
lose the heart of the developer community. I can only hope the steering
committee are in this for the right reason and not just so they can advertise
their corporate logos at the bottom on the OpenNTF website.

Tagged with:
Posted in None

Advanced XPages : Creating a custom ‘No Documents Found’ message

In traditional domino web development when
you add a view to a webpage and there are no documents you would end up
with a standard ‘No Documents Found’ message. In many cases as a developer
you would would then apply a number of hacks to either replace or control the look and feel
of this message.

In XPages we now have the concept of
view panels or repeats to list all the documents in a view and for the
most time you will use these types of controls with a pager control to
allow the user of your application to go back and forth through different
pages in the view.  This is a vast improvement on traditional domino
web development but it does bring up one new issue, what if the view has
no documents, do you even want the pager to display?  In the phonebook
application I created for the Learning XPages series my pager had a ‘Page
1 of x’ section, on a view with no documents that appears as ‘Page 1 of
0’ which is just wrong so I wanted to hide the pager and instead display
a friendly message to the user.

To hide the pager I needed to set it’s
rendered’ property to a computed value. I decided to look at the row count
for the repeat that I was using on the page and check to see if it was
zero. If it was zero then I would hide the page and if not then I would
show the pager. I decided to use the row count for the repeat control instead
of the row count for the data source because if you are using filters on
the data source then the row count for the repeat control is the number
of rows AFTER the filter is applied whereas the row count for the data
source is the number of rows BEFORE the filter is applied.

Here’s the code that I used for the
pagers render script in a simplified/expanded form :

var testValue
= getComponent("itemListRepeat");
if (testValue.getRowCount() == 0 ){
       return false;
} else{
       return true;
}

If you want to create a customized message
to display to the end user you can simply create a new panel control that
contains your message and apply the exact same rendered formula expect
switch the true and false statements. You can also apply a special styleclass
to the new panel to help make it stand out. If your using the oneUI you
could use ‘lotusMessage’ to make it look like this :

A picture named M2

One interesting thing that I found is
that you can hide the panel containing the repeat control using the exact
same formula. Even though the repeat control is inside the panel that your
hiding it’s row count is available to check before the page is rendered.
I’m not sure if this is intentional or not so if you do hide the entire
repeat panel as well any pagers linked the repeat make sure you test this
in future versions.

Tagged with: , ,
Posted in None

Advanced XPages : Extending the sessionScope to store a hashmap

I’ve been busy working away on a new XPages
application in work that implements a typical shopping cart like you might
find on Amazon or other online retail websites. When I started planning
the application I hit upon the idea of storing the items that the user
had added to the shopping cart into a variable in the sessionScope. The
sessionScope, in xPages, is an area of memory that you can store values
for use by server side javascript in your application. Each user who logs
into the application has their own sessionScope as opposed to the applicationScope
that is shared across all users of the xPages application. My idea was
that by using the session scope I wouldn’t have to create any temporary
backend documents to store the selected items.

Normally you put stuff into the sessionScope
using the ‘put’ method, for example sessionScope.put("userFirstName","Declan").
You can also write this in shorthand as sessionScope.userFirstName = "Declan".
To get stuff out of the sessionScope you use the get method, for example
sessionScope.get("userFirstName") or in shorthand sessionScope.userFirstName

In javascript you can store anything
inside a variable including another object. Based on the ‘Namespacing
Scoped Variables
‘ blog entry by Tim Tripcony I figured that
I’d be able to use my sessionScope to store an array of Unique ID’s and
their quantities. After talking with Tim about the idea he suggested that
I put a hashmap object into my variable in the sessionScope.

To initialize the variable I’m using
the following line of code.

sessionScope.cartItems
= (sessionScope.cartItems || new java.util.HashMap());

This sets the sessionScope.cartItems
to be equal to itself so that I don’t accidentally clear it’s value, however
if sessionScope.cartItems does not exist yet then the second half of the
statement is carried out which created the HashMap object in the sessionScope.

Now that I have a hashmap inside the
sessionScope I can use all the methods on it as I would the sessionScope

var thisDocID
= currentDocument.getDocument().getUniversalID();
var thisQuantity = getComponent("comboBox1").getValue();
sessionScope.cartItems.put(thisDocID,thisQuantity)

By using the UNID as the key I can easily
relate the item in the cart back to the item documents in my notes database.
I can even use a repeat control bound to sessionScope.cartItems.keySet();
loop through all the items in the shopping cart. I could use sessionScope.cartItems.size();
to find out how many items are in the shopping cart and even sessionScope.cartItems.clear();
to empty the cart out.

Hopefully knowing that you can store
different types of objects in the sessionScope will give you some ideas
for your own applications.

Tagged with: , , , ,
Posted in None
Archives