<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>sakai-podcasts</display-name>
    <description>Sakai Podcasts Tool</description>

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
 
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/local.xml</param-value>
    </context-param>
    
   <!-- JSF TAGLIBS -->
  <jsp-config>
  <taglib>
    <taglib-uri>http://www.sakaiproject.org/podcasts</taglib-uri>
    <taglib-location>/WEB-INF/podcasts.tld</taglib-location>
  </taglib>
  </jsp-config>
<!-- END PODCASTS JSF -->
   
<!--sakai-->
    
  <!-- to wire up the FacesServlet -->
  <!-- so the app can hook your content into faces -->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup> 2 </load-on-startup>
    </servlet>
 
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
     
	<!-- the missing link of my attempt, servlet-name must match tool.
		 it is JsfTool that will intercept requests and grap the
		 correct information -->
     <servlet>
      <servlet-name>sakai.podcasts</servlet-name>
      <servlet-class>org.sakaiproject.jsf.util.JsfTool</servlet-class>
        <init-param>
            <param-name>path</param-name>
            <param-value>/podcasts</param-value>
        </init-param>
      <load-on-startup>2</load-on-startup>
        <init-param>
            <param-name>default</param-name>
            <param-value>podMain</param-value>
        </init-param>
         <init-param>
            <param-name>default.last.view</param-name>
            <param-value>true</param-value>
        </init-param>
   </servlet>
 
	<!-- the RequestFilter works with JsfTool to intercept requests -->
    <filter>
        <filter-name>org.sakaiproject.util.RequestFilter</filter-name>
        <filter-class>org.sakaiproject.util.RequestFilter</filter-class>
		<init-param>
			<param-name>upload.max</param-name>
			<param-value>500</param-value>
		</init-param>
    </filter>

  <!-- tells RequestFilter what can be done with your servlet
  	   usually all 3 dispachers values kept -->
   <filter-mapping>
        <filter-name>org.sakaiproject.util.RequestFilter</filter-name>
        <servlet-name>sakai.podcasts</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>

  <!-- tells RequestFilter what can be done with your servlet
  	   usually all 3 dispachers values kept -->
    <filter>
        <filter-name>sakai.request</filter-name>
        <filter-class>org.sakaiproject.util.RequestFilter</filter-class>
		<init-param>
			<param-name>upload.max</param-name>
			<param-value>500</param-value>
		</init-param>
<!--        <init-param>
          <param-name>upload.enabled</param-name>
        	  <param-value>true</param-value>
        </init-param> -->
     </filter>
  <filter-mapping>
        <filter-name>sakai.request</filter-name>
        <servlet-name>podcasts</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
 
    <!-- same with the Faces servlet -->
    <filter>
        <filter-name>sakai.request</filter-name>
        <filter-class>org.sakaiproject.util.RequestFilter</filter-class>
		<init-param>
			<param-name>upload.max</param-name>
			<param-value>500</param-value>
		</init-param>
    </filter>
    <filter-mapping>
        <filter-name>sakai.request</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    
    <!-- add a listener so the tool can "hear" and be "heard" -->
    <listener>
        <listener-class>org.sakaiproject.util.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.sakaiproject.util.ToolListener</listener-class>
    </listener>
 
  	<welcome-file-list>
	    <welcome-file>index.html</welcome-file>
  	</welcome-file-list>

</web-app>