<?xml version="1.0"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~ JBoss, a division of Red Hat                                              ~
  ~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
  ~ contributors as indicated by the @authors tag. See the                    ~
  ~ copyright.txt in the distribution for a full listing of                   ~
  ~ individual contributors.                                                  ~
  ~                                                                           ~
  ~ 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>
   <description>JBoss Portal</description>
   <!--
   <distributable/>
   -->

   <!-- Bridge portal user events -->
   <listener>
      <listener-class>org.jboss.portal.core.impl.api.event.ServletEventBridge</listener-class>
   </listener>
   
   <!--   Session listener to kill all sub-sessions -->
   <listener>
      <listener-class>org.jboss.portal.server.listener.SessionListener</listener-class>
   </listener>

   <!--   CMS listener to kill all CMS sessions -->
   <listener>
      <listener-class>org.osivia.portal.core.cms.SessionListener</listener-class>
   </listener>

   <!-- The portal servlet is the main entrance point -->
   <servlet>
      <servlet-name>PortalServletWithPathMapping</servlet-name>
      <servlet-class>org.jboss.portal.server.servlet.PortalServlet</servlet-class>
      <init-param>
         <param-name>asDefaultServlet</param-name>
         <param-value>false</param-value>
         <description>The servlet needs to know wether it is set as a default servlet or not</description>
      </init-param>
      <init-param>
         <param-name>controllerFactoryName</param-name>
         <param-value>portal:service=ControllerFactory</param-value>
         <description>The request controller factory for the portal servlet</description>
      </init-param>
      <load-on-startup>0</load-on-startup>
      <security-role-ref>
        <role-name>Authenticated</role-name>
        <role-link>Authenticated</role-link>
      </security-role-ref>
   </servlet>

   <!-- The portal servlet is the main entrance point -->
   <servlet>
      <servlet-name>PortalServletWithDefaultServletMapping</servlet-name>
      <servlet-class>org.jboss.portal.server.servlet.PortalServlet</servlet-class>
      <init-param>
         <param-name>asDefaultServlet</param-name>
         <param-value>true</param-value>
         <description>The servlet needs to know wether it is set as a default servlet or not</description>
      </init-param>
      <init-param>
         <param-name>controllerFactoryName</param-name>
         <param-value>portal:service=ControllerFactory</param-value>
         <description>The request controller factory for the portal servlet</description>
      </init-param>
      <load-on-startup>0</load-on-startup>
      <security-role-ref>
        <role-name>Authenticated</role-name>
        <role-link>Authenticated</role-link>
      </security-role-ref>
   </servlet>

   <!-- Provide access to unauthenticated users -->
   <servlet-mapping>
      <servlet-name>PortalServletWithPathMapping</servlet-name>
      <url-pattern>/*</url-pattern>
   </servlet-mapping>
   

   <!-- Provide secure access to unauthenticated users -->
   <!-- 
   <servlet-mapping>
      <servlet-name>PortalServletWithPathMapping</servlet-name>
      <url-pattern>/sec</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>PortalServletWithPathMapping</servlet-name>
      <url-pattern>/sec/*</url-pattern>
   </servlet-mapping>   
 -->
   <!-- Provide access to authenticated users -->
   <!-- 
   <servlet-mapping>
      <servlet-name>PortalServletWithPathMapping</servlet-name>
      <url-pattern>/auth</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>PortalServletWithPathMapping</servlet-name>
      <url-pattern>/auth/*</url-pattern>
   </servlet-mapping>   
    -->
   <!-- Provide secure access to authenticated users -->
   <!-- 
   <servlet-mapping>
      <servlet-name>PortalServletWithPathMapping</servlet-name>
      <url-pattern>/authsec</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>PortalServletWithPathMapping</servlet-name>
      <url-pattern>/authsec/*</url-pattern>
   </servlet-mapping>   
 -->
 
   <!-- Force the mapping of the jsp and images because of the default servlet replacement -->
   <servlet-mapping>
      <servlet-name>jsp</servlet-name>
      <url-pattern>/login.jsp</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>/images/login_bottom.png</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>/images/login_bottom_left.png</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>/images/login_bottom_right.png</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>/images/login_left.png</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>/images/login_right.png</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>/images/login_top.png</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>/images/login_top_left.png</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>/images/login_top_right.png</url-pattern>
   </servlet-mapping>

   <session-config>
      <session-timeout>20</session-timeout>
   </session-config>

   <!--
     | JDBC usage must be done with
     | DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/PortalDS";
     -->
   <resource-ref>
      <res-ref-name>jdbc/PortalDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Shareable</res-sharing-scope>
   </resource-ref>

   <security-constraint>
      <web-resource-collection>
         <web-resource-name>Authenticated</web-resource-name>
         <description></description>
         <url-pattern>/auth</url-pattern>
         <url-pattern>/auth/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
         <role-name>Authenticated</role-name>
      </auth-constraint>
   </security-constraint>

   <security-constraint>
     <web-resource-collection>
       <web-resource-name>Secure</web-resource-name>
       <url-pattern>/sec</url-pattern>
       <url-pattern>/sec/*</url-pattern>
     </web-resource-collection>
     <user-data-constraint>
       <transport-guarantee>CONFIDENTIAL</transport-guarantee>
     </user-data-constraint>
   </security-constraint>

   <security-constraint>
     <web-resource-collection>
       <web-resource-name>Secure+Authenticated</web-resource-name>
       <url-pattern>/authsec</url-pattern>
       <url-pattern>/authsec/*</url-pattern>
     </web-resource-collection>
     <auth-constraint>
       <role-name>Authenticated</role-name>
     </auth-constraint>
     <user-data-constraint>
       <transport-guarantee>CONFIDENTIAL</transport-guarantee>
     </user-data-constraint>
   </security-constraint>

   <!--
     | Uncomment to use BASIC authentication scheme. Don't forget to comment other
     | form authentication.
     -->
   <!--
   <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>JBoss Portal</realm-name>
   </login-config>
   -->

   <!--
     | Uncomment to use FORM authentication scheme. Don't forget to comment other
     | form authentication.
     -->
   <!--
   -->
   <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>JBoss Portal</realm-name>
      <form-login-config>
         <form-login-page>/login.jsp</form-login-page>
         <form-error-page>/login.jsp</form-error-page>
      </form-login-config>
   </login-config>

   <security-role>
      <role-name>Authenticated</role-name>
   </security-role>
  
</web-app>
