Date: 2005-02-03T00:26:07 Editor: BastianBowe Wiki: Cocoon Wiki Page: CocoonAppAsJSR168Portlet URL: http://wiki.apache.org/cocoon/CocoonAppAsJSR168Portlet
no comment New Page: === Content === This document describes how to run a existing cocoon application as a JSR168 portlet. The following example illustrates how to deploy the cocoon distribution as a JSR168 portlet in Pluto. Unfortunately the only thing I managed so far is to display one page of the cocoon app. Navigation inside the app is not possible (see [#linkproblem below]). It should work with any JSR 168 portlet Container. === Tested on === * jdk 1.4.2_04-b05 * cocoon 2.1.6 * pluto-src-1.0.1-rc2 * Tomcat 4.1.31 === Deployment === 1. copied blocks.properties to local.blocks.properties and disabled the scratchpad and cron (this one caused a problem on my configuration, but you might leave that step out) blocks 1. created a portlet.xml in `<COCOON_HOME>/src/webapp/WEB-INF` by using `<COCOON_HOME>/src/blocks/portal/WEB-INF/portlet.xml` as a base and removed the first portlet node so that you only keep the second `portlet` node (`portlet-name` = `CocoonPortlet`). You're might be interested in changing the init-param �servlet-path� e.g. to the value "�/`" to see the output you normally get when opening http://localhost:8080/cocoon/ 1. built cocoon war from source 1. deleted content of `<TOMCAT_HOME>/common/endorsed` 1. copied `<COCOON_HOME>/lib/endorsed/x*.jar` to `<TOMCAT_HOME>/common/endorsed` 1. built pluto-src-1.0.1-rc2 (`maven fullDeployment`) 1. ran `maven deploy -Ddeploy=<COCOON_HOME>/build/cocoon-2.1.6/cocoon.war` 1. deleted `<TOMCAT_HOME>/webapps/cocoon/WEB-INF/lib/pluto-1.0.1-rc1.jar` (makes trouble) 1. you can savely delete portlet-api-1.0.jar (optional) 1. modified `<PLUTO_HOME>/WEB-INF/data/portletcontexts.txt` {{{ /testsuite /cocoon }}} 1. modified `<PLUTO_HOME>/WEB-INF/data/portletentityregistry.xml` to include the following after the `<portlet-entity-registry>` node:{{{ <application id="9"> <definition-id>cocoon</definition-id> <portlet id="1"> <definition-id>cocoon.CocoonPortlet</definition-id> </portlet> </application> }}} 1. modified `<PLUTO_HOME>/WEB-INF/data/pageregistry.xml` to include the following after the `<portal>` node: {{{ <fragment name="cocoon" type="page"> <navigation> <title>Cocoon </title> <description>Cocoon distribution...</description> </navigation> <fragment name="row6" type="row"> <fragment name="col6" type="column"> <fragment name="p7" type="portlet"> <property name="portlet" value="9.1"/> </fragment> </fragment> </fragment> </fragment> }}} Your cocoon app should now be available as a portlet under http://localhost:8080/pluto/portal/cocoon [[Anchor(linkproblem)]]Anyway, clicking on a link in that portlet (assuming you've set `servlet-path`'s value to "`/`") doesn't work. The link to "samples" points to http://localhost:8080/pluto/portal/samples. Pointing manually to http://localhost:8080/pluto/portal/cocoon/samples is the same as http://localhost:8080/pluto/portal/cocoon.
