<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- $This file is distributed under the terms of the license in LICENSE$ -->

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
	      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0">

  <!-- Environment variables for the Vitro web application -->
  <!-- Example: -->
  <!-- <env-entry><env-entry-name>somename/required</env-entry-name> -->
  <!--            <description>optional desc </description> -->
  <!--            <env-entry-value>some kind of value, required</env-entry-value> -->
  <!--            <env-entry-type>(required)java.lang.String || java.lang.Integer ||  -->
  <!--            java.lang.Double || java.lang.Boolean || java.lang.Float</env-entry-type> -->
  <!-- </env-entry> -->

  <env-entry>
    <env-entry-name>jdbc/vitro/connectionType</env-entry-name>
    <!--
           				How to get a DataSource, Valid valies:
                        SERVER_XML_POOL gets a named DataSource connection from the
                        JNDI context, most likely that was set up tomcat/conf/server.xml
                        PROPERTIES_FILE_POOL makes a DataSource using properties from
                        a file in the classpath at /beans/connection.properties
           -->
    <!--            <env-entry-value>SERVER_XML_POOL</env-entry-value> -->
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>PROPERTIES_FILE_POOL</env-entry-value>
  </env-entry>


  <env-entry>
    <env-entry-name>jdbc/vitro/namedDS</env-entry-name>
    <!--This is the name of the JNDI named DataSource for use with SERVER_XML_POOL-->
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>mySharedDBPool</env-entry-value>
  </env-entry>
  <!-- end environment vars -->

  <!-- Listeners ****************************************************** -->

  <!--
      StartupManager instantiates and runs the listeners from startup_listeners.txt
      All ServletContextListeners should be listed there, not here.
  -->
  <listener>
    <listener-class>edu.cornell.mannlib.vitro.webapp.startup.StartupManager</listener-class>
  </listener>

  <!-- TwelveMonkeys ImageIO listener -->
  <listener>
    <display-name>ImageIO service provider loader/unloader</display-name>
    <listener-class>com.twelvemonkeys.servlet.image.IIOProviderContextListener</listener-class>
  </listener>

  <!-- Filters ********************************************************** -->
  <!-- Using filter-mappings to specify the correct filter chain order -->

  <filter-mapping>
    <filter-name>Startup Status Display Filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>Session Timeout Limiting Filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>Character Set Encoding Filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>Locale selection filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <!-- If language support is enabled, this must not precede the LocaleSelectionFilter -->
  <filter-mapping>
    <filter-name>Caching Response filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>JSession Strip Filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>URL Rewriter Filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>RequestModelsPrep</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
  </filter-mapping>
  <filter-mapping>
    <filter-name>ClickjackFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
  </filter-mapping>
  <filter-mapping>
    <filter-name>PageRoutingFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
  </filter-mapping>

  <filter>
    <filter-name>ExpiresFilter</filter-name>
    <filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
    <init-param>
      <param-name>ExpiresByType image</param-name>
      <param-value>access plus 1 week</param-value>
    </init-param>
    <init-param>
      <param-name>ExpiresByType text/css</param-name>
      <param-value>access plus 1 week</param-value>
    </init-param>
    <init-param>
      <param-name>ExpiresByType application/javascript</param-name>
      <param-value>access plus 1 week</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>ExpiresFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
  </filter-mapping>

  <!-- DWR servlet -->
  <servlet>
    <servlet-name>dwr-invoker</servlet-name>
    <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>logLevel</param-name>
      <param-value>DEBUG</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
  </servlet-mapping>

 <!-- THIS SHOULD BE COMMENTED OUT FOR PRODUCTION
  <servlet>
    <servlet-name>FakeExternalAuthController</servlet-name>
    <servlet-class>edu.cornell.mannlib.vitro.webapp.controller.authenticate.FakeExternalAuthController</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>FakeExternalAuthController</servlet-name>
    <url-pattern>/admin/fakeExternalAuth</url-pattern>
  </servlet-mapping>
-->

  <!-- ==================== mime types ============================== -->

  <mime-mapping>
    <extension>css</extension>
    <mime-type>text/css</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>gif</extension>
    <mime-type>image/gif</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>GIF</extension>
    <mime-type>image/gif</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>htm</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>ico</extension>
    <mime-type>image/x-icon</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>jpeg</extension>
    <mime-type>image/jpeg</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>jpg</extension>
    <mime-type>image/jpeg</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>js</extension>
    <mime-type>application/javascript</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>png</extension>
    <mime-type>image/png</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>svg</extension>
    <mime-type>image/svg+xml</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>xml</extension>
    <mime-type>application/xml</mime-type>
  </mime-mapping>

  <!-- ==================== tag libraries ============================== -->
  <jsp-config>
    <taglib>
      <taglib-uri>/WEB-INF/tlds/database.tld</taglib-uri>
      <taglib-location>/WEB-INF/tlds/database.tld</taglib-location>
    </taglib>

    <taglib>
      <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
      <taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
    </taglib>

    <taglib>
      <taglib-uri>http://java.sun.com/jsp/jstl/functions</taglib-uri>
      <taglib-location>/WEB-INF/tlds/fn.tld</taglib-location>
    </taglib>

    <taglib>
      <taglib-uri>http://vitro.mannlib.cornell.edu/edit/tags</taglib-uri>
      <taglib-location>/WEB-INF/tlds/form.tld</taglib-location>
    </taglib>

    <taglib>
      <taglib-uri>http://vitro.mannlib.cornell.edu/vitro/tags</taglib-uri>
      <taglib-location>/WEB-INF/tlds/vitroForm.tld</taglib-location>
    </taglib>

    <taglib>
      <taglib-uri>http://jakarta.apache.org/taglibs/string-1.1</taglib-uri>
      <taglib-location>/WEB-INF/tlds/taglibs-string.tld</taglib-location>
    </taglib>
  </jsp-config>

</web-app>
