<!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>BPM Console UI</display-name>

    <error-page>
        <error-code>403</error-code>
        <location>/403.html</location>
    </error-page>

    <listener>
      <listener-class>
        org.jboss.bpm.console.server.ConfigListener
      </listener-class>
    </listener>

    <servlet>
        <servlet-name>RestProxy</servlet-name>
        <servlet-class>org.jboss.bpm.console.server.RestProxyServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>RestProxy</servlet-name>
        <url-pattern>/rs/*</url-pattern>
    </servlet-mapping>
    
    <!--
    <servlet>
        <servlet-name>xmlProxy</servlet-name>
        <servlet-class>org.jboss.errai.tools.proxy.XmlHttpProxyServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>erraiProxy</servlet-name>
        <description>Errai Proxy</description>
        <servlet-class>org.jboss.errai.tools.proxy.XmlHttpProxyServlet</servlet-class>
        <init-param>
            <param-name>config.name</param-name>
            <param-value>errai-proxy.json</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    -->

    <servlet>
        <servlet-name>ErraiServlet</servlet-name>
        <servlet-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>ErraiServlet</servlet-name>
        <url-pattern>*.erraiBus</url-pattern>
    </servlet-mapping>

    <!--
     <servlet-mapping>
        <servlet-name>xmlProxy</servlet-name>
        <url-pattern>/app/xhp/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>erraiProxy</servlet-name>
        <url-pattern>/app/proxy/*</url-pattern>
    </servlet-mapping>
    -->

  <!-- Define a Security Constraint on this Application -->
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>BPEL Console</web-resource-name>
      <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>overlorduser</role-name>
    </auth-constraint>
  </security-constraint>

  <!-- Define the Login Configuration for this Application -->
  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Overlord</realm-name>
    <form-login-config>
      <form-login-page>/login.html</form-login-page>
      <form-error-page>/loginerror.html</form-error-page>
    </form-login-config>
  </login-config>

  <!-- Security roles referenced by this web application -->
  <security-role>
    <description>
        The role that is required to log in to the BPEL Console.
    </description>
    <role-name>overlorduser</role-name>
  </security-role>

</web-app>