Using Greasemonkey for Forum Friday

I read Declans post on Forum Friday as an addition to Show-and-Tell-Thursday and I think it’s a good idea. There was some discussion about a similar idea (Question Wedneyday) at the blogger BOF. If I’m to respond to posts in the Notes 8 forum (my primary focus) I want a nicer default footer.

I’m already using a Greasemonkey script I blogged about a while back for the LDD6/7 forum. Unfortunately there’s a difference between the HTML markup between the Notes 6/7 forum and the Notes 8 forum so the Greasemonkey script needs to take this into account.

Here’s the updated script (updates in bold):

// ==UserScript==
// @name          Notes/Domino 6/7/8 Forum Signature
// @namespace     http://lekkimworld.com/greasemonkey/ldd_signature
// @description	  Inserts my LDD Forum signature
// @include       http*://www-10.lotus.com/ldd/nd6forum.nsf/*?OpenForm*
// @include       http*://www-10.lotus.com/ldd/nd8forum.nsf/*?OpenForm*
// ==/UserScript==

// get elements
var e_subject = document.getElementById("Subject");
var e_body = document.getElementById("Body");

// handle Notes 8 forum
if (null == e_subject) {
	e_subject = document.forms[0].elements[1];
	e_body = document.forms[0].elements[2];
	e_body.style.fontFamily = "Verdana";
	e_body.style.fontSize = "11px";
}

// compose signature
var signature = "nn/Mikkel HeisterbergnVisit my Notes/Domino blog " +
    "@ http://lekkimworld.comnfor posts on Notes, Domino, Sametime " +
    "and how to use Java in Notes/Domino...";

// set signature
e_body.value = signature;

// set focus
if (e_subject.value == "") {
   e_subject.focus();
} else {
   e_body.focus();
   e_body.setSelectionRange(0, 0);
}

Feel free to copy the script and modify to your liking. Installation guide is in my previous post.

Caveat when converting an Eclipse Java project to a plug-in project

Based on some advise I got in the “Meet the Developers” lab at Lotusphere I converted a Java project to a plug-in project in Eclipse today. This will make it easier to manage my dependencies instead of manually having to export the model classes as a jar and including that. I tried it before but it didn’t work. Today I found out why.

The conversion via right-clicking and choosing “Convert Projects to Plug-in Projects” (in the “PDE Tools” section) went fine but afterwards the classes from the plug-in wasn’t found by my sidebar plug-in in Notes 8. Compilation in Eclipse went fine.

The issues turned out to be caused by Eclipse not automatically adding the compiled classes to the plug-in. To solve this I had to open the manifest (MANIFEST.MF), switch to the “Build” tab and in the “Runtime Information” section add a library named “.” (yes a period) on the top left and the source code folder I wanted to include on the top right.

Once I did that everything went smoothly.

Lotusphere 2008: Kick ass appdev info!

Besides being in the showcase today I went to the “Meet the developers” lab today and spent the better part of 2 hours in there talking to various developers on the Sametime Connect client team and Sametime server team. Special thanks to Jessica Ramirez from the Connect client team for taking the time.

Besides getting some invaluable help with my own sidebar component I got exactly the info I needed on how to send richtext through the Sametime Java API – it’s not straight forward, not documented and not something you figure out on your own. Suffice to say it includes knowing the right hex codes and correct data structures. Jessica actually brought up the actual source code of the Sametime Connect client to show how it’s done!

What’s an important lesson from this that if you need some piece of information go and ask!