Nuxeo Core Developer Guide

Hot Reloading XHTML templates

Updated: October 22, 2018 Page Information Edit on GitHub

When working on XHTML files, it can be useful to modify files on your usual editor, and to copy them to the server for immediate reload.

To enable hot reload of XHTML templates, add the following configuration to your server nuxeo.conf file:

org.nuxeo.dev=true

You can use the nuxeo helper ant file to deploy modified files directly to the server.

The original ant file is at https://github.com/nuxeo/nuxeo/blob/master/build.xml, it needs to be referenced by the local build.xml file placed at the root of your module.

Here is a sample local build.xml file: https://github.com/nuxeo/nuxeo-jsf/blob/master/nuxeo-platform-forms-layout-client/build.xml

<?xml version="1.0"?>
<project name="my project" default="web-tomcat" basedir=".">
  <import file="path/to/the/global/build.xml" />
  <property file="build.properties" />
</project>

The default build.properties file will place the tomcat server at /opt/tomcat. You can either override this property globally or locally, by placing a build.properties file next to the global or local build.xml file.

Here is a sample build.properties file content:

tomcat.dir=/path/to/my/tomcat

 

Here is a sample usage output:

~/workspaces/nuxeo/nuxeo-jsf/nuxeo-platform-forms-layout-client$ touch src/main/resources/web/nuxeo.war/widgets/container_widget_template.xhtml 
~/workspaces/nuxeo/nuxeo-jsf/nuxeo-platform-forms-layout-client$ ant
Buildfile: /home/anahide/workspaces/nuxeogit/nuxeo-jsf/nuxeo-platform-forms-layout-client/build.xml

web-tomcat:
     [copy] Copying 1 file to /opt/tomcat/nxserver/nuxeo.war

BUILD SUCCESSFUL
Total time: 0 seconds
2 months ago manonlumeau NXDOC-1650 fix about integrating changes, add mention on multiple attempts
4 years ago Anahide Tchertchian 3
4 years ago Anahide Tchertchian 2
4 years ago Anahide Tchertchian 1
History: Created by Anahide Tchertchian

We'd love to hear your thoughts!

All fields required