Navigation

RSS 2.0 New Entries Syndication Feed Atom 0.3 New Entries Syndication Feed

Show blog menu v

 

General

Use it

Documentation

Support

Sibling projects

RIFE powered

Valid XHTML 1.0 Transitional

Valid CSS!

Blogs : Archives

< RIFE at Fosdem 2006   Which template syntax looks best to you? >
Preparing RIFE applications for production

This is something that hasn't been made clear enough in the documentation, so I thought it would be a good idea to give a short overview.

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 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.

posted by Geert Bevin in RIFE on Feb 18, 2006 11:06 PM : 0 comments [permalink]
 

Comments

Add a new comment

Comments on this blog entry have been closed.

< RIFE at Fosdem 2006   Which template syntax looks best to you? >
 
 
 
Google
rifers.org web