<?xml version="1.0" encoding="UTF-8"?>
<!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>
    <context-param>
        <param-name>com.sun.jsftemplating.DEBUG</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.jsftemplating.FS_DENY_PATHS</param-name>
        <param-value>META-INF/:WEB-INF/:*.jsf:*.inc:*.xhtml:*.xml</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.jsftemplating.CLASSLOADER</param-name>
        <param-value>org.glassfish.admingui.common.plugin.ConsoleClassLoader</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.jsftemplating.RESOURCE_PREFIX</param-name>
        <param-value>/html</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.VALIDATE_EMPTY_FIELDS</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.validator.DISABLE_DEFAULT_BEAN_VALIDATOR</param-name>
        <param-value>true</param-value>
    </context-param>

    <filter>
        <filter-name>UploadFilter</filter-name>
        <filter-class>com.sun.webui.jsf.util.UploadFilter</filter-class>
        <init-param>
            <param-name>maxSize</param-name>
            <param-value>-1</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>UploadFilter</filter-name>
        <servlet-name>FacesServlet</servlet-name>
    </filter-mapping>
    <servlet>
        <servlet-name>FacesServlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>jMaki XmlHttpProxy Servlet</servlet-name>
        <servlet-class>jmaki.xhp.XmlHttpProxyServlet</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>ThemeServlet</servlet-name>
        <servlet-class>com.sun.webui.theme.ThemeServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>FacesServlet</servlet-name>
        <url-pattern>/resource/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>jMaki XmlHttpProxy Servlet</servlet-name>
        <url-pattern>/xhp</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>FacesServlet</servlet-name>
        <url-pattern>/html/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>FacesServlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>FacesServlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>ThemeServlet</servlet-name>
        <url-pattern>/theme/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>/index.jsf</welcome-file>
    </welcome-file-list>
    <error-page>
	<exception-type>javax.faces.application.ViewExpiredException</exception-type>
        <location>/</location>
    </error-page>
    <error-page>
	<error-code>403</error-code>
	<location>/accessDenied.jsf</location>
    </error-page>
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>noaccess</web-resource-name>
            <url-pattern>/theme/*</url-pattern>
            <http-method>DELETE</http-method>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>PUT</http-method>
        </web-resource-collection>
        <auth-constraint>
            <role-name>noaccess</role-name>
        </auth-constraint>
    </security-constraint>
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>protected</web-resource-name>
            <url-pattern>*.jsf</url-pattern>
            <url-pattern>/download/*</url-pattern>
            <!-- We need to change this when we have a fix for the plugin url security issue -->
            <!--<url-pattern>/resource/*</url-pattern>-->
            <http-method>DELETE</http-method>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>PUT</http-method>
        </web-resource-collection>
        <auth-constraint>
            <role-name>admin</role-name>
        </auth-constraint>
    </security-constraint>
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>public</web-resource-name>
            <url-pattern>/theme/com/*</url-pattern>
            <url-pattern>/theme/org/*</url-pattern>        
            <url-pattern>/accessDenied.jsf</url-pattern>
            <url-pattern>/resource/*</url-pattern>
            <!--<url-pattern>/resource/theme/*</url-pattern>-->           		
            <!--<url-pattern>/resource/js/*</url-pattern>-->
            <!--<url-pattern>/resource/css/*</url-pattern>-->
            <!--<url-pattern>/resource/images/*</url-pattern>-->
            <url-pattern>/theme/META-INF/*</url-pattern>
            <http-method>GET</http-method>
        </web-resource-collection>
    </security-constraint>
    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>admin-realm</realm-name>
        <form-login-config>
            <form-login-page>/login.jsf</form-login-page>
            <form-error-page>/loginError.jsf</form-error-page>
        </form-login-config>
    </login-config>
    <security-role>
        <role-name>admin</role-name>
    </security-role>
</web-app>
