[jboss-svn-commits] JBL Code SVN: r15407 - in labs/shotoku/trunk/shotoku-web: example and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Sep 27 14:20:23 EDT 2007


Author: adamw
Date: 2007-09-27 14:20:22 -0400 (Thu, 27 Sep 2007)
New Revision: 15407

Added:
   labs/shotoku/trunk/shotoku-web/build.xml
   labs/shotoku/trunk/shotoku-web/example/
   labs/shotoku/trunk/shotoku-web/example/build.xml
   labs/shotoku/trunk/shotoku-web/example/src/
   labs/shotoku/trunk/shotoku-web/example/src/java/
   labs/shotoku/trunk/shotoku-web/example/src/java/test/
   labs/shotoku/trunk/shotoku-web/example/src/java/test/TestPortlet.java
   labs/shotoku/trunk/shotoku-web/example/src/java/test/TestServlet.java
   labs/shotoku/trunk/shotoku-web/example/src/java/test/TestServlet2.java
   labs/shotoku/trunk/shotoku-web/example/src/web/
   labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/
   labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/faces-config.xml
   labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/portlet-instances.xml
   labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/portlet.xml
   labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/test-object.xml
   labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/web.xml
   labs/shotoku/trunk/shotoku-web/example/src/web/hello.jsp
   labs/shotoku/trunk/shotoku-web/example/src/web/hello_jsf.jsp
   labs/shotoku/trunk/shotoku-web/lib/
   labs/shotoku/trunk/shotoku-web/lib/javax.servlet.jar
   labs/shotoku/trunk/shotoku-web/lib/portlet-api-lib.jar
Modified:
   labs/shotoku/trunk/shotoku-web/
Log:
New filter with example


Property changes on: labs/shotoku/trunk/shotoku-web
___________________________________________________________________
Name: svn:ignore
   + bin
build
dist
.project
.classpath
.settings


Added: labs/shotoku/trunk/shotoku-web/build.xml
===================================================================
--- labs/shotoku/trunk/shotoku-web/build.xml	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/build.xml	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<project name="Shotoku Web" default="dist">
+	<property name="version" value="1.0" />
+	
+	<property name="jar.name" value="shotoku-web-${version}.jar" />
+	
+	<!-- Directories -->
+	<property name="src" value="src"/>
+	<property name="src.java" value="${src}/java"/>
+	<property name="lib" value="${basedir}/lib/" />
+	<property name="build" value="build"/>
+	<property name="dist" value="dist"/>
+
+	<fileset id="web.lib" dir="${lib}">
+			<include name="**/*.jar"/>
+	</fileset>
+	
+	<path id="base.jars">
+		<fileset refid="web.lib" />
+	</path>
+	
+	<target name="build" depends="clean">
+		<mkdir dir="${build}" />
+
+		<!-- Compiling the source -->
+		<javac srcdir="${src.java}" destdir="${build}" target="1.4" source="1.4">
+			<classpath refid="base.jars" />
+		</javac>
+	</target>
+
+	<target name="dist" depends="build">		
+		<mkdir dir="${dist}" />
+		<jar destfile="${dist}/${jar.name}" basedir="${build}" />
+	</target>
+
+	<target name="clean">
+		<delete dir="${build}" />
+		<delete dir="${dist}" />
+	</target>
+</project>


Property changes on: labs/shotoku/trunk/shotoku-web/example
___________________________________________________________________
Name: svn:ignore
   + build
dist
bin
.classpath
.project
.settings


Added: labs/shotoku/trunk/shotoku-web/example/build.xml
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/build.xml	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/build.xml	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,51 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<project name="Shotoku Web example" default="dist">
+	<property name="war.name" value="shotoku-web-example.war" />
+	
+	<!-- Directories -->
+	<property name="src" value="src"/>
+	<property name="src.java" value="${src}/java"/>
+	<property name="src.web" value="${src}/web"/>
+	<property name="lib" value="${basedir}/../lib/" />
+	<property name="build" value="build"/>
+	<property name="dist" value="dist"/>
+
+	<fileset id="web.lib" dir="${lib}">
+			<include name="**/*.jar"/>
+	</fileset>
+	
+	<path id="base.jars">
+		<fileset refid="web.lib" />
+	</path>
+	
+	<target name="dist" depends="clean">
+		<mkdir dir="${build}" />
+		<mkdir dir="${build}/WEB-INF" />
+		<mkdir dir="${build}/WEB-INF/classes" />
+
+		<!-- Compiling the source -->
+		<javac srcdir="${src.java}" destdir="${build}/WEB-INF/classes" target="1.4" source="1.4">
+			<classpath refid="base.jars" />
+		</javac>
+		
+		<copy todir="${build}">
+			<fileset dir="${src.web}">
+				<include name="**/*" />
+			</fileset>
+		</copy>
+		
+		<!-- Compiling and copying the filter -->
+		<mkdir dir="${build}/WEB-INF/lib" />
+		<ant antfile="../build.xml" target="dist" inheritall="false" inheritrefs="false" />
+		<copy file="../dist/shotoku-web-1.0.jar" todir="${build}/WEB-INF/lib" />
+		
+		<mkdir dir="${dist}" />
+		<jar destfile="${dist}/${war.name}" basedir="${build}" />
+	</target>
+
+	<target name="clean">
+		<delete dir="${build}" />
+		<delete dir="${dist}" />
+	</target>
+</project>

Added: labs/shotoku/trunk/shotoku-web/example/src/java/test/TestPortlet.java
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/src/java/test/TestPortlet.java	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/src/java/test/TestPortlet.java	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,23 @@
+package test;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+public class TestPortlet extends GenericPortlet {
+	public void processAction(ActionRequest request, ActionResponse response)
+			throws PortletException, IOException {
+		
+	}
+
+	public void render(RenderRequest request, RenderResponse response)
+			throws PortletException, IOException {
+		response.setContentType("text/html");
+		getPortletContext().getRequestDispatcher("/hello.jsp").include(request, response);
+	}
+}

Added: labs/shotoku/trunk/shotoku-web/example/src/java/test/TestServlet.java
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/src/java/test/TestServlet.java	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/src/java/test/TestServlet.java	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,31 @@
+package test;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Servlet implementation class for Servlet: TestServlet
+ *
+ */
+ public class TestServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
+   static final long serialVersionUID = 1L;
+   
+    /* (non-Java-doc)
+	 * @see javax.servlet.http.HttpServlet#HttpServlet()
+	 */
+	public TestServlet() {
+		super();
+	}
+
+	public void service(ServletRequest request, ServletResponse response)
+			throws ServletException, IOException {
+		if (request instanceof HttpServletRequest) {
+			HttpServletRequest httpRequest = (HttpServletRequest) request;
+			
+			httpRequest.getRequestDispatcher("/hello.jsp").include(request, response);
+		}
+	}   	
+}
\ No newline at end of file

Added: labs/shotoku/trunk/shotoku-web/example/src/java/test/TestServlet2.java
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/src/java/test/TestServlet2.java	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/src/java/test/TestServlet2.java	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,31 @@
+package test;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Servlet implementation class for Servlet: TestServlet
+ *
+ */
+ public class TestServlet2 extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
+   static final long serialVersionUID = 1L;
+   
+    /* (non-Java-doc)
+	 * @see javax.servlet.http.HttpServlet#HttpServlet()
+	 */
+	public TestServlet2() {
+		super();
+	}
+
+	public void service(ServletRequest request, ServletResponse response)
+			throws ServletException, IOException {
+		if (request instanceof HttpServletRequest) {
+			HttpServletRequest httpRequest = (HttpServletRequest) request;
+			
+			httpRequest.getRequestDispatcher("/hello.jsp").forward(request, response);
+		}
+	}   	
+}
\ No newline at end of file

Added: labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/faces-config.xml
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/faces-config.xml	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/faces-config.xml	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+                              "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config/>

Added: labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/portlet-instances.xml
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/portlet-instances.xml	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/portlet-instances.xml	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+    <deployment>
+        <if-exists>overwrite</if-exists>
+        <instance>
+            <instance-id>ResourcesFilterTestPortletInstance</instance-id>
+            <portlet-ref>ResourcesFilterTestPortlet</portlet-ref>
+        </instance>
+    </deployment>
+</deployments>

Added: labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/portlet.xml
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/portlet.xml	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/portlet.xml	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
+    <portlet>
+        <description>Test portlet</description>
+        <portlet-name>ResourcesFilterTestPortlet</portlet-name>
+        <display-name>Test portlet</display-name>
+        <portlet-class>test.TestPortlet</portlet-class>
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+        </supports>
+        <portlet-info>
+            <title>Test portlet</title>
+        </portlet-info>
+    </portlet>
+</portlet-app>

Added: labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/test-object.xml
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/test-object.xml	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/test-object.xml	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+    <deployment>
+        <if-exists>overwrite</if-exists>
+        <parent-ref>default</parent-ref>
+        <page>
+            <page-name>test1</page-name>
+            <window>
+                <window-name>ResourcesFilterTestPortletWindow</window-name>
+                <instance-ref>ResourcesFilterTestPortletInstance</instance-ref>
+                <region>center</region>
+                <height>1</height>
+            </window>
+        </page>
+    </deployment>
+</deployments>
\ No newline at end of file

Added: labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/web.xml
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/web.xml	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/src/web/WEB-INF/web.xml	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="WebApp_ID" 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>JspFilesystemFilter</display-name>
+ <filter>
+  <filter-name>ResourcesFilter</filter-name>
+  <filter-class>org.jboss.shotoku.web.ResourcesFilter</filter-class>
+  <init-param>
+   <param-name>sourceBasePath</param-name>
+   <param-value>/Users/adamwarski/shotoku/shotoku-web/example/src/web</param-value>
+  </init-param>
+ </filter>
+ <filter-mapping>
+  <filter-name>ResourcesFilter</filter-name>
+  <url-pattern>/*</url-pattern>
+  <dispatcher>REQUEST</dispatcher>
+  <dispatcher>INCLUDE</dispatcher>
+  <dispatcher>FORWARD</dispatcher>
+ </filter-mapping>
+ <listener>
+  <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+ <servlet>
+  <servlet-name>Faces Servlet</servlet-name>
+  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+  <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet>
+  <display-name>TestServlet</display-name>
+  <servlet-name>TestServlet</servlet-name>
+  <servlet-class>test.TestServlet</servlet-class>
+ </servlet>
+ <servlet>
+  <display-name>TestServlet2</display-name>
+  <servlet-name>TestServlet2</servlet-name>
+  <servlet-class>test.TestServlet2</servlet-class>
+ </servlet>
+ <servlet-mapping>
+  <servlet-name>Faces Servlet</servlet-name>
+  <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+  <servlet-name>TestServlet</servlet-name>
+  <url-pattern>/test/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+  <servlet-name>TestServlet2</servlet-name>
+  <url-pattern>/test2/*</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+  <welcome-file>index.html</welcome-file>
+  <welcome-file>index.htm</welcome-file>
+  <welcome-file>index.jsp</welcome-file>
+  <welcome-file>default.html</welcome-file>
+  <welcome-file>default.htm</welcome-file>
+  <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+ <login-config>
+  <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>

Added: labs/shotoku/trunk/shotoku-web/example/src/web/hello.jsp
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/src/web/hello.jsp	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/src/web/hello.jsp	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,12 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+    pageEncoding="ISO-8859-1"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Hello world!</title>
+</head>
+<body>
+Hello world!
+</body>
+</html>
\ No newline at end of file

Added: labs/shotoku/trunk/shotoku-web/example/src/web/hello_jsf.jsp
===================================================================
--- labs/shotoku/trunk/shotoku-web/example/src/web/hello_jsf.jsp	                        (rev 0)
+++ labs/shotoku/trunk/shotoku-web/example/src/web/hello_jsf.jsp	2007-09-27 18:20:22 UTC (rev 15407)
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<html>
+	<head>
+		<title></title>
+	</head>
+	<body>
+		<f:view> 
+			Hello world from JSF!
+		</f:view>
+	</body>	
+</html>  

Added: labs/shotoku/trunk/shotoku-web/lib/javax.servlet.jar
===================================================================
(Binary files differ)


Property changes on: labs/shotoku/trunk/shotoku-web/lib/javax.servlet.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/shotoku/trunk/shotoku-web/lib/portlet-api-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/shotoku/trunk/shotoku-web/lib/portlet-api-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the jboss-svn-commits mailing list