<?xml version="1.0" encoding="UTF-8"?>
<!-- ****************************************** {COPYRIGHT-TOP} **
* Aperi Storage Manager
* (C) Copyright Eclipse contributors and others. 2007
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************* {COPYRIGHT-END} * -->

<!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>Aperi Reports</display-name>
	
	<context-param>
		<param-name>ReportRepository</param-name>
		<param-value>C:/Aperi/reports</param-value>
	</context-param>
	<context-param>
		<param-name>jdbcUrl</param-name>
		<param-value>jdbc:derby://localhost:1527/Aperi</param-value>
	</context-param>
	<context-param>
		<param-name>jdbcDriver</param-name>
		<param-value>org.apache.derby.jdbc.ClientDriver</param-value>
	</context-param>
	<context-param>
		<param-name>jdbcUser</param-name>
		<param-value>Aperi</param-value>
	</context-param>
	<context-param>
		<param-name>jdbcPassword</param-name>
		<param-value>@db_pwd@</param-value>
	</context-param>
	<context-param>
		<param-name>jdbcSchema</param-name>
		<param-value>Aperi</param-value>
	</context-param>
	
	<servlet>
		<servlet-name>TreeControl</servlet-name>
		<display-name>TreeControl</display-name>
		<servlet-class>org.eclipse.aperi.reporting.TreeControl</servlet-class>
	</servlet>
	<servlet>
		<servlet-name>UploadReport</servlet-name>
		<display-name>UploadReport</display-name>
		<servlet-class>org.eclipse.aperi.reporting.UploadReport</servlet-class>
	</servlet>
	<servlet>
		<servlet-name>ReportInfo</servlet-name>
		<display-name>ReportInfo</display-name>
		<servlet-class>org.eclipse.aperi.reporting.ReportInfo</servlet-class>
	</servlet>
	<servlet>
		<servlet-name>EditReport</servlet-name>
		<display-name>EditReport</display-name>
		<servlet-class>org.eclipse.aperi.reporting.EditReport</servlet-class>
	</servlet>
	<servlet>
		<servlet-name>Delete</servlet-name>
		<display-name>Delete</display-name>
		<servlet-class>org.eclipse.aperi.reporting.Delete</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>TreeControl</servlet-name>
		<url-pattern>/TreeControl</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>UploadReport</servlet-name>
		<url-pattern>/UploadReport</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>ReportInfo</servlet-name>
		<url-pattern>/ReportInfo</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>EditReport</servlet-name>
		<url-pattern>/EditReport</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>Delete</servlet-name>
		<url-pattern>/Delete</url-pattern>
	</servlet-mapping>

	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
	
 <!-- authentication/authorization -->
 	<security-constraint>
		<web-resource-collection>
			<web-resource-name>
				My Protected Resources
			</web-resource-name>
			<url-pattern>/</url-pattern>
		</web-resource-collection>
	</security-constraint>
 	<security-constraint>
 		<display-name>Security constraint for the /bar folder</display-name>
 		<web-resource-collection> 
			<web-resource-name>Authenticated</web-resource-name> 
			<url-pattern>/bar/*</url-pattern>
			<url-pattern>/TreeControl</url-pattern>
			<url-pattern>/ReportInfo</url-pattern>
		</web-resource-collection>
		<auth-constraint>
 			<role-name>*</role-name>
		</auth-constraint>
 	</security-constraint>
	<security-constraint>
		<web-resource-collection>
			<web-resource-name>UploadReport</web-resource-name>
			<url-pattern>/UploadReport</url-pattern>
		</web-resource-collection>
		<auth-constraint>
			<role-name>Superuser</role-name>
		</auth-constraint>
	</security-constraint>
      <security-constraint>
		<web-resource-collection>
			<web-resource-name>Delete</web-resource-name>
			<url-pattern>/Delete</url-pattern>
		</web-resource-collection>
		<auth-constraint>
			<role-name>Superuser</role-name>
		</auth-constraint>
	</security-constraint>
	<security-constraint>
		<web-resource-collection>
			<web-resource-name>EditReport</web-resource-name>
			<url-pattern>/EditReport</url-pattern>
		</web-resource-collection>
		<auth-constraint>
			<role-name>Superuser</role-name>
		</auth-constraint>
	</security-constraint>

	<login-config>
		<auth-method>BASIC</auth-method>
		<realm-name>OSRealm</realm-name>
	</login-config>
	<security-role>
 		<role-name>Superuser</role-name> 
	</security-role>
 	<security-role> 
		<role-name>Aperi Administrator</role-name>
 	</security-role>
 	
</web-app>
