RIFE logo
This page last changed on Feb 09, 2007 by spector@zeitgeist.com.

Check List

Code Checks

Before trying to build your application's WAR file, take a few moments to check your files and code for the following criteria:

  1. Check all your template names to ensure they will map to legal Java class names (in RIFE HTML templates are compiled into regular Java classes) E.g., A template named my-template.html will throw an error at compilation time because hyphens are not legal in Java class names.
  2. If you have customized any CRUD templates, make sure that the template sources are in the classpath so they will be found during the build/packaging process (summarized from rife-users)
  3. Check that the case of all your template filenames on disk match the template names you load from inside your Java elements. On Windows and Mac OS X the default file systems elide the differences between case; this can lead to some frustration since your App may seem to work fine inside your IDE, but fail when being packaged or deployed.

Build.xml Changes/Customizations

  • If you are using the stock build.xml shipped with Rife Jumpstart, you will probably want to update several parameters so they reflect your application, rather than the JumpStart defaults, for example the property names:
    <property name="name" value="rife-jumpstart"/>
    <property name="screenname" value="RIFE/Jumpstart"/>
    <property name="year" value="2004-2006"/>

found near the top of the file should be changed to reflect the name of your application. The result will be a JAR or WAR file with your application's name instead of "rife-jumpstart"

  • Rife-JumpStart's default build.xml also has an application version number tag which is stored in a text file called, logically, VERSION. You should change the version number inside this file to reflect the version number of your application.

Configuration

First, set these configuration parameters to false, their purpose should be self-explanatory:

<param name="ELEMENT_AUTO_RELOAD">false</param>
<param name="SITE_AUTO_RELOAD">false</param>
<param name="TEMPLATE_AUTO_RELOAD">false</param>
<param name="L10N_RESOURCEBUNDLE_AUTO_RELOAD">false</param>

By disabling all these parameters, RIFE will not automatically check for changes in these file types and your application will run at full-speed.

Note that when you set up you repository configuration participant like this:

<participant param="XmlSelectorHostname">ParticipantConfig</participant>

You can create configuration files that are specific for each host (development, production, ...). In each of these files you can then set the appropriate configuration parameters and still include a common configuration file that contains all the application settings.

This site for example has the following configuration files:

src/
    rep/
        config-common.xml
        config-dawn_uwyn_com.xml
        config-elm_uwyn_office.xml
        config-ferrari_uwyn_office.xml
        config-pine_uwyn_office.xml

The host dawn.uwyn.com is the production server and all the others are development machines. They all include config-common.xml.

Packaging

Next, you should pre-compile all your templates during the packaging of your web application. This is handled by the com.uwyn.rife.template.TemplateDeployer class. You will typically do this in your Ant build process, this is an example, taken from the Rife-JumpStart package, of a task that does just that:

<target name="precompile">
    <echo message="Precompiling html templates:"/>
    <java classname="com.uwyn.rife.template.TemplateDeployer"
            failonerror="true"
            fork="true">
        <arg value="-verbose"/>
        <arg value="-t"/>
        <arg value="enginehtml"/>
        <arg value="-d"/>
        <arg value="${build.classes}"/>
        <arg value="-encoding"/>
        <arg value="UTF-8"/>
        <arg value="${templates.dir}"/>
        <classpath refid="application.classpath"/>
        <classpath refid="lib.classpath"/>
    </java>
</target>

You will need to do this for each template type that you use. After this process, your templates will be regular Java classes and will not have to be parsed during production anymore. Your application will thus respond instantly once it has been started up.

Document generated by Confluence on Oct 19, 2010 14:57