Portal Paths
This file is meant to be a starting point for people who want to move the sample portal (as from cocoon 2.1.8.) to another location. I hope that this document will grow, so it can be of use to as many users as possible.
What I did: I built and deployed cocoon 2.1.8. into my Tomcat webapps directory. The path that contains the build is directory-where-my-tomcat-is/webapps/copo/
(i.e. _co_coon _po_rtal). In this folder you'll find a few other folders, namely
- resources
samples (which contains the portal [in
blocks/portal/
])- stylesheets
- test-suite
- WEB-INF
What I did then was move the folder portal/
from copo/samples/blocks/
to copo/
. This meant that I had to change some paths inside the configuration files, the most important one being the cocoon.xconf
. This file is located in the folder WEB-INF/
inside copo/
. The first thing you need to change is the uri-prefix inside the projectpath-configuration. The uri-prefix, in my case, is set in line 251. The code should look like this:
<component-instance class="org.apache.cocoon.components.modules.input.ProjectPathModule" logger="core.modules.input" name="portalpath"> <uri-prefix>samples/blocks/portal/</uri-prefix> </component-instance>
Note that the path is relative to the build-path of your cocoon-build. Change the samples/blocks/portal/
to the path where your portal-folder is inside your cocoon-build-path (in my case copo/
). In my case this is of course portal/
: <uri-prefix>portal/</uri-prefix>
Secondly you want to change the skin base-path of your cocoon portal. This is also done in cocoon.xconf, somewhere around line 1666. I removed the samples/blocks/
from the following lines of code
<skins> <skin base-path="context://samples/blocks/portal/skins/basic" name="basic"> <thumbnail-path>images/thumb.jpg</thumbnail-path> </skin> <skin base-path="context://samples/blocks/portal/skins/common" name="common"> <thumbnail-path>images/thumb.jpg</thumbnail-path> </skin> </skins>
Basically the same needs to be done to the file sitemap.xmap
inside the portal/
-folder. Somewhere near line 145 the paths to where to save the profiles are set. It should look something like
<map:match pattern="save-user-profile"> <map:generate src="resources/save-user-profile.xml"/> <map:transform src="styles/save-user-profile.xsl"> <map:parameter name="profiles" value="context://samples/blocks/portal/profiles/"/> </map:transform> <map:transform type="session"/> <map:transform type="write-source"/> <map:serialize type="xml"/> </map:match>
Also here, I changed the value of attribute value
inside <map:parameter/>
to the correct path, being portal/profiles/
.
Basically, that's it. Good luck.