Lotus Notes 8 Development

I’m finally finished beating my head against the wall trying to get drag and drop to work in Lotus Notes 8. It turned out to be a good deal less friendly than I expected.

The actual core of drag and drop listening is stock Eclipse RCP. That’ll trigger off the events as expected, but I found that it wasn’t passing anything across. After digging down as far as I could to see if it just wasn’t processing the transfer properly, I concluded that it was a dead end.

The old way of dealing with this would have been to use NotesUIWorkspace to get the currently selected document. That was never implemented in Java (which is probably because it’s not needed). Because of the eclipse architecture, it is strictly possible to access whatever you want using the standard eclipse classes. Thankfully, we don’t even have to worry about going this deep, I stumbled across an open source plug-in called Formul8 by Jeff Gilfelt. Jeff’s plug-in allows you to execute formulas in the context of the currently selected Document(s), which is similar to what I needed.

Under the hood Formul8 is powered by ‘com.ibm.lotuslabs.context’. Armed with that discovery, I headed back to google, finding this post  about how to use ‘lotuslab.context’, in addition, it also links to a copy of the source code (yippee!).

Exploring Documentum RESTful Services – Part 1

I was chatting to Craig Randall on twitter a little while back and he let me know that they were just about ready to go into Early Access for their new web service platform -  Documentum RESTful Services. I was excited then, and I’m even more excited now that I’ve had my first taste.

RESTful web services are hard to explain to people. I usually fall back on explaining them by linking them to Ajax, which is a Web2.0 technology that people are more familiar with. If you wanted to use Ajax to make your Documentum webapps more friendly before Documentum RESTful Services, then you’d be out of luck (short of creating a custom server side component).

RESTful web services are easily accessible because you don’t need any funky client library to access them. Pop open any web browser and type in:

http://localhost:8080/dctm_rest/resources/core/repositories/<RepoName>/folders

And you’ll get back an XML representation of all the root folders (after you’re prompted for a username/password). RESTful web services use only standard HTTP, which means that you’re cutting out the middleman of having to encode requests/responses in Soap (or some other container).

They’re automagically more language agnostic. Gone is the need for a complex client side library. For example, while it should strictly be possible to access DFS in any language, this doesn’t translate into a reality. So Documentum RESTful Services will allow us to step away from relying on Java/.Net and expand into using high level dynamic languages (python, ruby, javascript).

Let’s do a simple example in Ruby to demonstrate:

require 'rubygems'
require 'httparty'

class DctmRest
  include HTTParty
  base_uri 'http://localhost:8080/dctm_rest'
  def initialize(username, password)
    @auth = {:username => username, :password => password}
  end

  def repositories
    options = { :basic_auth => @auth }
    repository = "test_repo"
    self.class.get("/resources/core/repositories.json", options)
  end
end
d = DctmRest.new('username', 'password')
puts d.repositories.inspect

The example is probably more complex than it even needs to be. If I look at the output:

{"repository"=>[{"queriesUri"=>"http://localhost:8080/dctm_rest/resources/core/repositories/test_repo/queries.json", "repositoryType"=>"managed", "typesUri"=>"http://localhost:8080/dctm_rest/resources/core/repositories/test_repo/types.json", "foldersUri"=>"http://localhost:8080/dctm_rest/resources/core/repositories/test_repo/folders.json", "checkedoutUri"=>"http://localhost:8080/dctm_rest/resources/core/repositories/test_repo/objects/checkedout.json", "uri"=>"http://localhost:8080/dctm_rest/resources/core/repositories/test_repo.json", "name"=>"test_repo", "objectsUri"=>"http://localhost:8080/dctm_rest/resources/core/repositories/test_repo/objects.json"}]}

I can see a very succinct set of other URIs that I can use to get other information. In the next post I’ll go through how to browse around a Docbase using Documentum RESTful Services. For now, take the time to sign up for the early access program, so you can help give feedback on what is a giant leap forward for Documentum in the web2.0 world.

Rails Rumble 2009

Unlike last year where I registered at the last minute and went it alone, I’ve been hanging out for this years dates to be announced. Now I’ve got a few days to put together a team and decide on an idea. You can find more information at the  Rails Rumble 2009 website.