<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5" metadata-complete="true">
    <display-name>Geronimo Debug Views Portlet</display-name>

    <servlet>
      <servlet-name>dwr-invoker</servlet-name>
      <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
      <init-param>
        <param-name>classes</param-name>
        <param-value>
            org.apache.geronimo.console.jmxmanager.JMXManagerHelper,
            org.apache.geronimo.console.ldapmanager.LDAPManagerHelper,
			org.apache.geronimo.console.dependencyview.DependencyViewHelper,
			org.apache.geronimo.console.jndiview.JNDIViewHelper,
			org.apache.geronimo.console.util.Tree,
			org.apache.geronimo.console.util.TreeEntry
        </param-value>
      </init-param>
      <init-param>
          <param-name>activeReverseAjaxEnabled</param-name>
          <param-value>true</param-value>
      </init-param>
	  <init-param>
		<param-name>allowScriptTagRemoting</param-name>
		<param-value>true</param-value>
		</init-param>
    </servlet>

    <servlet>
        <servlet-name>DependencyViewer</servlet-name>
        <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
        <init-param>
            <param-name>portlet-name</param-name>
            <param-value>DependencyViewer</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>JMXViewer</servlet-name>
        <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
        <init-param>
            <param-name>portlet-name</param-name>
            <param-value>JMXViewer</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>JNDIViewer</servlet-name>
        <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
        <init-param>
            <param-name>portlet-name</param-name>
            <param-value>JNDIViewer</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>LDAPViewer</servlet-name>
        <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
        <init-param>
            <param-name>portlet-name</param-name>
            <param-value>LDAPViewer</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>dwr-invoker</servlet-name>
        <url-pattern>/dwr2/*</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
        <servlet-name>DependencyViewer</servlet-name>
        <url-pattern>/PlutoInvoker/DependencyViewer</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>JMXViewer</servlet-name>
        <url-pattern>/PlutoInvoker/JMXViewer</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>JNDIViewer</servlet-name>
        <url-pattern>/PlutoInvoker/JNDIViewer</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>LDAPViewer</servlet-name>
        <url-pattern>/PlutoInvoker/LDAPViewer</url-pattern>
    </servlet-mapping>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>debugviews</web-resource-name>
            <url-pattern>/PlutoInvoker/*</url-pattern>
            <url-pattern>/dwr2/*</url-pattern>
            <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>
    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>geronimo-admin</realm-name>
    </login-config>
    <security-role>
        <role-name>admin</role-name>
    </security-role>

    <!--
    For security reasons requests to the dwr servlet go through
    the "/console" web-app context. The purpose of dwr-filter is
    to map the attributes such as pathInfo, requestURI, etc. of
    the original request into the request that is delivered to
    the dwr-invoker servlet.  The dwr-invoker servlet uses those
    attributes to create URLs that it sends back to the client.
     -->
    <filter>
        <filter-name>dwr-filter</filter-name>
        <filter-class>org.apache.geronimo.console.servlet.ForwardDispatchFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>dwr-filter</filter-name>
        <servlet-name>dwr-invoker</servlet-name>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

</web-app>
