<?xml version="1.0"?>
<!-- 
Copyright (c) 2006. Centre for e-Science. Lancaster University. United Kingdom. 

 Licensed 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 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>blogger</display-name>
    <description>Blogger</description>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>

<!--sakai2 - why is this needed /Chuck -->
    <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>true</param-value>
    </context-param>

    <servlet>
        <servlet-name>servletForImages</servlet-name>
        <servlet-class>uk.ac.lancs.e_science.sakai.tools.blogger.servlet.ServletForImages</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>servletForFiles</servlet-name>
        <servlet-class>uk.ac.lancs.e_science.sakai.tools.blogger.servlet.ServletForFiles</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>servletForImages</servlet-name>
        <url-pattern>/servletForImages</url-pattern>
		<dispatcher>REQUEST</dispatcher> 
		<dispatcher>FORWARD</dispatcher> 
		<dispatcher>INCLUDE</dispatcher>         
    </servlet-mapping>	
    <servlet-mapping>
        <servlet-name>servletForFiles</servlet-name>
        <url-pattern>/servletForFiles</url-pattern>
		<dispatcher>REQUEST</dispatcher> 
		<dispatcher>FORWARD</dispatcher> 
		<dispatcher>INCLUDE</dispatcher>         
    </servlet-mapping>	
<!--sakai-->
    <filter>
        <filter-name>sakai.request</filter-name>
        <filter-class>org.sakaiproject.util.RequestFilter</filter-class>
		<init-param>
			<param-name>http.session</param-name> 
			<param-value>tool</param-value> 
		</init-param>        
		<init-param>
			<!-- don't use sakai's built-in upload handling. (I think no body knows how to use it :-) 
				Blogger has its own upload filter below.11
			-->
			<param-name>upload.enabled</param-name> 
			<param-value>false</param-value> 
		</init-param>
    </filter>
	<filter>
		<filter-name>Upload Filter</filter-name> 
		<filter-class>uk.ac.lancs.e_science.fileUpload.UploadFilter</filter-class> 
		<init-param>
			<param-name>uk.ac.lancs.e_science.fileUpload.UploadFilter.sizeMax</param-name>
			<param-value>20</param-value><!-- Mbytes -->
		</init-param>
	</filter> 
	<filter>
		<filter-name>MyFacesExtensionsFilter</filter-name>
		<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
	</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>
	<filter-mapping>
		<filter-name>Upload Filter</filter-name> 
		<url-pattern>/*</url-pattern> 
		<dispatcher>REQUEST</dispatcher> 
		<dispatcher>FORWARD</dispatcher> 
		<dispatcher>INCLUDE</dispatcher> 
	</filter-mapping>
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <url-pattern>*.jsf</url-pattern>
		<dispatcher>REQUEST</dispatcher> 
		<dispatcher>FORWARD</dispatcher> 
		<dispatcher>INCLUDE</dispatcher>            
    </filter-mapping>

    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <url-pattern>/faces/*</url-pattern>
		<dispatcher>REQUEST</dispatcher> 
		<dispatcher>FORWARD</dispatcher> 
		<dispatcher>INCLUDE</dispatcher>   
	 </filter-mapping>

    <servlet>
        <servlet-name>blogger</servlet-name>
        <servlet-class>org.sakaiproject.jsf.util.JsfTool</servlet-class>
            <init-param>
                <param-name>default</param-name>
                <param-value>main</param-value>
            </init-param>
            <init-param>
                <param-name>path</param-name>
                <param-value>/sakai-blogger-tool</param-value>
            </init-param>
            <load-on-startup> 1 </load-on-startup>
     </servlet>




     <!-- Faces Servlet -->
    <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>

    <listener>
        <listener-class>org.sakaiproject.util.ToolListener</listener-class>
    </listener>  
    

	<welcome-file-list>
	  <welcome-file>index.html</welcome-file>
	</welcome-file-list>


</web-app>

		
