Installation Details

by Konstantin Piroumian

Note:
It is assumed that you have installed Cocoon 2.0 in <cocoon> directory.
  1. Copy mylogic.xsl and db.xsl to <cocoon>/WEB-INF/classes/spain/logicsheet directory.

  2. Add these lines to cocoon.xconf (see provided cocoon.xconf, line 146):

    <!-- Simple logicsheet demonstration -->
      <builtin-logicsheet>
        <parameter name="prefix" value="mylogic"/>
        <parameter name="uri" value="http://hostname/mylogic/1.0"/>
        <parameter name="href" value="resource://spain/logicsheet/mylogic.xsl"/>
      </builtin-logicsheet>
    
    <!-- Nested logicsheet demonstration -->
      <builtin-logicsheet>
        <parameter name="prefix" value="db"/>
        <parameter name="uri" value="http://hostname/db/1.0"/>
        <parameter name="href" value="resource://spain/logicsheet/db.xsl"/>
      </builtin-logicsheet>

    or simply replace the original cocoon.xconf by cocoon.xconf from this example.

    Now you have installed and configured logicsheets. Now we can install samples.

  3. Create a directory in the cocoon web app root like this: <cocoon>/spain.

  4. Copy simple.xsp, db.xsp, spain.xsl files to <cocoon>/spain directory.

  5. Modify your sitemap, add these lines to the <map:pipelines> section:

    <!-- Special pipeline for Spain samples -->
        <map:pipeline>
          <map:match pattern="spain/*.xsp">
            <map:generate type="serverpages" src="spain/{1}.xsp"/>
            <map:transform src="spain/spain.xsl"/>
            <map:serialize />
          </map:match>			
        </map:pipeline>

    or replace the original sitemap.xmap with the provided one from this example Note, that it is not required to have a special pipeline, you can simply add the <map:match> to any existing non-internal pipeline.

  6. Shutdown your servlet engine.

  7. Clear Cocoon working directory (for Tomcat it's <TOMCAT_HOME>/work/<cocoon>).

  8. Startup servlet engine.

  9. Type:

    http://localhost:8080/cocoon/spain/simple.xsp

    then

    http://localhost:8080/cocoon/spain/db.xsp

  10. Enjoy ;)