Sharing new technologies and best practices

 
alt

Chris Connor

 
Follow ChrisJConnor on Twitter
Chat with me

Plugin Development with Java UI Classes

Chris Connor  May 21 2012 08:19:42 AM
Been working on an eclipse plugin which extends the right click menu. The idea is that it sends (creates) a bookmark type document in a central XPages "Knowledge base" database based upon the selected document.

So the user right clicks to select a document and chooses the "Bookmark" option below

Image:Plugin Development with Java UI Classes
Which provides this dialog

Image:Plugin Development with Java UI Classes

The bookmark document contains simply

1. A subject describing the document
2. A Tag for the document (category)
3. A "Notes URL" link to take the user to the source document

The idea is that people can then search the knowledge base using the tags etc and then open the source document for more info.

So this works on the basis that the URL is built from the selected document (this is where the issue lies... It is running a piece of code that does

NotesUIWorkspace ws = new NotesUIWorkspace();
NotesUIElement elem = ws.getCurrentElement();

Now - if I run the process direct from the Eclipse "Run Configuration" it works fine. If I build the plugin and then install it some strange behaviour can be observed in that "elem" sometimes returns null when run from a view on "Selected Documents".

Note it always returns a valid value if ran on an open document in the Notes UI (ie from the document through the form).  

It sometimes resolves itself to return a correct value (sometimes on subsequent runs, sometimes requires you to open a document and run it THEN try it on a view / document).

Its fairly intermittent and extremely frustrating!

Anyone had any experience / knowledge of this?
Comments
No Comments Found

About Me

Java / Web Development consultant with 17 years experience. Focus on XPages, Java / JSF / J2EE, Websphere Portal, Spring / Hibernate, RCP, jQuery, Dojo, RCP, Eclipse, RAD, Phonegap and general Mobile development. Experienced public speaker at several global events.

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