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

    Copyright (C) 2009 eXo Platform SAS.

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

    This software 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
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this software; if not, write to the Free
    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
    02110-1301 USA, or see the FSF site: http://www.fsf.org.

-->
<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
  <display-name>FCKeditor Test Application</display-name>
  <context-param>
    <param-name>org.exoplatform.frameworks.web.repositoryJNDIName</param-name>
    <param-value>repository</param-value>
    <description>Repository name</description>
  </context-param>

  <context-param>
    <param-name>org.exoplatform.frameworks.jcr.command.web.fckeditor.digitalAssetsWorkspace</param-name>
    <param-value>digital-assets</param-value>
    <description>Binary assets workspace name</description>
  </context-param>

  <context-param>
    <param-name>org.exoplatform.frameworks.jcr.command.web.fckeditor.digitalAssetsPath</param-name>
    <param-value>/</param-value>
    <description>Binary assets path</description>
  </context-param>

  <filter>
    <filter-name>SetCurrentIdentityFilter</filter-name> 
    <filter-class>org.exoplatform.services.security.web.SetCurrentIdentityFilter</filter-class> 
  </filter>

  <filter>
    <filter-name>ThreadLocalSessionProviderInitializedFilter</filter-name>
    <filter-class>org.exoplatform.frameworks.jcr.web.ThreadLocalSessionProviderInitializedFilter</filter-class>
  </filter>
  
  <filter-mapping>
    <filter-name>SetCurrentIdentityFilter</filter-name> 
    <url-pattern>/*</url-pattern> 
  </filter-mapping>

  <filter-mapping>
    <filter-name>ThreadLocalSessionProviderInitializedFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <listener>
    <listener-class>org.exoplatform.ws.frameworks.servlet.StandaloneContainerInitializedListener</listener-class>
  </listener>

  <!-- servlet>
    <servlet-name>DisplayJCRContent</servlet-name>
    <servlet-class>org.exoplatform.frameworks.jcr.web.DisplayJCRContentServlet</servlet-class>
      <init-param>
      <param-name>cache-control-max-age</param-name>
      <param-value>3600</param-value>
      <description>
        Indicates that the client is willing to accept a response whose age is no greater than the specified time in seconds
      </description>
      </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet -->
	
	<servlet>
    <servlet-name>Controller</servlet-name>
    <servlet-class>org.exoplatform.frameworks.jcr.web.CommandControllerServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
	
  <servlet>
    <servlet-name>RestServer</servlet-name>
    <description>eXo - Platform REST Server</description>
    <servlet-class>org.exoplatform.services.rest.servlet.RestServlet</servlet-class>
    <load-on-startup>4</load-on-startup>
  </servlet> 
 
  <!-- servlet-mapping>
    <servlet-name>DisplayJCRContent</servlet-name>
    <url-pattern>/jcr/*</url-pattern>
  </servlet-mapping -->

  <servlet-mapping>
    <servlet-name>RestServer</servlet-name>
    <url-pattern>/rest/*</url-pattern>
  </servlet-mapping>
	
  <servlet-mapping>
    <servlet-name>Controller</servlet-name>
    <url-pattern>/connector</url-pattern>
  </servlet-mapping>

  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>user authentication</web-resource-name>
      <url-pattern>/private/*</url-pattern>
      <url-pattern>/connector</url-pattern>
      <http-method>POST</http-method>
      <http-method>GET</http-method>
    </web-resource-collection>
    <auth-constraint>
      <role-name>users</role-name>
      <role-name>administrators</role-name>
    </auth-constraint>
    <user-data-constraint>
      <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
  </security-constraint>

  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>exo-domain</realm-name>
    <form-login-config>
      <form-login-page>/login.jsp</form-login-page>
      <form-error-page>/login-error.jsp</form-error-page>
    </form-login-config>
  </login-config>

  <security-role id="ID_EXO_USER">
    <description>a simple user role</description>
    <role-name>users</role-name>
  </security-role>
  <security-role id="ID_EXO_ADMIN">
    <description>a simple admin role</description>
    <role-name>administrators</role-name>
  </security-role>

</web-app>