Railo Extension Provider with Transfer ORM

I wrote a Railo extension provider server to scratch my own itch -- that itch being that I wanted to install the latest Transfer ORM easily in a bunch of places. I spent a considerable amount of time getting the Ant build to be perfect. It's now simple run the build and dist targets to pull down the latest from Subversion and package a new Railo extension. All of the code for this project is on Github: jlamoree/railo-extension-provider

The root URL is a listing of the extensions available. The server is at railo.lamoree.com and I will likely add more extension packages over time. I running this site over SSL, but the default certificate authority chain doesn't contain one for my signer. I could make hash digests for the files available, but it would be a manual process to verify them. Perhaps I'm the only one concerned about proving the authenticity of my server.

While perfecting the Subversion Ant task, I found a Google Code project named svntask that is far simpler than the Tigris SvnAnt tool that requires SvnClientAdapter and JavaHL. The svntask is pure Java and needs only the SVNKit library.

It is worth mentioning, however, that the svntask-1.0.7.zip binary release does not nave the checkout command. I really wanted to use the checkout, rather than maintaining an existing repository to update. I built the project from source to get com.googlecode.svntask.command.Checkout, and it works fabulously. To save you from such trouble, my dear droogs, you can download a copy here: svntask-r32.jar The following is a chunk of my build file:

<svn> <checkout url="${svn.url}" path="${svn.path}"/> <info path="${svn.path}" committedRevisionProperty="svn.revision"/> </svn>

The result is that the svn.revision property contains the latest Subversion revision, used in file naming and token replacement.

Railo Multi-web on Tomcat

Both Sean Corfield and Jamie Krug have written about configuring Railo for multiple web sites/contexts long ago. However, having just done this setup myself, I thought I'd take notes and share them. I created a Google Document called (surprisingly enough) Railo Multi-web on Tomcat. I'm going to add to it as I have gather more information.

Convenient Mach-II App Reload Link

Here's a Mach-II trick that might prove useful to some of you someday, perhaps in a somewhat bizarre set of circumstances*. It can be helpful to include a link somewhere on the page that allows for easy reloading of the framework. Of course, you wouldn't want such a link to be present in the production application. Using the awesome Mach-II Environment Property it's simple to place the link on the pages served only by the development servers. Consider that the Application.cfc (which is a subclass of MachII.mach-ii) contains the following code to reinitialize the application:

<cffunction name="reinit" returntype="void" access="private" output="false">   <cfset var argName = getProperty("applicationReinitKeyName", "undefined")/>   <cfset var argValue = getProperty("applicationReinitKeyValue")/>     <!--- The reload command isn't defined, possibly intentionally --->   <cfif argName eq "undefined">     <cfreturn/>   </cfif>     <cfif structKeyExists(url, argName) and url[argName] eq argValue>     <cftry>       <cfset reloadConfig()/>       <cfset structClear(session)/>       <!--- Perhaps some other things too. --->       <cfcatch>         <!--- Bummer! --->       </cfcatch>     </cftry>   </cfif> </cffunction>

The Mach-II configuration file just needs a pair of properties to define the reinitialize command, which of course could be different for each environment:

<property name="applicationReinitKeyName" value="foo"/> <property name="applicationReinitKeyValue" value="bar"/>

Finally, the view needs to place the special link on the page:

<cfif getAppManager().getEnvironmentGroup() eq "development">   <a href="#buildUrl('showHome', getProperty('applicationReinitKeyName') & '=' & getProperty('applicationReinitKeyValue'))#">Reload Application</a> </cfif>

*This is a reference to the Tom Lehrer Elements song. Yay chemistry!