Jake Of All Trades: CMTI’s Jake Ochs


When using LS2J to utilize Java classes from within LotusScript, you may be faced with needing to declare and bind to a method explicitly using its JNI signature. A common case where this is necesary is when your Java class has multiple overridden methods and you need to explicitly use one of them. Instead of wrestling with the JNI syntax, you can use this handy function to bind to the object and print out the signatures for you to copy:

  1. Function getMethodSignatures(jClass As Javaclass, l As noteslog)
  2. Dim msg$
  3. Dim methods As JavaMethodCollection
  4. Set methods = jclass.Getclassmethods()
  5. ForAll meth In methods
  6. msg$ = meth.Methodname & " - SIG: " & meth.Signature
  7. If Not(l Is Nothing) Then Call l.logaction(msg$)
  8. Print msg$
  9. End ForAll
  10.  
  11. End Function

A sample output from the NotesLog looks like this:

  1. Started running agent 'LS Method Enumerator Test' on 01/21/2010 03:25:25 PM
  2. 01/21/2010 03:25:26 PM: equals - SIG: (Ljava/lang/Object;)Z
  3. 01/21/2010 03:25:26 PM: hashCode - SIG: ()I
  4. 01/21/2010 03:25:26 PM: toString - SIG: ()Ljava/lang/String;
  5. 01/21/2010 03:25:26 PM: generate - SIG: (Ljava/lang/String;Ljava/lang/String;Ljava/util/HashMap;)V
  6. 01/21/2010 03:25:26 PM: setPageOrientation - SIG: (Z)V
  7. 01/21/2010 03:25:26 PM: generate - SIG: (Ljava/lang/String;Ljava/lang/String;)V
  8. 01/21/2010 03:25:26 PM: addToRoot - SIG: (Ljava/lang/String;Ljava/lang/Object;)V
  9. 01/21/2010 03:25:26 PM: removeFromRoot - SIG: (Ljava/lang/String;)V
  10. 01/21/2010 03:25:26 PM: resetRoot - SIG: ()V
  11. 01/21/2010 03:25:26 PM: getClass - SIG: ()Ljava/lang/Class;
  12. 01/21/2010 03:25:26 PM: notify - SIG: ()V
  13. 01/21/2010 03:25:26 PM: notifyAll - SIG: ()V
  14. 01/21/2010 03:25:26 PM: wait - SIG: ()V
  15. 01/21/2010 03:25:26 PM: wait - SIG: (J)V
  16. 01/21/2010 03:25:26 PM: wait - SIG: (JI)V
  17. 01/21/2010 03:25:26 PM: main - SIG: ([Ljava/lang/String;)V
  18. Ran LotusScript code
  19. Done running agent 'LS Method Enumerator Test' on 01/21/2010 03:25:26 PM

Kindly rate this post using the star system below and/or rate my authoring abilities on Scribnia.

SHAMELESS PLUG: Like what you see? Hire Me! Contact [email protected] or use the contact page to learn more about engaging Jake Ochs for your development needs.
by jake


I am sitting on a draft of a rambling missive about folks noticing then increasing relevance of storage service offerings focusing on document-centric type of operations feeling vindicated by the Notes development model are missing the point. The point being?  It’s not that the model is suddenly relevant now, it’s just that it engenders the type of massive scaling that large sites and cloud services require. I’m referring to CouchDB, BigTable, S3/SimpleDB, Hadoop, Cassandra. –these data layers are all the engineering rage because they scale…massively. Their data API’s are ancillary and, in some cases, crude compared to Notes. But they also federate well, support eventual-consistency philosophies and are reliable in ways that the Notes datastore –in its current iteration- cannot hope to match. Having said all that, the Opening General Session at this year’s Lotusphere yesterday precisely stole the thunder out of the conclusion I was reaching for: Building on the Notes APIs and rich ecosystem of tools and developers, IBM would be wise to produce a cloud offering that would enable a developer with a (free) copy of Designer to publish an app to a cloud. This masterstroke accomplishes a lot: It provides a deployment opportunity for those driving fresh copies of the free Designer wondering how and where to deploy their new apps, thus delivering on the server side corollary to the free Designer giveaway; and it provides a compelling case for being able to deploy rich services into the cloud or hybrid scenarios – a place where the competition hasn’t quite staked out so forcefully yet. Sigh. Alas my thunderbolt was preempted by the OGS announcement. Woe unto those whose dreams come true.

by jake


On this eve of Lotusphere ’10 (not going, thank you very much) has anyone compiled a list of the major pieces that are missing from a Domino developer’s toolkit? This is not a rant, as IBM has more than fulfilled its pledges to make Notes and Domino technically relevant again, but there are glaring holes that are obvious candidates for a list. I’ll start things off by naming three easy ones:

  1. An integrated Java Debugger (remote&local)
  2. Complete XSP Taglib documentation
  3. Remote/Local XPages debugging

Please chime in with your suggestions and keep the topics general. While I agree with, say, Chris Toohey, that an @Password formula that optionally takes an encryption algorithm type as an argument would be a useful addition, such a suggestion is less a big picture requirement to fully contemporize our development environment portfolio than a feature request. By all means chime in with the URL’s of IdeaJam suggestions for participants to vote on as well.

by jake


Ever wonder what the deal with toxic fugue is? It’s been a favorite topic of mine since the classic Simpsons Episode “One Fish, Two Fish, Blowfish, Blue Fish.” This article in today’s NYTimes is enlightening.

Develop web faff using firebug? (who doesn’t) This post explains that you may be unwittingly slowing down your browser’s performance, even when not using firebug.

Childlike fascination with airplanes? By all means follow @flightglobal&@flightblogger. I’m enthralled with the 787 and the second flight-test plane is scheduled to make it’s first flight today. This plane has the potential to revolutionize travel comfort and may literally be around for an long time, due to its super-strong carbon-fiber fuselage. The 21st century’s DC-3?

ANNOYING: Occasionally developing for Expeditor caused BSOD. Thought that was a thing of the past…

LAZYWEB: Anyone know how to get in on the Symphony beta program (is there one?

by jake


Before I close up shop for the weekend I leave a lazyweb request. I’m developing a Notes plugin using the Expeditor Toolkit for Eclipse (6.2.1) and I can’t seem to figure out how to expose the Symphony objects in the IDE for me to code against. Any help is appreciated.

by jake


Got the Freemarker Eclipse Editor plugin to work inside of Domino Designer. Now I can edit and save a Freemarker template directly to a database (ResourcesFiles) all from within DD. To do this, follow this tip to enable the Eclipse update site feature in the Notes client, add the JBoss Tools update site to the Eclipse update site list, wait for the list to churn through the site and present the list of add-ons, drill into the list and select the Freemarker Editor, update, restart and presto!

According to this article, Google is abandoning Gears. Not too shocking as I don’t know of any widespread adoption of the technology. Of course, the only company to ever pay anything more than lip service to offline use is Lotus and it’s not an easy task. To revise my earlier post on the relevance of Chrome OS, it’s all about the eyeballs. Forget the underlying tech, Google just wants to make sure that it grabs as much advertising revenue for every click possible. Squeezing out competitor’s apps is one way to make that happen.

This spy shot indicates that the US government’s black programs are alive and well. Witness this stealthy UAV on the ground in Kandahar. Definitely cool stuff for an aviation anorak.

by jake


I’m doing some research for a client in using Freemarker to generate documents using templates and Notes data. It turns out that it’s deceptively simple to create a very basic Notes wrapper object to pass into Freemarker’s templating engine for merging document fields with a template. The closest abstract class to implement for a document is Freemarker’s TemplateHashModel. The idea is that for any given Notes field, you’d want the template to get the value by referencing the field’s name. Assuming that we call getText() on any retrieved item (I said it was a BASIC Notes wrapper) and convert the string results to Freemarker’s expected SimpleScalar, here’s the wrapper:

  1. import lotus.domino.*;
  2. import freemarker.template.*;
  3.  
  4. public class SimpleNotesDocumentWrapper implements TemplateHashModel {
  5. private Document doc;
  6.  
  7. public SimpleNotesDocumentWrapper(Document note) {
  8. doc = note;
  9. }
  10.  
  11. @Override
  12. public TemplateModel get(String key) throws TemplateModelException {
  13. Item item;
  14. try {
  15. if ((item = doc.getFirstItem(key)) != null) return new SimpleScalar(item.getText());
  16. } catch (Exception e) {
  17. e.printStackTrace();
  18. }
  19. return null;
  20. }
  21.  
  22. @Override
  23. public boolean isEmpty() throws TemplateModelException {
  24. // TODO Auto-generated method stub
  25. return (doc == null) ? true : false;
  26. }
  27. }

and you can then access document fields in your template like so: memo subject: ${doc.Subject}. (Assuming you’ve named the SimpleNotesDocumentWrapper object you placed in the root of the Freemarker object parse tree “doc.”)

by jake


I’ve been tinkering a little under the hood of this blog/website. As some of you may know, this site is based on the awesome Drupal CMS. I was browsing some blogs and came across an interesting ratings and recommendation service called Outbrain. A little digging and sure enough, There’s a Drupal module for that! I installed the module and played with the widget settings from my Outbrain account. Outbrain wins extra love for supporting openid, which is my identity verification method of choice. It turns out that the recommendation engine’s recommendations for my blog were either irrelevant (in my humble opinion) politically charged (I have no idea how that happens as I remain a blogging centrist politically) or just links to my other content, which is easy enough to find without the recommendation engine’s obtrusiveness. So I turned it off and went with the ratings engine alone for the time being. Maybe when my blog content fills out more and/or the recommendation engine becomes a little more sophisticated I’ll give it another whirl. Meanwhile, please rate my individual blog posts by clicking on the appropriate star.

Another change that’s been a long time coming is to abstract my blog feed to Feedburner. It’s good practice to do this in case your native blog URL changes for any reason. It’s the blogger’s version of a universal phone number (Unified Feedopathy?) Say you want to change your web address or even just want to switch blogging platforms, having your subscriber base fetching your feed from Feedburner or Friendfeed means they don’t have to suffer a link breakage. You just have to repoint your Feedburner feed to the new location. To make a long story short, there’s a module for that too! I just installed the Feedburner module, which integrates nicely with Feedburner’s feed flare and your own site’s content types. Let me know if you are experiencing problems with my site feed.

by jake


Just a quick note on yesterday’s Chrome OS reveal by Google. Unless I’m missing something, there’s nothing new under the covers here. It seems as if the whole point of the “OS” is to provide a stripped down device-like environment for hosting a web browser. Essentially, all the “apps” are Google’s Cloud-based offerings. There must be a vertical play here, otherwise why would Google go through all of the trouble of creating a complete stack for what we can essentially get today? What I’m not seeing is the strategic vision of offering Chrome OS for devices when variations on Android will play in the same space. Remember folks, Android OS is not necessarily just for phones and, in fact, has begun turning up in non-phone applications as well. I do see a potential competitive space opening up between Chrome OS, Ubuntu’s Netbook remix and Moblin for tablet-ish devices. A major differentiator being Google’s support of Gears for offline access to data and Ubuntu’s increasing use of CouchDB as a data repository –both on the device and in it’s own branded cloud offerings. Being a fan of Damien Katz and IBM (CouchDB’s creator and corporate sponsor, respectively) through my Lotus connection (Damien redesigned the Notes formula language engine back in the R6 timeframe) as well as my fondness for the Ubuntu distro, you could say I’m rooting for Ubuntu –if not to outright win, then not to fail. What’s interesting in comparing Gears to CouchDB is that it’s a repeat of the age-old question of whether general-purpose data fits best into a relational or a B-tree/document/hierarchical mold. In a nutshell, there’s not much to see until the whole NetOS/Netbook picture firms up and hardware and software vendors start to bed down to produce tangible product, probably 12-18 months out. Like I said, move along, folks, move along.

by jake


So it occured to me that every few years we reinvent the wheel in enterprise filesharing. Workgroups used to “collaborate” by dropping files into a shared network folder. Then there came Exchange Public Folders and Notes document libraries. Then there were complicated document management systems. Now there’s Quickr and Sharepoint. The reality of the enterprise deployments I’ve seen of these applications is that most spaces are used primarily as glorified fileshares.* Essentially, aside from the versioning and locking (check in-check out) ability of these tools, they are being used to dump files, with the added bonus of being nicely integrated in to the productivity apps (Office, Outlook, Notes) in vogue. Which makes me wonder: Why haven’t versioning filesystems become more popular for this sort of thing? I can easily envision an application that uses such a filesystem as the data store for an enterprise. Imagine for a moment what such an animal would look like: A filesystem that accounts for granular file permissions, versioning and file locking and is LDAP/enterprise directory-aware. You’d have the basis for perhaps 80% of the common usage of the aforementioned applications right there. Making good use of this versioning filesystem would basically entail a protocol implementing plugin. Such a system would remove a common dependency between messaging and collaboration that tends to cause frustrating vendor lock-in. Filesystems being what they are, HA and DR would probably also amount to a much simpler endeavor. I know of Wayback FS-which operates on top of traditional filesystems and proves my point that HA and DR should be a straightforward task- but I don’t know of any commercial tools that implement a client for Wayback. Why hasn’t this meme gained more traction?

*I’m not detracting from any of these products’ ability to be so much more than glorified fileshares, just how they seem to be mostly used.

by jake
Syndicate content