<?xml version="1.0"  encoding="ISO-8859-1"?> 
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN"
                           "http://jetty.mortbay.org/configure_1_2.dtd">

<!-- =============================================================== -->
<!-- Configure the Jetty Server                                      -->
<!-- =============================================================== -->
<Configure class="org.mortbay.jetty.Server">

  <!-- =============================================================== -->
  <!-- Configure the Request Listeners                                 -->
  <!-- =============================================================== -->

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add and configure a HTTP listener to port 8080                  -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.SocketListener">
        <Set name="Port">8080</Set>
        <Set name="MinThreads">5</Set>
        <Set name="MaxThreads">100</Set>
        <Set name="MaxIdleTimeMs">30000</Set>
        <Set name="LowResourcePersistTimeMs">5000</Set>
      </New>
    </Arg>
  </Call>

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add a HTTPS SSL listener on port 8843                           -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- UNCOMMENT TO ACTIVATE
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.SunJsseListener">
        <Set name="Port">8443</Set>
        <Set name="MinThreads">5</Set>
        <Set name="MaxThreads">100</Set>
        <Set name="MaxIdleTimeMs">30000</Set>
        <Set name="LowResourcePersistTimeMs">2000</Set>
        <Set name="Keystore"><SystemProperty name="cocoon.home" default="."/>/etc/demokeystore</Set>
        <Set name="Password">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
        <Set name="KeyPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
      </New>
    </Arg>
  </Call>
  -->

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add and configure a NIO HTTP listener to port 8888               -->
  <!-- This listener should be used to replace the standard HTTP       -->
  <!-- listener when deployed on LARGE systems using jdk 1.4           -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- UNCOMMENT TO ACTIVATE
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.SocketChannelListener">
        <Set name="Port">8080</Set>
        <Set name="MinThreads">5</Set>
        <Set name="MaxThreads">500</Set>
        <Set name="MaxIdleTimeMs">30000</Set>
      </New>
    </Arg>
  </Call>
  -->

  <!-- =============================================================== -->
  <!-- Configure the Contexts                                           -->
  <!-- =============================================================== -->
  <Call name="addContext">
    <!--
      The "context path", or in other words, the URL path under which this
      context is deployed.
    -->
    <Arg>/</Arg>

    <!--
      This call will set up the context class path relative to the Cocoon
      context. All jars and zip files in the directory will be available.
    -->
    <Set name="ClassPath"><SystemProperty name="cocoon.classes" default="./classes"/></Set>
    <Call name="setClassPaths">
      <Arg><SystemProperty name="cocoon.lib" default="./lib"/></Arg>
      <Arg type="boolean">true</Arg>
    </Call>

    <!--
      This call will set up the context resource base path, in other words
      the directory against which calls to Context.getResource... will be
      resolved.
    -->
    <Set name="ResourceBase"><SystemProperty name="cocoon.root" default="./root"/></Set>

    <!--
      Add our only servlet to the context, the Cocoon servlet
    -->
    <Call name="addServlet">
      <Arg>/</Arg>
      <Arg>org.apache.cocoon.servlet.ParanoidCocoonServlet</Arg>
      
      <!--
        If we want to load the CocoonServlet servlet on startup its
        "init order" must be >=0.
        This can be commented out if Cocoon must not be started on
        startup automatically.
      -->
      <Set name="InitOrder" type="int">0</Set>

      <!--
        This parameter points to the main configuration file for Cocoon.
        Note that the path is specified in absolute notation but it will be
        resolved relative to the servlets webapp context path
      -->
      <Put name="configurations"><SystemProperty name="cocoon.home" default="."/>/etc/cocoon.xconf</Put>

      <!--
        This parameter indicates the configuration file of the LogKit management
      -->
      <Put name="logkit-config"><SystemProperty name="cocoon.home" default="."/>/etc/logkit.xconf</Put>

      <!--
        This parameter allows to specify where Cocoon should put it's
        working files. The path specified is either absolute or relative
        to the context path of the Cocoon servlet.  On windows platform,
        absolute directory must start with volume: C:\Path\To\Work\Directory
  
        The default directory is "cocoon-files" directory in the servlet
        context's temp directory (context property javax.servlet.context.tempdir).
      -->

      <Put name="work-directory"><SystemProperty name="cocoon.work" default="./work"/></Put>

      <!--
        This parameter allows to specify where Cocoon should create its page
        and other objects cache. The path specified can be either absolute or
        relative to the context path of the servlet. On windows platform,
        absolute directory must start with volume: C:\Path\To\Cache\Directory
  
        The default directory is "cache-dir" in the work-directory

      <Put name="cache-directory"><SystemProperty name="cocoon.work" default="./work"/>/cache-dir</Put>
      -->

      <!--
        This parameter allows to specify where Cocoon should put uploaded files.
        The path specified can be either absolute or relative to the context
        path of the servlet. On windows platform, absolute directory must start
        with volume: C:\Path\To\Upload\Directory
  
        The default directory is "upload-dir" in the work-directory

      <Put name="upload-directory"><SystemProperty name="cocoon.work" default="./work"/>/upload-dir</Put>
      -->

      <!--
        This parameter allows to specify additional directories or jars
        which Cocoon should put into it's own classpath.
        Note that you must separate them using the platforms path.separator
        (":" for *nix and ";" for Windows systems). Also note that absolute
        pathes are take as such but relative pathes are rooted at the context
        root of the Cocoon servlet.
  
      <Put name="extra-classpath">WEB-INF/extra-classes1:/[YOU-ABSOLUTE-PATH-TO]/own.jar</Put>
      -->

      <!--
        This parameter tells cocoon to set the thread's context classloader to
        its own classloader. If you experience strange classloader issues,
        try setting this parameter to "true" or using ParanoidCocoonServlet.
      -->
      <Put name="init-classloader">true</Put>
  
  
      <!--
        This parameter indicates the category id of the logger from the LogKit
        configuration used by the CocoonServlet.
      -->
      <Put name="servlet-logger">access</Put>

      <!--
        This parameter indicates the category id of the logger from the LogKit
        management configuration for the Cocoon engine.
        This logger is used for all components described in the cocoon.xconf
        and sitemap.xmap file not having specified a logger with the
        logger="..." attribute in the component configuration file.
      -->
      <Put name="cocoon-logger">core</Put>
  
      <!--
        This parameter indicates the log level to use throughout startup of the system.
        As soon as the logkit.xconf the setting of the logkit.xconf configuration is
        used instead! Only for startup and if the logkit.xconf is not readable/available
        this log level is of importance.

        Available levels are:
          DEBUG:        prints all level of log messages.
          INFO:         prints all level of log messages except DEBUG ones.
          WARN:         prints all level of log messages except DEBUG and INFO ones.
          ERROR:        prints all level of log messages except DEBUG, INFO and WARN ones.
          FATAL_ERROR:  prints only log messages of this level
      -->
      <Put name="log-level">DEBUG</Put>

      <!--
        Allow reinstantiating (reloading) of the cocoon instance. If this is
        set to "yes" or "true", a new cocoon instance can be created using
        the request parameter "cocoon-reload".
      -->
      <Put name="allow-reload">yes</Put>

      <!--
        This parameter is used to list classes that should be loaded
        at initialization time of the servlet.
        Usually this classes are JDBC Drivers used
      -->
      <Put name="load-class">org.hsqldb.jdbcDriver</Put>
  
      <!--
        Causes all files in multipart requests to be saved to upload-dir.
        Default is true.  Unsupported values will be interpreted as false.
      -->
      <Put name="autosave-uploads">false</Put>

      <!--
        Specify handling of name conflicts when saving uploaded files
        to disk.  Acceptable values are deny, allow, rename (default).
        Files are renamed x_filename where x is an integer value incremented
        to make the new filename unique.
      -->
      <Put name="overwrite-uploads">rename</Put>
  
      <!--
        Specify maximum allowed size of the upload. Defaults to 10 Mb.
  
      <Put name="upload-max-size">10000000</Put>
      -->

      <!--
        This parameter allows you to select the parent component manager.
        The class will be instantiated via the constructor that takes a single
        String as a parameter. That String will be equal to the text after the
        '/'.
  
        Cocoon honors the Loggable and Initializable interfaces for this class,
        if it implements them.
  
        If you uncomment the following lines the parent CM is set to the Parent CM sample, which will look up
        a configuration via JNDI at org/apache/cocoon/samples/parentcm/ParentCMConfiguration
        and use it.

      <Put name="parent-component-manager">org.apache.cocoon.samples.parentcm.ParentComponentManager/org/apache/cocoon/samples/parentcm/ParentCMConfiguration</Put>
      -->

      <!--
        This parameter allows you to select the request factory. Possible
        choices are as follows:
          - org.apache.cocoon.components.request.MultipartRequestFactoryImpl
            This is the default factory.
          - org.apache.cocoon.components.request.MaybeUploadRequestFactoryImpl
            You can opt in for this factory if maybeupload.jar is
            present.
          - org.apache.cocoon.components.request.SimpleRequestFactoryImpl
            This factory does not allow uploads.
      -->
      <Put name="request-factory">org.apache.cocoon.components.request.MultipartRequestFactoryImpl</Put>
  
      <!--
        If you set this parameter to 'true' or 'yes', Cocoon will add processing
        time to the end of each response. Value 'hide' adds processing time as an HTML
        comment. By default, processing time is not added (corresponds to value 'no').
  
      <Put name="show-time>hide</Put>
      -->
  
      <!--
         If true or not set, this class will try to catch and handle all Cocoon exceptions.
         If false, it will rethrow them to the servlet container.
      -->
      <Put name="manage-exceptions">true</Put>

    </Call>

  </Call>

  <!-- =============================================================== -->
  <!-- Configure the Request Log                                       -->
  <!-- =============================================================== -->
  <!-- UNCOMMENT TO ACTIVATE
  <Set name="RequestLog">
    <New class="org.mortbay.http.NCSARequestLog">
      <Arg><SystemProperty name="cocoon.home" default="."/>/logs/yyyy_mm_dd.request.log</Arg>
      <Set name="retainDays">90</Set>
      <Set name="append">true</Set>
      <Set name="extended">false</Set>
      <Set name="buffered">true</Set>
      <Set name="LogTimeZone">GMT</Set>
    </New>
  </Set>
  -->

</Configure>
