<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!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>HelloWorld-DN</display-name>
  <description>Hello World Description</description>

  <servlet>
    <servlet-name>JetspeedContainer</servlet-name>
    <display-name>Jetspeed Container</display-name>
    <description>MVC Servlet for Jetspeed Portlet Applications</description>
    <servlet-class>org.apache.jetspeed.container.JetspeedContainerServlet</servlet-class>
  </servlet>

  	<!-- Define Velocity Servlet -->
	<servlet>
		<servlet-name>velocity</servlet-name>
		<servlet-class>org.apache.portals.bridges.velocity.BridgesVelocityViewServlet</servlet-class>
		<init-param>
			<param-name>org.apache.velocity.toolbox</param-name>
			<param-value>/WEB-INF/velocity/toolbox.xml</param-value>
		</init-param>
		<init-param>
			<param-name>org.apache.velocity.properties</param-name>
			<param-value>/WEB-INF/velocity/velocity.properties</param-value>
		</init-param>
		<load-on-startup>10</load-on-startup>
	</servlet>

  <servlet>
    <servlet-name>SSODemo</servlet-name>
    <display-name>SSODemo Servlet</display-name>
    <description>Servlet for Testing SSO</description>
    <servlet-class>org.apache.jetspeed.demo.servlet.SSODemoServlet</servlet-class>
  </servlet>       

  <servlet>
    <servlet-name>SSOBasicDemo</servlet-name>
    <display-name>SSOBasicDemo Servlet</display-name>
    <description>Servlet for Testing HTTP Basic Authentication SSO</description>
    <servlet-class>org.apache.jetspeed.demo.servlet.SSOBasicDemoServlet</servlet-class>
  </servlet>       

	<servlet-mapping>
		<servlet-name>SSODemo</servlet-name>
		<url-pattern>/sso-demo</url-pattern>
	</servlet-mapping>	

	<servlet-mapping>
		<servlet-name>SSOBasicDemo</servlet-name>
		<url-pattern>/sso-basic</url-pattern>
	</servlet-mapping>	
	
    <!-- Map *.vm files to Velocity  -->
	<servlet-mapping>
		<servlet-name>velocity</servlet-name>
		<url-pattern>*.vm</url-pattern>
	</servlet-mapping>	

  <servlet-mapping>
     <servlet-name>
        JetspeedContainer
     </servlet-name>
     <url-pattern>
       /container/*
     </url-pattern>
  </servlet-mapping>
  
  <!-- Portlet tag library TLD -->
  <taglib>
    <taglib-uri>portlet.tld</taglib-uri>
    <taglib-location>/WEB-INF/portlet.tld</taglib-location>
  </taglib>
  
  <!-- JSTL tag library TLDs -->
  <taglib>
    <taglib-uri>c-rt.tld</taglib-uri>
    <taglib-location>/WEB-INF/c-rt.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>c.tld</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
  </taglib>
  
  <!-- JNDI Db resource -->
   <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/demo</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>
  
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>HTTPBasicDemo</web-resource-name>
      <url-pattern>/sso-basic/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
       <role-name>tomcat</role-name>
    </auth-constraint>
  </security-constraint>

  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Jetspeed</realm-name>
  </login-config>

  <security-role>
    <description>The role that is required to log in to the Agent</description>    
    <role-name>agent</role-name>
  </security-role>


  <security-role>
    <description>The admin role</description>
    <role-name>admin</role-name>
  </security-role>
  
  <security-role>
    <description>The manager role</description>
    <role-name>manager</role-name>
  </security-role>
  
  <security-role>
    <description>The user role</description>
    <role-name>user</role-name>
  </security-role>
  
</web-app>
