<?xml version="1.0"?>
<!--

    openHAB, the open Home Automation Bus.
    Copyright (C) 2011, openHAB.org <admin@openhab.org>

    See the contributors.txt file in the distribution for a
    full listing of individual contributors.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, see <http://www.gnu.org/licenses>.

    Additional permission under GNU GPL version 3 section 7

    If you modify this Program, or any covered work, by linking or
    combining it with Eclipse (or a modified version of that library),
    containing parts covered by the terms of the Eclipse Public License
    (EPL), the licensors of this Program grant you additional permission
    to convey the resulting work.

-->

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<!-- =============================================================== -->
<!-- Configure Jetty Plus features                                   -->
<!--                                                                 -->
<!-- This file sets up a WebAppDeployer to automatically deploy all  -->
<!-- webapps in $jetty.home/webapps-plus at startup time, and to     -->
<!-- enable all of them with Plus features (jndi etc).               -->
<!--                                                                 -->
<!-- You can instead configure individual webapps with Jetty Plus    -->
<!-- features by using the ContextDeployer (configured in            -->
<!-- $jetty.home/etc/jetty.xml), and ensuring that you set the       -->
<!-- same set of classes listed below in the "plusConfig" as the     -->
<!-- webapp's configurationClasses.                                  -->
<!--                                                                 -->
<!-- For more information about Jetty Plus, see the Jetty wiki at    -->
<!-- http://docs.codehaus.org/display/JETTY/Jetty+Wiki               -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">

  <!-- =========================================================== -->
  <!-- Example JAAS realm setup.                                   -->
  <!-- The LoginModuleName must be exactly the same as in the      -->
  <!-- login.conf file, and the realm Name must be the same as in  -->
  <!-- the web.xml file.                                           -->
  <!-- =========================================================== -->
  <!-- 
  <Call name="addLoginService">
    <Arg>
      <New class="org.eclipse.jetty.plus.jaas.JAASLoginService">
	      <Set name="name">xyzrealm</Set>
	      <Set name="LoginModuleName">xyz</Set>
	    </New>
    </Arg>
  </Call>
  -->

  <!-- =========================================================== -->
  <!-- Configurations for WebAppContexts                           -->
  <!-- Sequence of configurations to enable Plus features.         -->
  <!-- =========================================================== -->
  <Array id="plusConfig" type="java.lang.String">
    <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
    <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
    <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
    <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
    <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
    <Item>org.eclipse.jetty.plus.webapp.Configuration</Item>
    <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
    <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>
  </Array>

  <!-- =========================================================== -->
  <!-- Deploy all webapps in webapps-plus                          -->
  <!-- =========================================================== -->
  <!-- Uncomment the following to set up a WebAppDeployer that will -->
  <!-- deploy webapps from a directory called webapps-plus. Note    -->
  <!-- that you will need to create this directory first!           -->
  <!--
    <Call name="addLifeCycle">
      <Arg>
        <New class="org.eclipse.jetty.deploy.WebAppDeployer">
          <Set name="contexts"><Ref id="Contexts"/></Set>
          <Set name="webAppDir"><Property name="jetty.home" default="."/>/webapps-plus</Set>
          <Set name="parentLoaderPriority">false</Set>
          <Set name="extract">true</Set>
          <Set name="allowDuplicates">false</Set>
          <Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
          <Set name="configurationClasses"><Ref id="plusConfig"/></Set>
          <Call name="setAttribute">
            <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
            <Arg>.*/jsp-api-[^/]*\.jar$|.*/jsp-[^/]*\.jar$</Arg>
          </Call>
        </New>
      </Arg>
    </Call>
   -->

</Configure>

