• Anonymous
  • Login
  • Register
Ruby in XPages

Owners Jesse Gallagher Project Creation Apr 23, 2012
Contributors - Last Release Jun 5, 2012
Downloads 184
Rating
(1 ratings)
Description Adds support for #{ruby: ... } bindings for XPages


The point of Ruby-in-XPages is to extend an XPage application's value/method binding capabilities to allow for Ruby code via "#{ruby: ... }" bindings. To accomplish this, it hooks into the JSF runtime to register JRuby (available at jruby.org) as a handler for that prefix.

 

Features
  • Works with both #-style and $-style bindings and for both value bindings and method bindings (e.g. beforePageLoad)
  • Allows for Ruby "Script Libraries". For now, these are accomplished by creating a "ruby" folder inside the database's WEB-INF folder (via Package Explorer) and putting Ruby scripts in there. Then, they can be references on a page like a normal library but with "text/ruby" or "text/x-ruby" as the type: <xp:script src="/somelibrary.rb" type="text/ruby" clientSide="false" />
  • Can access local variables as readily as in Server JavaScript, such as "session", "database", and repeat-local variables
  • The included file "domino.rb" contains some extensions for the Domino product objects in Ruby, allowing for Ruby-style looping in collection classes (e.g. docs.each { |doc| ... }) and hash-style access to a document's item values (e.g. doc["Form"]). It is meant to be added to the project as a "Script Library" as described above
  • Though currently commented out, there is some extremely-basic support for arbitrary other scripting languages. If you uncomment the applicable /* */ block in frostillicus/ScriptingViewHandler.java, it will register all available JSR-223-compliant languages with binding names based on the language name provided by the language package (such as "#{Groovy: ... }" or "#{scheme: ... }"). Note that other languages have had essentially no testing, Jython is known to be problematic, and there is no automatic variable resolution. See http://frostillic.us/f.nsf/posts/F660516EC59A25FC852579E5007D5F9C for a casual overview

 

Caveats
  • This has not been extensively tested! While I personally am using it to develop my blog, that is a far cry from "real" production use
 
Requirements
 
  • Having only developed this in Domino 8.5.3, I can't say whether or not it requires that version
  • JRuby 1.6+
  • A willingness to put up with beta software crashing HTTP and a familiarity with Designer's Package Explorer view
  • Though not required, it may be useful to install Ruby syntax highlighting in Designer: http://frostillic.us/f.nsf/posts/9596C553131169E4852579DA00737040

 

Development is currently included as part of a blog project on GitHub: https://github.com/jesse-gallagher/frostillic.us-Blog



Projects can have short and readable URLs, e.g. http://mobilecontrols.openntf.org.

You can request a short URL to your project by sending a mail to support at openntf dot org.
Owners are the people with maximal rights. For example they can create releases and add more contributors.

In order to define multiple owners use "," (comma) as separator.

Because of data privacy you cannot lookup other people's names but you have to type them in.
Enter the contributors or owners here who you want to receive notifications and questions by email.

In order to define multiple owners use "," (comma) as separator.

Because of data privacy you cannot lookup other people's names but you have to type them in.
In addition to the owners additional OpenNTF contributors have to be listed here. Contributors don't have the same access rights as owners, e.g. they cannot create releases.

In order to define multiple owners use "," (comma) as separator.

Because of data privacy you cannot lookup other people's names but you have to type them in.
Enter a short description of the project here (up to 100 characters).

The short description shows up in the project UI and in some of the views.
In this field you should enter a more detailed description of your project.

You can use the rich text editor for rich text formating. You can also enter HTML to embed objects, e.g. to embed a YouTube video or a screenshot of the project. In this case use '[' and ']' to mark the passthrough HTML as such.
A Catalog Release is for projects that are production ready and that are end-user "install friendly".

This property describes whether any release of this project has been added to the catalog.

Learn more about the catalog.
GitHub can be used as source control repository for OpenNTF projects. In this case the Issues from GitHub are used instead of the Defects from OpenNTF.

Contact ip-manager@openntf if you want to have a GitHub project created in the OpenNTF space.

Learn more about OpenNTF on GitHub