A common best practice in portal development projects is the deployment of portlet war files as part
of an ear file. This approach provides more flexibility and allows to leverage WebSphere Application Server administration
tools. This article describes how you can use ant and xmlaccess to built and register ear files containing
Experience Factory portlets.
The following image shows an Experience Factory project which has been extended to build an ear file containing
a war file with Experience Factory portlets. Please note even it shows an eclipse project you can use this structure outside
of eclipse just by executing ant.
The folder '.deployment/build' contains ant files to generate the war and ear files. You can find these files attached to this
article. To use it in your environment you have to change the first line in build.properties. This line must point to the location of you project.
The dist folder contains generated ear and war files after executing ant.
To successfully generate a war file the ant tasks require the factory base files. For this you have to generate a factoy image file
and place it in the Images folder. The article Automating the generation of WAR files describes how to generate this file.
You have to regenerate this file again after applying an Experience Factory fix pack.
The Packages folder contains all Factory feature packages required in this project. For every feature package you have to add a new task
to the build.xml. The sample provided here uses the Dojo feature. The appropriate ant task can be found in line 38 of build.xml.
After building the ear file and deploying it using WebSphere Administrative Console or WebSphere scripting you have to register the portetls.
For this you can use RegisterPortlets.xml which can be found in the xmlaccess folder. This sample registers two portlet copies which base on the
sample Experience Factory model. By explicitly assigning a "bpf_config._explicit_profile" preference setting you can select a profile name for the portlet copy.
You can find the model and profile file attached to this article.