358 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Musing About Web App Structure
Tue, Dec 16th 2014 93
How I Maven-ized My Framework
Mon, Dec 8th 2014 140
Using the ODA Design API for File-Resource Manipulation
Wed, Nov 19th 2014 186
Factories in XPages
Wed, Nov 12th 2014 277
Property Resolution in XPages EL
Tue, Nov 11th 2014 194
Using "Verboten" Property Names in Custom Controls
Sun, Nov 2nd 2014 238
CocoaLove Reflection
Sun, Oct 26th 2014 203
Top 10
A Welcome SSL Stay of Execution
Tue, Oct 21st 2014 404
Domino and SSL: Come with Me If You Want to Live
Wed, Sep 24th 2014 309
Factories in XPages
Wed, Nov 12th 2014 277
Using "Verboten" Property Names in Custom Controls
Sun, Nov 2nd 2014 238
"Build Automatically", "Refresh automatically", and "Team Development"
Thu, Jan 23rd 2014 224
CocoaLove Reflection
Sun, Oct 26th 2014 203
Property Resolution in XPages EL
Tue, Nov 11th 2014 194
Using the ODA Design API for File-Resource Manipulation
Wed, Nov 19th 2014 186
Better Living Through Reverse Proxies
Thu, May 30th 2013 162
Some Notes on Developing with the frostillic.us Framework
Thu, Oct 9th 2014 152


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?



---------------------
http://frostillic.us/f.nsf/posts/F660516EC59A25FC852579E5007D5F9C
Apr 19, 2012
24 hits



Recent Blog Posts
93


Musing About Web App Structure
Tue, Dec 16th 2014 5:17p   Jesse Gallagher
I've been giving a lot of thought lately to how I feel about different structures for web apps. Specifically, in this case, the "structure" I'm thinking about is the "client-server" balance in the app itself and the associated method of data access. The impetus has been my minor fiddling with Angular over the past half a year or so. If you're not familiar with it, Angular is a client-side JavaScript framework focused on building full-fledged apps that run in the browser. The way it [read] Keywords: xpages application applications desktop development interface java javascript mobile server
140


How I Maven-ized My Framework
Mon, Dec 8th 2014 9:11a   Jesse Gallagher
This past weekend, I decided to take a crack at Maven-izing the frostillic.us Framework (I should really update the README on there). If you're not familiar with it, Maven is a build system for Java projects, basically an alternative to the standard Eclipse way of doing things that we've all gotten pretty used to. Though I'm not in a position to be a strong advocate of it, I know that it has advantages in dependency-resolution and popularity (most Java projects seem to include a "you c [read] Keywords: domino ibm lotus notes xpages community development eclipse integration java openntf profile properties workspace xml
186


Using the ODA Design API for File-Resource Manipulation
Wed, Nov 19th 2014 5:11p   Jesse Gallagher
As is characteristic of his blog, Sven Hasselbach recently posted two interesting posts on using the NAPI classes in the XPages runtime to manipulate files in the WebContent folder. If you haven't read the posts, I suggest you do so now, because it's knowledge that is very good to have. The NAPI classes are chock full of cheating sorcery. But the point of this post here is a bit of me-too-ism. Which is to say: the OpenNTF Domino API has you covered on this front. The API's Design packag [read] Keywords: domino dxl notes xpages database interface java openntf
277


Factories in XPages
Wed, Nov 12th 2014 5:18p   Jesse Gallagher
In my last post, I intimated that I wanted to write a post covering the concept of factories in XPages, or at least the specific kind in question. This is that post. The term "factory" covers a number of meanings, and objects named this way crop up all over the place (ODA has one, for example). The kind I care about today are those defined in an XspContributor object in an XPages plugin. These factories are generally (exclusively, perhaps) used for the purpose of generating adapters: as [read] Keywords: domino ibm notes xpages application development interface java
194


Property Resolution in XPages EL
Tue, Nov 11th 2014 10:19a   Jesse Gallagher
Reading Devin Olson's recent series on EL processing put me in the mood to refresh and fill out my knowledge of how that stuff actually happens. A while back, I made a small foray of my own into explaining how property resolution in XPages EL works, one which I followed up with a mea culpa explaining that I had left out a few additional supported types. As happens frequently, that still didn't cover the full story. Before getting to what I mean by that, I'll step back to an overview of [read] Keywords: domino ibm lotus xpages application development interface java javascript openntf properties xml
238


Using "Verboten" Property Names in Custom Controls
Sun, Nov 2nd 2014 8:11a   Jesse Gallagher
In an attempt to save you from yourself, Designer prevents you from naming your custom control properties after SSJS keywords such as "do" and "for". This is presumably because a construct like compositeData.for would throw both a syntax error in SSJS and the developer into a tizzy. However, sometimes you want to use one of those names - they're not illegal in EL, after all, and even SSJS could still use compositeData['for'] or compositeData.get("for") to access the value. Fortun [read] Keywords: ibm xpages javascript properties xml




203


CocoaLove Reflection
Sun, Oct 26th 2014 5:15p   Jesse Gallagher
This weekend, I attended CocoaLove a new Mac/iOS-development-related conference held in Philadelphia. Though my Cocoa resume consists of doing various tutorials every few years for the last decade or so, the location, concept, and speaker lineup were impossible to resist. The upshot: this was a great conference. As the tagline – "A conference about people, not tech." – indicates, the sessions weren't technical or even generally about programming as such. Instead, it was a bit more i [read] Keywords: domino ibm community development java mac twitter
404


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
152


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
140


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




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