My name is Sean and I like Twitter.

It has taken a long time for me to become a convert to Twitter but three examples in the last few days have shown me how powerful it is.

1) Suppliers on Twitter
Our web site went down. The nameservers were not reachable and the supplier Dotster.com had no error messages on its status board. Its ticket system was also down

Searching for Dotster on Twitter quickly showed that many other people were having the same problem and that Dotster had an active twitter account. I was able to report the problem via twitter and Dotster was able to update me when the system was fixed.

2) Nokia N97 Lens Scratch
I was really looking forward to getting a Nokia N97 but needed more information on its voip capability and some reported design faults that create lens scratches. Googling these problems, especially the voip one, brought up loads of waffling dated posts whereas searching on Twitter brought up some excellent links that allowed me to make an informed decision to wait a while.

Why were the twitter links more useful than google – 2 things – they were recent and they were concise

3) The Notes community and help for Xpages
I am very concious of not wanting to over do this one but on a couple of occasions after banging my head against a wall for some time I have asked about a problem on Twitter and got some really good help about this new technology – it is also great to leave a search on “xpages” running in tweetdeck and watch stuff as it comes up.

So why did it take me so long to try Twitter ?  Well I thought it would be a real distraction and I thought that everyone would be posting lots – the truth is that some people post lots ( and I mean lots Bruce ) and some hardly post at all, there seem to be very few that post an average amount ( I guess that should be median amount). If you are not on Twitter get yourself on and post as much or as little as you want – I tend to be a voyeur more than a poster but no-one minds.

And the downside ? Just my inclination to want to rant – it is very tempting when DDE crashes but hopefully that won’t happen too much ( the ranting I mean, the DDE bit is too much to hope for just now – see I’m doing it again ! ).

Should you be trying Xpages ?

Let me start by saying that Xpages is really cool and very powerful. It has absolutely captured the enthusiasm of the Lotus developers Community ( don’t worry admins you have DAOS ) and it has great potential.

But… should you start using it YET ?

The key word is yet. I have two hats on, the first is a geek and the second is a professional Notes developer. The geek in me loves to play with new stuff while the professional developer is responsible for robust code delivered on time and to cost.

If you are wearing a geek hat I would highly recommend that you “play” with xpages

If you are a professional developer charged with exploring new options or quantifying the risks of using new options then the answer would also be to try it.

If you are professional developer responsible for delivery of work on tight time scales and to tight costs then I would urge caution. While the geek in me loves Xpages the development process is fraught with bugs and the trials of being an early adopter. In my opinion DDE 8.5.0 is not a suitable tool for working to tight times and costs – it is too buggy. I am hopeful that 8.5.1 will be better but I have no information on that.

I would also say that if you are a customer of a development shop ( mine included ) you should make sure that it is very clear who pays for lost time through platform bugs and difficulties. Individual developers should also be careful what they promise to their bosses !

Will I continue to use it ? – absolutely – but only on internal projects at this time. I am also increasingly grateful for the gifted early adopters out there who are easing the way with blogs articles and examples.

Just my thoughts from the coal face, Sean

Resolving corruption of custom controls when they are renamed ( 8.5.0 )

Warning : this is a case of the blind leading the blind

UPDATE : Declans blog explains that you need to use F2 to change the element name

http://www.qtzar.com/blogs/qtzar.nsf/d6plinks/DSLH-7PNK26

Quite possibly ignore the rest of this !

When you rename a custom control such as the prtView in xpages you will get error messages such as “NotesException: A required argument has not been provided ” in the browser if you have debug enabled ( if not go find out what it is ) or “The unknown tag xc:xxc cannot be used as a control”

Image:Resolving corruption of custom controls when they are renamed ( 8.5.0 )

The problem is that when DDE renames the main design element it does not rename all of the attributes in the background.

You can fix this by using the eclipse navigator to make the changes in the back end manually

Image:Resolving corruption of custom controls when they are renamed ( 8.5.0 )

Image:Resolving corruption of custom controls when they are renamed ( 8.5.0 )

Image:Resolving corruption of custom controls when they are renamed ( 8.5.0 )

Its good to stop and look back at your projects and see your creative side

Back in 2000 I went from being an industrial Engineer to running my own small company providing Notes / Domino solutions to other Engineers. I was very lucky and found something that I was good at, enjoyed a lot and which people wanted to pay for.

Over the last nine years I ( and my colleagues ) have gone from exciting project to exciting project without paying too much attention to business development or for that matter taking enough time to look back at the things we have achieved and the applications that we have written.

With the economic slow down I have had to put some ( much overdue ) structured effort into this business development thing and part of that has been to produce some case studies and get quotes from customers. This has been quite refreshing.

When you actually sit sown and write about what you have done, the impact that it has had on customers and then add their quotes you can’t help but feel uplifted about your work.

I would not have considered myself a creative person in an artistic sense ( apart from my spelling ) but when you look at what we developers do it is very creative. We typically take existing paper systems and mould them into something which works much better – not an electronic version of a paper system but something engineered from the ground up that takes the best of the paper system, the best of what IT brings and the chance to improve over the previous iterations using the experience of the users and our knowledge as consultants.

Looking back also reminds me of what a fantastic platform Notes / Domino is and how far it has come in 9 years. I still remember the WOW factor when I fist saw the same content on a Notes form and Internet Explorer at the same time. I still remember the first time I used an outline and an embedded view. I still have conversations with developers of other platforms where they are amazed at the simplicity of the Notes “Hide When” property or the security model.

That’s not to say that Notes is perfect, I still would like to see version control of code, easier dubugging of  Xpages ( I know its getting better all the time ), dxl round tripping etc.. but when you look at what you can achieve with it in terms of solid business systems it is a very powerful platform for the right types of applications.

My favourite case study

Some Quotes

Sean
 

Fusion Charts tips ( including xPages )

During a recent Proof of Concept with XPages I was struggling to get fusion charts to work with Xpages so I thought I should write down what I learned. To be honest there is really only one tip that is specific to Xpages but the Fusion Charts bits was useful learning for me.

Fusion Charts is a flash based system that lets you easily create charts, dashboards etc… There is a free version and a paid for version. There are also several other competitors to this and I would be interested to hear how others have found them.

Image:Fusion Charts tips ( including xPages )

There is a demo database here, this can also be downloaded. Xpages it requires 8.5x to run. The help in the Fusion download is also excellent.

Fusion Charts – how do they work ?

There are two things that you need to think about.

1) the html which positions the chart and loads it

The preferred means of adding the chart to your page is to use Javascript embedding. This will make sure that the graph fires up straight away in Internet Explorer. To do this I added the following code to my xpages. In this case it works fine but in another case later adding html directly to the Xpage source didn’t work so well and Matt White suggested I should use a computed field.

The code code references a js library that I imported into the javascript libraries and a swf which I imported as a file resource.

Image:Fusion Charts tips ( including xPages )

2) the data source for the chart

There are two ways that Fusion Charts can reference data. The first is to use a separate xml file and the second is to use the “dataxml” method where the data is captured within the html code on the form.  

I initially went for the dataxml method but then abandoned this and went for external xml files. The following section shows the different methods that I developed and the pros and cons of each

Method 1 – embedding the data on the form using the dataxml approch

http://www.seancull.co.uk/Public/Examples/SC/XPages_C.nsf/using_data_xml_method_hard_coded.xsp

I pasted the html from the example onto the Xpage thinking that I could generate the XML as the page was rendered.

Xpages tip >>>> The problem here was that to deal with the parameters within the html string I converted them to single quotes and Domino converted them back to double quotes – breaking the code. Matt White suggested that I should build the HTML in a computed field ( which I would have had to do later on anyway ) – this cured the problem and the graph worked.

Image:Fusion Charts tips ( including xPages )

What put me off this method was two things.1) constructing the html looked like it would be difficult  to do and worse still it would be difficult to debug   2) there is a warning in fusion documentation that browsers will truncate the data if there is too much

Image:Fusion Charts tips ( including xPages )

Image:Fusion Charts tips ( including xPages )

Method 2 – using an existing xml file in the file resources

http://www.seancull.co.uk/Public/Examples/SC/XPages_C.nsf/using_hard_coded_file_resource.xsp

This worked well but you either need to have pre-imported the file resource or used DXL to have created one programmatically

Note that you need to reference the resource as data.xml?OpenFileResource  rather than data.xml because Fusion charts adds a random parameter to prevent caching so your url becomes data.xml?OpenFileResource&curr=120

Method 3 – Using a web agent to provide the XML on the fly using lists

http://www.seancull.co.uk/Public/Examples/SC/XPages_C.nsf/using_dynamic_agent.xsp

I was concerned that there might be an issue of “lock-up” if the same server was serving the xpage and the xml feed to power the chart but it seems to be ok although I have not done any stress testing.

The agent uses view entries on a categorised view. The category names and totals are added to a list which is then converted to XML. Although using lists is clean and simple it does mean that the order fo the bars on the chart will be alphabetical because that is how the list sorts – this would not work well for graphs by month for example

Note that you need to reference the resource as agentname?OpenAgent  rather than agentname because Fusion charts adds a random parameter to prevent caching so your url becomes agentname?OpenAgent&curr=121

Image:Fusion Charts tips ( including xPages )

Method 4 – Using a web agent to provide the XML on the fly using arrays

http://www.seancull.co.uk/Public/Examples/SC/XPages_C.nsf/using_dynamic_agent_3d.xsp

This method has the advantage that you can do muilti series graphs and the order of the bars will be as per the order in the view ( which you can manipulate easily using sorts in the column )

Note that you need to reference the resource as agentname?OpenAgent  rather than agentname because Fusion charts adds a random parameter to prevent caching so your url becomes agentname?OpenAgent&curr=121

Image:Fusion Charts tips ( including xPages )

Method 5 – Using XML stored on a Notes Document

http://www.seancull.co.uk/Public/Examples/SC/XPages_C.nsf/using_xml_stored_on_a_form.xsp

This builds on method 2 but has the advantage that you can programmatically create a docume
nt easier than a file resource.

Note that you need to change the html properties of the form and call it using ?opendocument as described above

Image:Fusion Charts tips ( including xPages )

Conclusions and queries

1) Free Fusion Charts looks promising and the paid for version has additional functionality including dashboard widgets

2) For complex graphs I would definitely recommend storing the pre-generating the xml on a scheduled basis. I would probably then store that straight into a Notes document as per method 5 above

3) I cant help but feel that there must be an easier way of getting the data out of a categorsied view and into XML. I would imagine that it can be done using XML transform tools but its not an area I am really strong in. I looked at RVEX on Openntf but couldn’t get it to work

4) It would be interesting to know if any of the other charting products could work easily with a javascript array as this could be built up on the xPage using javascript

5) In production I would  build the charts on Custom Controls rather than straight onto the xPage

As ever, please feel free to suggest any improvements ( other than spelling )

Cheers, Sean

web_agent_arrays_method_4.lss
web_agent_lists_method_3.lss
XPages_C.nsf