Character encoding in an Ajax LotusScript agent

I know it’s Monday, but I thought I’d share this with you anyway.

So, most people know that you can control the content-type in an agent called by an Ajax request (or any type of agent for that matter) by using this line:

print |content-type: text/plain|

which will result in plain text being sento to the browser, of course you can also send HTML, XML, JSON or any other content type that you so choose.

What you may not have known is that you can also control the charset property of the response. Why would you want to do this? Well if you have an agent that returns high number Ascii characters such as é or ö then by default they will be returned to the Ajax request as non-printing characters. But if you use this line in your agent then they will be transferred to your browser correctly:

print |content-type: text/plain; charset=utf-8|

So my recommendation is that for every agent that you write where you would have just set the content-type, just take that extra few seconds to define the character set as well to save yourself trouble down the line.

You may well take from this, that I have just been burned by this very issue, and you may well be correct. Did I mention that version 1.3 of IdeaJam will be released very shortly 😉

UKLUG Conference Evaluation

At the end of UKLUG this year, Warren mentioned that we’d send out the conference evaluation. Well it’s just gone live today. So if you came to UKLUG, or if you registered but didn’t attend, we want your feedback. It’s really important that we get the views of as many people as possible so that we can make next year’s UKLUG bigger and better than ever. So have your say.

What does your work environment look like?

Paul, Bruce and Jamie have posted photos of their home offices. I can’t believe how organised they all are. I suspect there may have been some frenzied tidying before they snapped the pictures 😉

Well these are a couple of photos of my desk as it it this morning (no tidying, sorry Mum!)…
My Desk
I work in my living room (the downside of being in a flat). And like Jamie the majority of the money I have spent on office type things was on the chair. When you’re sat down for 10+ hours a day it’s well worth investing in something comfortable.
My Desk
Like the opthers, I’ve got two screens, but for me, it’s two laptops. The main Macbook Pro is sat on a Griffin laptop stand, and that’s the work machine. Then the Macbook deals with music, podcasts, Skype and chat clients. It all works rather well to be honest. If I could change anything it would be to get a 23″ screen to plug the MBP into, but that’s for when I win the lottery!

Need help with your Domino development?

This is unashamed marketing, so if you already know that I’m an independent developer please ignore!

I was chatting with a friend over the weekend who wasn’t really aware that I’m an independent developer and so it occurred to me that you might not either!

Basically, for the last eight years I’ve been a contractor, which here in the UK means you usually have one large client. During that time I often had smaller clients that I worked with as well, but I wasn’t able to commit to really serious projects with them. But as of May this year, I decided that I’d try and switch the focus of my work to be more consulting based, the theory being that I was getting lots of calls from people asking for help on small to medium sized projects that they either couldn’t, or didn’t want to run “in house”.

So, anyway, that’s a rather round-about way of saying that if you need any help with Notes, Domino, Java or web development then please do drop me a line or give me a call (+44 7767 384970) and I’d love to try and help you out. Over the years I’ve built up quite a list of clients, both small and large, my company website tells you a bit more about them.

Continuing XPages Development

After all of the craziness of helping out with UKLUG last week it was back to a good week of development on the new XPages version of IdeaJam.
IdeaJam XPages

I’ve put a few more screenshots up on Flickr but we’re continuing to make good progress. This week we’ve managed to knock off quite a few tasks…

The biggest change is that I’ve added multi lingual support. I suspect that our strategy for IdeaJam won’t match all requirements, but we already have language documents in place for “classic” IdeaJam and I want to re-use as much as I can. So when XPages is loaded for the first time, a server side Javascript function runs which goes and parses the existing languages document and stores each label into a Hashtable in the sessionScope variable. Whenever a page is loaded after that, each label on the XPages and custom controls calls a function which goes and looks up the relevant label from the Hashtable. It seems to work pretty well. As with all of our work so far we haven’t done serious scalability testing on it, I want to get a baseline function set, see where we are and then tune from that point as I am coming from a position where I don’t know what is an “expensive” operation. We are basically creating best practices as we go here so hopefully the session that Bruce and I have submitted for Lotusphere will be able to pull our learnings together!

The other big change this week is the addition of the user profile. This is actually way better than the classic IdeaJam profile as I can effectively embed multiple views onto a single XPage and then just toggle between them with a tabbed panel control (which you can see above). Unfortunately when I was almost done with this earlier in the week, DDE somehow ate the design element and I had to start again, but as with all these things, doing it the second time was much quicker than the first.

Other cool little bits and pieces that we’ve done this week include moving the CSS from being a design element back out to being a document so that our customers can easily change the look and feel of their IdeaJam sites. Again this may not be needed for most sites, but for us it is very important as we want to make administering IdeaJam very, very easy (like it is today). I’ve re-inserted the context sensitivity for RSS feeds, so that the RSS icon knows where you are in the system and presents the right feed to you (I think we have something like 8 different styles of RSS feed in IdeaJam so you can watch what is interesting to you).

And I’m finally getting around to fixing some of the stylesheet issues caused by the move from classic to XPages. In classic we style elements based on their ID which is not really practical in XPages as it is all but impossible to know what the ID of an element will be by the time it makes it to the browser, so all styling has to switch to the class property of elements, not a massive issue, but IE being as crap as it is has caused a few problems. As with all browser issues I follow the rule of develop in Firefox and then break for IE, but in the end it only took a couple of hours to sort out most of the problems.

So where does that leave us? Well I have about 15 big ticket tasks left on the tada list and then we start the really serious task of testing. It’s going to take us quite a while as we want to release a good quality product. Hopefully somewhere in there will be a new drop of 8.5 beta code, but either way we will have to leave our final test cycle until 8.5 goes gold so that we know we have the fixed, non beta, code that customers will be using. Life is very very busy, but good fun.

UKLUG Round up

I’ve been pretty much offline for the last three days due to the UKLUG meeting in London. On Wednesday I went along and helped out stuff the bags and set up what we could and then on Thursday and today a few of us just acted as general dogs-bodies. By all accounts it was a really good couple of days with interesting presentations but most importantly good people to talk to during the breaks for coffee, lunch and beer!

So a little wrap-up is in order I guess. In terms of the speakers we had some great people talking with some of the superstars of the Lotus community speaking like Paul Mooney, Bill Buchan, Rob Novak, Gab Davies, Jamie Magee and many more. But two great things about UKLUG which sets it apart from other events are the incredible number of sponsors (there were 23 who filled the sponsors area, gave really interesting sessions and as far as I could tell spoke to a lot of the people who came along to the event) and also the new speakers, whether they were “case studies” like Cardiff University or new community members like my friend Mark Myers.

I know I’m biased, but I had a really good time over the last couple of days, so I hope that means other people did as well.

There was one important thing which we didn’t do during the closing session and that was to thank Warren properly for all of his work. These big user group events normally need one or two people driving them, ILUG has Paul Mooney and Eileen Fitzgerald, and UKLUG has Warren Elsmore. There are a few of us who help with lifting and carrying around the edges, but really it’s hard to imagine the amount of effort that is required from the figureheads of these events, there’s dealing with the venue, sponsors, speakers and the other organisers (much like herding cats for the latter group I can assure you!). It really is a superhuman effort, over a long period of time. So if you bump into Warren make sure you thank him for his work.

Also Warren mentioned that we will be sending out the conference evalutations soon. For those that didn’t make the closing session, basically we’ll be asking you for your feedback and in return we’ll be putting together as many of the session slides as we can, so please make sure you fill in the evaluation when we send the email out.

Now I really, really need some sleep 🙂

What's your Elguji?

Just in case you’ve missed it, Mr Elgort is running a competition to come up with the best tag line for future Elguji advertising. You may have seen the “If you thought Elguji was…” adverts on various sites on the internet, well now you can add your own creative juices to the mix and maybe even win valuable prizes 🙂

Head on over to the Elguji blog and get your thinking caps on.

Continuing XPages progress and first public demos

Another week of developing IdeaJam in XPages has passed and we’re really making progress.

A lot more behind the scenes coding this week that improved voting, but also the first drafts of the Idea screens in read and edit modes, plus a lot of the supporting screens that are accessed from the header menu. So some screenshots (these are as much a record for me as for the blog as I suspect it will be interesting to look back on how quickly we were able to progress with this stuff in the future):

IdeaJam in XPages Progress
IdeaJam in XPages Progress
IdeaJam in XPages Progress

Both Bruce and I will be doing presentations this week. The boss will be at NEOLUG on Thursday and I will be presenting with a certain Mr Mooney about what’s new in 8.5 at UKLUG in London. It should be interesting, Paul is the veteran expert speaker but he gets all the boring admin content (;-)) while I, as the newbie inexperienced speaker, get to talk about XPages. If you’re coming along to either user group you’ll get to see whatever point we’ve got to in the development. Always good to try and demo *very* alpha level code, come watch as I try to explain the error messages!

In all seriousness, development is progressing very nicely, of course we are encountering issues, but with a combination of workarounds and help from IBM we hope to have a really classy extra string to the IdeaJam bow in the next few months.

If you listened to the new 1352 Report podcast (and if not, why not?) then you may also have noticed that Bruce mentioned a new tool that we plan to have ready in the next few months as well, called TaskJam. There will be a lot more to come on that as we make progress.

Anyway, this week is going to be good fun, if you’re coming along to UKLUG then say hi to me if you see me around.

CoComment Disabled

I heard from Bruce that comments were broken so I’ve disabled CoComment and all seems to be working. Sorry if you posted and lost your comment.

Continuing XPages Progress and some lessons learned

Well we’re now 9 days into the porting of IdeaJam to run in XPages:
IdeaJam in XPages Progress
The screenshot hasn’t changed an enormous amount but you can see that voting is working properly now and I have added the view filtering so that you can look at individual IdeaSpaces. All of those bits were surprisingly easy once I had worked around a couple of bugs. And these are my lessons learned for the week…

Firstly, the new server side @DbLookup() javascript function does not work in conjunction with the @DbName() function if your database is in a sub directory. THis is obviously a bug which will be fixed before 8.5 goes Gold but it took me a while to work out. Anyway, there are two current workarounds, first just work in the root of the server (which is what I’m doing) or you can hard code your database path using the following format: @DbLookup(“xpages//DbLookup.nsf”, “RefData”, “Test”, “Value”).

My second problem took a while longer to track down and I’m sure it’s an edge case but it’s a doozie – I have a custom control which contains a <tr&gr; element that gets repeated in another custom control. What I learned is that you do not set styles on the html element directly, you must assign a class name to the element and define the style in CSS otherwise the Designer client hangs while trying to rebuild the project. It’s a better way of doing things I guess, but I wanted to be lazy!

So those two are the downsides so far, and they’re going to be fixed, but on the upside I have still not written *any* client side javascript myself and I’ve only had to write 2 agents (to handle voting requirements which can’t run under the rights of the authenticated user). That is hugely impressive when compared to the “classic” IdeaJam which can amount to 100kb of Javascript… read big performance improvements for the user. I’ve also managed to reduce the number of views required to run IdeaJam from 15 to 5 due to the different ways that you can apply filtering and reuse views for different tasks… read server side performance improvements.

There is still a lot to do but real progress is being made, and (as Bruce will tell you) I am enjoying this so much that I can be found playing with XPages most of the time now!