Raible's Wiki
Raible Designs AppFuseHomepage- Korean - Chinese - Italian - Japanese QuickStart Guide User Guide Tutorials Other ApplicationsStruts ResumeSecurity Example Struts Menu
Set your name in
UserPreferences
Referenced by
JSPWiki v2.2.33
Hide Menu |
This page documents the steps necessary to migrate an existing JSF application for use as a Jetspeed The application used for testing and figuring out these steps was the JSF version of Equinox Table of Contents
Add the portals-bridges-jsf-0.1.jar to your project [#1]Once you have equinox-jsf and jetspeed setup, copy the portals-bridges-jsf-0.1.jar from your local Maven repository into the web/WEB-INF/lib directory. cp ~/.maven/repository/portals-bridges/jars/portals-bridges-myfaces-0.1.jar web/WEB-INF/lib Modify web.xml to use *.jsf instead of *.html [#2]After a bit of trial-and-error, I discovered that the *.html mapping didn't seem to work in web.xml. This is strange since it does work in the Struts Portlet. Change the mappings for the FacesServlet and exportFilter to be *.jsf.<filter-mapping> <filter-name>exportFilter</filter-name> <url-pattern>*.jsf</url-pattern> </filter-mapping> <servlet-mapping> <servlet-name>faces</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> Create a portlet.xml file in the WEB-INF directory [#3]Copy and paste the following XML into a portlet.xml file in the web/WEB-INF directory. <?xml version="1.0" encoding="UTF-8"?> <portlet-app id="equinox-jsf" version="1.0"> <portlet id="Equinox-JSF"> <init-param> <name>ViewPage</name> <value>/userList.jsf</value> </init-param> <portlet-name>Equinox-JSF</portlet-name> <display-name>Equinox</display-name> <description>This is a simple portlet</description> <portlet-class>org.apache.portals.bridges.myfaces.FacesPortlet</portlet-class> <expiration-cache>-1</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>VIEW</portlet-mode> <portlet-mode>EDIT</portlet-mode> <portlet-mode>HELP</portlet-mode> </supports> <portlet-info> <title>User List</title> <short-title>users</short-title> </portlet-info> </portlet> </portlet-app> Deploy the WAR to Jetspeed [#4]In build.properties, add a "deploy.dir" property so you can deploy to Jetspeed's deployer. deploy.dir=/opt/dev/tools/tomcat/webapps/jetspeed/WEB-INF/deploy Edit web/WEB-INF/classes/jdbc.properties and change the "jdbc.url" to use an absolute path. This is necessary so you can populate the HSQL database from the equinox-jsf directory. jdbc.url=jdbc:hsqldb:/Users/mraible/dev/equinox-jsf/db/equinox Start Tomcat and run "ant deploywar" to deploy your portlet. If you're watching Tomcat's log files ($CATALINA_HOME/logs/catalina.out) - and you don't see your WAR getting deployed, make sure the portlet.xml is in your web/WEB-INF directory. To update the WAR in Jetspeed, just run "ant deploywar" after you've modified files. To undeploy the WAR, delete the equinox-jsf.war file from $CATALINA_HOME/webapps/jetspeed/WEB-INF/deploy. NOTE: These deployment instructions are based on this wiki page![]() Create a .psml file so the portlet will show up in Jetspeed [#5]Create a equinox-jsf.psml file in $CATALINA_HOME/webapps/jetspeed/WEB-INF/pages with the following contents. The fragment id's must be unique among all .psml files, and the name of the portlet is read from the portlet.xml file.<?xml version="1.0" encoding="UTF-8"?> <page id="equinox-jsf"> <defaults skin="orange" layout-decorator="tigris" portlet-decorator="tigris"/> <title>Equinox-JSF</title> <fragment id="equinox-jsf-layout" type="layout" name="jetspeed::VelocityTwoColumns"> <fragment id="equinox-jsf-portlet" type="portlet" name="equinox-jsf::Equinox-JSF"> <property layout="TwoColumns" name="row" value="0"/> <property layout="TwoColumns" name="column" value="0"/> </fragment> </fragment> </page> Open http://localhost:8080/jetspeed Known Issues [#6]
|