Aug 302007

Lotus Domino. Making some stuff easy, and some fairly obvious stuff stupidly convoluted.

I have a subform which has a version number in it. It’s in the subform so it only needs to be changed in once place to show up in all of the site design where it needs to be, and it’s not in a document because they don’t travel with the design. So far so good, you might think.

Pages do not support subforms. Or shared fields. Or any other way of incorporating reusable design elements. So I’d be better off using a form. But I can’t use a form, because you can’t specify a form as the default element to open when the application is opened, and short of reconfiguring every other bit of the intranet which links to all the deployed instances of this app, the only thing I can think of to do is put a redirect into the onload event of the page so that it redirects to the form version, which has the subform on it. This is a nasty hacky icky brittle way of doing it but I cannot think of any other way.

Sometimes being a programmer can be immensely rewarding. This is a million miles away from being one of those times.

EDIT: Thanks to Matt for pointing me in the right direction for the Notesy workaround for this. It’s still a bit of a hack but less so than redirecting via javascript in the browser. I feel slightly happier now.

Domino ReadViewEntries agent

Posted by Simes at 1:57 pm
Mar 092007

Sometimes when you’re working on a Domino web app, you need a NAB picker to help your users fill in name fields. At such times, you scour the web because you know that clever people like Scott Good and Matt White are out there and have probably done it already. And you find that they have, and you grab that code and use it. And it’s all fine for intranet sites.

And then, as happened to me this week, you find that you need to use your name picker with a NAB that normal users are not allowed to read, such as corporate sites which face the Internet. The picker I’m using, Scott’s, based on Matt’s, uses ReadViewEntries to get its data. Without user-level access to the NAB, it doesn’t work.

So, ideally, in this situation, what you need is an agent which can be run from the web and does essentially the same thing as a call to ReadViewEntries, because that way you can use the same name picker at the front end. And that, dear reader, is what I present to you today.

Again, the first thing you do in this kind of situation is hit Google to see if anyone’s done it already. And so this code is mostly from an agent at Vince Dimascio’s site which presents Full-Text Search results in a ReadViewEntries-like form. All I did was pull out the FTSearch stuff and put in support for start, count and startkey values. I’m quite pleased with the end result, though – it’s pretty nippy, certainly still fast enough for the typeahead lookup to work.

Source is here. Enjoy!

Project Shoehorn, Part II

Posted by Simes at 3:47 pm
Feb 262007

After a helpful response from Charles to my last post on the subject, I pulled the 0.9.3 JRuby build and ran my test against it. On the way I ran into a few other things and tidied up a few more as a result.

Firstly, the jars are now in the jre/lib/ext folder of my Notes client install, rather than putting them in another folder and adding them to JavaUserClasses.

Secondly, something about the new build causes a SecurityException to fire when running the test code again. I’m guessing it’s something to do with the new bytecode manipulation stuff in JRuby, but I don’t know for certain. Granting

permission java.lang.reflect.ReflectPermission "suppressAccessChecks", "true";

sorts that out.

And so, we run the test code again. A substantial improvement, knocking the run time down to about 6 seconds – still not really usable as such, but certainly better than before. It might be worth looking into a more real-world sort of test, one which actually opens real documents from real views and manipulates them. I shall also, as requested, be posting the details to the JRuby mailing list to see if anyone there can help.

© 2011 simes dot org Suffusion theme by Sayontan Sinha