359 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
Latest 7 Posts
A Welcome SSL Stay of Execution
Tue, Oct 21st 2014 244
Some Notes on Developing with the frostillic.us Framework
Thu, Oct 9th 2014 344
Building an App with the frostillic.us Framework, Part 7
Tue, Oct 7th 2014 203
NotesIn9 Appearance: Custom Renderers
Thu, Oct 2nd 2014 236
I Posted My WrapBootstrap Ace Renderkit
Tue, Sep 30th 2014 169
A Note About Installing the OpenNTF API RC2 Release
Fri, Sep 26th 2014 170
Domino and SSL: Come with Me If You Want to Live
Wed, Sep 24th 2014 622
Top 10
Domino and SSL: Come with Me If You Want to Live
Wed, Sep 24th 2014 622
The Trouble With Developing on Domino
Tue, Jul 8th 2014 463
"Build Automatically", "Refresh automatically", and "Team Development"
Thu, Jan 23rd 2014 407
Some Notes on Developing with the frostillic.us Framework
Thu, Oct 9th 2014 344
Delving Into NSF Raw Item Data
Tue, Jul 29th 2014 332
Things I Rarely Use: sessionScope
Thu, Jul 3rd 2014 325
How I'm Handling URLs for the Blog
Fri, Sep 5th 2014 320
Domino SSL and Reverse Proxies
Mon, Aug 18th 2014 308
Setting up nginx in Front of a Domino Server
Thu, Sep 18th 2014 290
The Industry's Vileness
Tue, Jul 22nd 2014 287

Arbitrary Scripting Languages in XPages
Jesse Gallagher    

I think I've settled on JSR 223, the generic "Scripting in Java" specification, as the likely best way to embed Ruby. It seems like the "correct" way to do it and generally the cleanest. I don't like the notion that the way to customize the runtime is by setting system properties, so I'm still a little wary, but it'll do for now, in any event.

The side benefit of JSR 223 (and this would be true of BSF as well) is that it supports a crapload of languages, and it does so in a very unified and generic way. Accordingly, I modified my ViewHandler and created a GenericBindingFactory to browse through the list of non-Ruby available languages and create EL bindings for each.

The upshot is that, when this code is active, any JSR-223-compliant language in your server's classpath will become available for "#{whatever: ... }" bindings just by virtue of its presence. Note, though, that that doesn't necessarily mean it will be a good experience. For one, the page's variables (like param, facesContext, view, and so forth) aren't just available - you'd have to make something like the method_missing method I wrote for Ruby to automatically resolve them via FacesContext.getCurrentInstance(). Furthermore, some languages are problematic: for some reason, Jython throws NullPointerException errors for even the most basic formulas on almost every page load, while PHP still requires <?php ?> tags and spits anything else out to the server console.

I know what question is on the tip of your tongue, though, so I won't keep you waiting: yes, you can use your home-grown string-concatenation operators in Scheme! You can breathe a sigh of relief now:

<xp:text><xp:this.value><![CDATA[#{scheme: (set! + (let ((original+ +)) (lambda args (if (and (not (null? args)) (string? (car args))) (apply string-append args) (apply original+ args))))) (+ "Hello " "from " "Scheme") }]]></xp:this.value></xp:text>

Yes, that works, and no, there's no reason to do it. If you really like Lisp, though, Scheme and Clojure can now be in your XPages toolbox.

Once I'm able to post to OpenNTF, I'll include this in my first Ruby-in-XPages release, though I may leave the applicable code commented out by default. Who knows what horrors this could unleash?

Apr 19, 2012
50 hits

Recent Blog Posts

A Welcome SSL Stay of Execution
Tue, Oct 21st 2014 3:11p   Jesse Gallagher
As you likely know from the torrent of posts on Planet Lotus on the topic, IBM announced a hopefully-imminent pair of updates to cover the two main SSL issues that have come to the fore recently: lack of SHA-2 support and the POODLE vulnerability in SSLv3. This is welcome indeed! Personally, I'm going to stick with the nginx approach for HTTP, even in simple setups, because I've found the extra features you can get (and the promising new ones I haven't tried) to be a dramatic [read] Keywords: domino ibm lotus planet lotus security server

Some Notes on Developing with the frostillic.us Framework
Thu, Oct 9th 2014 5:12p   Jesse Gallagher
Now that I have a few apps under my belt, I've been getting a better idea of the plusses and minuses of my current development techniques - the frostillic.us Framework combined with stock controls + renderers. This post is basically a mostly-unordered list of my overall thoughts on the current state. Component binding is absolutely the way to go. This pays off in a number of ways, but just knowing that the component is pointed unambiguously at a model property - and thus getting its field [read] Keywords: notes xpages development java network properties xml

Building an App with the frostillic.us Framework, Part 7
Tue, Oct 7th 2014 6:12p   Jesse Gallagher
Well, it's been much longer than planned, and this topic isn't actually particularly groundbreaking, but the series returns! Define the data model Create the view and add it to an XPage Create the editing page Add validation and translation to the model Add notification to the model Add sorting to the view Basic servlet REST with Angular.js One of the edge features of the Framework is that it assists in writing DesignerFacesServlet servlets - which are sort of like XAgents but written dir [read] Keywords: ibm xpages java

NotesIn9 Appearance: Custom Renderers
Thu, Oct 2nd 2014 7:12p   Jesse Gallagher
In a bout of unintentional timing, Dave Leedy posted an episode of NotesIn9 I recorded about custom renderers. This should pair nicely with my last post - the video provides an explanation for what renderers are, how to attach them to your components, and an example of a basic renderer for a widget container. So if you're interested in going down that path (which you should be!), perhaps the video will help. In it, I recommend looking at the source of Bootstrap4XPages, which remai [read] Keywords: widget

I Posted My WrapBootstrap Ace Renderkit
Tue, Sep 30th 2014 5:12p   Jesse Gallagher
Since I realized there was no reason not to and it could be potentially useful to others, I tossed the renderkit I use for the WrapBootstrap Ace theme up on GitHub: https://github.com/jesse-gallagher/Miscellany As implied by the fact that it's not even a top-level project in my own GitHub profile, there are caveats: The theme itself is not actually included. That's licensed stuff and you'd have to buy it yourself if you want to use it. Fortunately, it's dirt cheap for normal use. [read] Keywords: domino ibm development eclipse profile properties

A Note About Installing the OpenNTF API RC2 Release
Fri, Sep 26th 2014 12:16p   Jesse Gallagher
In the latest release of the OpenNTF Domino API, the installation process has changed a bit, which is most notable for Designer. The reason for this is due to the weird requirements in Designer for properly getting source and documentation working. When downloading the file, instead of the previous Eclipse update sites, there are two Update Site NSFs: one for Designer and one for Domino. There are a couple ways you can use these: If you're already using Update Sites for Designer or Domin [read] Keywords: domino notes application database eclipse openntf server


Domino and SSL: Come with Me If You Want to Live
Wed, Sep 24th 2014 1:12p   Jesse Gallagher
Looking at Planet Lotus and Twitter the last few weeks, it's impossible to not notice that the lack of SHA-2 support in Domino has become something of A Thing. There has been some grumbling about it for a while now, but it's kicked into high gear thanks to Google's announcement of imminent SHA-1 deprecation. While it's entirely possible that Google will give a stay of execution for SHA-1 when it comes to Chrome users (it wouldn't be the first bold announcement they quietly don [read] Keywords: domino ibm lotus notes notes client applications google integration java planet lotus server twitter websphere

Arbitrary Authentication with an nginx Reverse Proxy
Mon, Sep 22nd 2014 4:12p   Jesse Gallagher
I had intended that this next part of my nginx thread would cover GeoIP, but that will have to wait: a comment by Tinus Riyanto on my previous post sent my thoughts aflame. Specifically, the question was whether or not you can use nginx for authentication and then pass that value along to Domino, and the answer is yes. One of the aforementioned WebSphere connector headers is $WSRU - Domino will accept the value of this header as the authenticated username, no password required (it will als [read] Keywords: domino R6 xpages password server websphere ubuntu

Adding Load Balancing to the nginx Setup
Sat, Sep 20th 2014 8:16a   Jesse Gallagher
In an earlier post, I went over the basic setup of installing nginx on a single Domino server to get the basic benefits (largely SSL). Next, it's time to expand the setup to have one nginx server in front of two Domino servers. The concept is relatively straightforward: when an HTTP request comes in, nginx will pick one of the back-end servers it knows about and pass the request along to that. That allows for balancing the load between the two (since the act of processing the request is m [read] Keywords: domino xpages network server ubuntu

Generating JSON in XPages Applications
Thu, Sep 18th 2014 3:13p   Jesse Gallagher
This topic is fairly well-trodden ground, but there's no harm in trodding it some more: methods of producing JSON in the XPages environment. Specifically, this will be primarily about the IBM Commons JSON classes, found in com.ibm.commons.util.io.json. The reason for that choice is just that they ship with Domino - other tools (like Gson) are great too, and in some ways better. Before I go further, I'd like to reiterate a point I made before: Never, ever, ever generate code without prope [read] Keywords: domino formula language ibm xpages applications java xml

Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition