Hot reload of XHTML files (5.2-M2 and after)
XHTML files can be hot reloaded. In order to activate this, you need to update the nuxeo.ear/config/nuxeo.properties files and uncomment the facelets.REFRESH_PERIOD=2 line (requires restart of Jboss). The xhtml files will then be reloaded from nuxeo.ear/nuxeo.war/. You can directly edit the xhtml files from here or copy manually the xhtml files you edited from your IDE into this directory. NB : for production, this option has to be disabledHot reload of Seam components (5.2 only)
Seam components can also be hot redeployed. This can save a lot of time (and Jboss restarts).Activating Seam Hot Reload
To activate Seam Hot reload you need to create the file nuxeo.ear/config/seam-debug.properties. This file can be empty.Selecting the Seam Components that can be Hot Reloaded
Because of the way Seam Hot Reload works, you have to select what Seam Components must be hot reloadable. This is done by telling the deployment system what classes must be reloadable. This can be done in 2 places :- in the seam.properties inside the jar that contains the code you are working on
- in the seam-debug.properties that is in the config directory
org.nuxeo.ecm.webapp.seam.TestBean=trueHow it works and what are the limitations
During deployment preprocessing, the "hot reloadable jars" will be splitted :- Seam classes made for hot reload will be copied into nuxeo.ear/nuxeo.war/WEB-INF/dev
- other jar ressources (class, xml, manifest ...) will remain in another jar that will be deployed instead of the original one
How do I reload my classes
You have to copy your updated classes into nuxeo.ear/nuxeo.war/WEB-INF/dev. To trigger the hot reload you can either :- use the SeamReload action link that is available in the default nuxeo-dm packaging
- call the url : http://127.0.0.1:8080/nuxeo/restAPI/seamReload
How do I automatically hot reload with ant
You add this code to your ant script :<target name="seam" depends="clean-seam-hotdeploy-dir"> <antcall target="maven"> <param name="mvn.lifecycle" value="clean"/> </antcall> <antcall target="maven"> <param name="mvn.lifecycle" value="compile"/> </antcall> <echo message="Deploy Seam components in ${seam.hotdeploy.dir}"/> <copy todir="${seam.hotdeploy.dir}" flatten="false"> <fileset dir="./target/classes"> <include name="**/*.class"/> </fileset> </copy> <get dest="./seam_hotdeploy_result.html" src="http://127.0.0.1:8080/nuxeo/restAPI/seamReload" username="Administrator" password="Administrator"/> </target> <target name="clean-seam-hotdeploy-dir"> <delete> <fileset dir="${seam.hotdeploy.dir}"> <include name="*"/> </fileset> </delete> </target>
ant seam
Version 13.3 last modified by Thierry Martins on 26/10/2009 at 14:38
Document data
Attachments:
No attachments for this document
Comments: 0