incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r583796 - in /incubator/sling/whiteboard/microsling: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/sling/ src/main/java/org/apache/sling/microsling/ src/main/java/org/apache/sling/mic...
Date Thu, 11 Oct 2007 12:20:35 GMT
Author: bdelacretaz
Date: Thu Oct 11 05:20:33 2007
New Revision: 583796

URL: http://svn.apache.org/viewvc?rev=583796&view=rev
Log:
SLING-47 - microsling webapp, work in progress

Added:
    incubator/sling/whiteboard/microsling/   (with props)
    incubator/sling/whiteboard/microsling/README.txt   (with props)
    incubator/sling/whiteboard/microsling/pom.xml   (with props)
    incubator/sling/whiteboard/microsling/src/
    incubator/sling/whiteboard/microsling/src/main/
    incubator/sling/whiteboard/microsling/src/main/java/
    incubator/sling/whiteboard/microsling/src/main/java/org/
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/HttpStatusCodeException.java   (with props)
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/RequestFilter.java   (with props)
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/Resource.java   (with props)
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/SlingServlet.java   (with props)
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/AbstractSlingServlet.java   (with props)
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/HttpConstants.java   (with props)
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/RequestAttributeNames.java   (with props)
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/resource/
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/resource/ResourceResolverFilter.java   (with props)
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/servlet/
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/servlet/MicroSlingServlet.java   (with props)
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/DefaultSlingServlet.java   (with props)
    incubator/sling/whiteboard/microsling/src/main/webapp/
    incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/
    incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.dtd   (with props)
    incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.xml   (with props)
    incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/web.xml   (with props)
    incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/webdav-resource-config.xml   (with props)
    incubator/sling/whiteboard/microsling/src/main/webapp/index.html   (with props)
    incubator/sling/whiteboard/microsling/src/main/webapp/microsling.css   (with props)

Propchange: incubator/sling/whiteboard/microsling/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Oct 11 05:20:33 2007
@@ -0,0 +1,11 @@
+.classpath
+*.ipr
+*.iml
+*.iws
+.project
+target
+.settings
+.externalToolBuilders
+logs
+derby.log
+jackrabbit-repository

Added: incubator/sling/whiteboard/microsling/README.txt
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/README.txt?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/README.txt (added)
+++ incubator/sling/whiteboard/microsling/README.txt Thu Oct 11 05:20:33 2007
@@ -0,0 +1,35 @@
+------------------------------------------------------------
+Microsling: the Sling request processing, reduced to the max
+------------------------------------------------------------
+
+The goal of this prototype is to demonstrate the Sling HTTP
+request processing in the simplest possible way, to help the
+community converge on the goals and architecture of this 
+module.
+
+How to build and run this
+------------------------
+Currently this depends on the Jackrabbit 1.4-SNAPSHOT, mostly
+because I had a project skeleton around that takes advantage of
+JCR-955 to reuse some Jackrabbit servlets.
+
+To build and run:
+
+1) Install a JDK 1.5 and Maven 2.0.7.
+
+2) Get and build the Jackrabbit trunk from
+
+  http://svn.apache.org/repos/asf/jackrabbit/trunk
+
+I'm currently using revision 583722 for my tests.
+
+3) Build and run this webapp:
+
+  mvn clean package jetty:run
+  
+Which should say "Started SelectChannelConnector@0.0.0.0:8080" once
+the build is done.  
+  
+4) Connect to http://localhost:8080/ which should return a page
+saying "Microsling homepage". That page contains instructions for
+playing with Microsling.   
\ No newline at end of file

Propchange: incubator/sling/whiteboard/microsling/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/sling/whiteboard/microsling/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/pom.xml?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/pom.xml (added)
+++ incubator/sling/whiteboard/microsling/pom.xml Thu Oct 11 05:20:33 2007
@@ -0,0 +1,100 @@
+<?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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.sling</groupId>
+  <artifactId>microsling</artifactId>
+  <packaging>war</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>microsling</name>
+  <url>http://incubator.apache.org/sling</url>
+
+  <properties>
+    <!-- 
+      Use the Jackrabbit trunk, mostly because JCR-955
+      makes it easier to reuse the servlets from the
+      jackrabbit-webapp module.
+    -->
+    <jackrabbit.version>1.4-SNAPSHOT</jackrabbit.version>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.3</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-webapp</artifactId>
+      <version>${jackrabbit.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-jcr-servlet</artifactId>
+      <version>${jackrabbit.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.jcr</groupId>
+      <artifactId>jcr</artifactId>
+      <version>1.0</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+          <encoding>UTF-8</encoding>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>maven-jetty-plugin</artifactId>
+        <version>6.1.5</version>
+        <configuration>
+          <contextPath>/</contextPath>
+          <scanIntervalSeconds>10</scanIntervalSeconds>
+          <connectors>
+            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+              <port>8080</port>
+              <maxIdleTime>60000</maxIdleTime>
+            </connector>
+          </connectors>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: incubator/sling/whiteboard/microsling/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/HttpStatusCodeException.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/HttpStatusCodeException.java?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/HttpStatusCodeException.java (added)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/HttpStatusCodeException.java Thu Oct 11 05:20:33 2007
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.sling.microsling.api;
+
+import java.io.IOException;
+
+/** An Exception that causes Sling to return the specified 
+ *  HTTP status code.
+ */
+
+public class HttpStatusCodeException extends IOException {
+    private static final long serialVersionUID = 1L;
+    private final int statusCode;
+    
+    public HttpStatusCodeException(int statusCode, String message) {
+        super(message);
+        this.statusCode = statusCode;
+    }
+    
+    public int getStatusCode() {
+        return statusCode;
+    }
+}

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/HttpStatusCodeException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/HttpStatusCodeException.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/RequestFilter.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/RequestFilter.java?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/RequestFilter.java (added)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/RequestFilter.java Thu Oct 11 05:20:33 2007
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+package org.apache.sling.microsling.api;
+
+import javax.servlet.http.HttpServletRequest;
+
+/** A Sling RequestFilter processes Requests, to find
+ *  the Resource to process, gather information on the 
+ *  client making the request, etc., etc.
+ */
+public interface RequestFilter {
+    void doFilter(HttpServletRequest req);
+}

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/RequestFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/RequestFilter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/Resource.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/Resource.java?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/Resource.java (added)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/Resource.java Thu Oct 11 05:20:33 2007
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+package org.apache.sling.microsling.api;
+
+/** Resources are pieces of content on which Sling acts  */
+public interface Resource {
+    String getURI();
+    Object getData();
+}

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/Resource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/Resource.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/SlingServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/SlingServlet.java?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/SlingServlet.java (added)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/SlingServlet.java Thu Oct 11 05:20:33 2007
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+package org.apache.sling.microsling.api;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/** A simplified Servlet interface used by Sling to process requests */
+public interface SlingServlet {
+    /** true if this SlingServlet wants to process the given request */
+    boolean canProcess(HttpServletRequest req) throws Exception;
+    
+    /** Handle an HTTP DELETE request */
+    void doDelete(HttpServletRequest req, HttpServletResponse resp) throws Exception;
+    
+    /** Handle an HTTP GET request */
+    void doGet(HttpServletRequest req, HttpServletResponse resp) throws Exception;
+    
+    /** Handle an HTTP HEAD request */
+    void doHead(HttpServletRequest req, HttpServletResponse resp) throws Exception;
+    
+    /** Handle an HTTP OPTIONS request */
+    void doOptions(HttpServletRequest req, HttpServletResponse resp) throws Exception;
+    
+    /** Handle an HTTP POST request */
+    void doPost(HttpServletRequest req, HttpServletResponse resp) throws Exception;
+    
+    /** Handle an HTTP PUT request */
+    void doPut(HttpServletRequest req, HttpServletResponse resp) throws Exception;
+}

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/SlingServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/SlingServlet.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/AbstractSlingServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/AbstractSlingServlet.java?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/AbstractSlingServlet.java (added)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/AbstractSlingServlet.java Thu Oct 11 05:20:33 2007
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+package org.apache.sling.microsling.etc;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.sling.microsling.api.HttpStatusCodeException;
+import org.apache.sling.microsling.api.Resource;
+import org.apache.sling.microsling.api.SlingServlet;
+import org.apache.sling.microsling.request.RequestAttributeNames;
+
+/** Base class for SlingServlets, fails with "not implemented"
+ *  for all HTTP methods supported by SlingServlet
+ */
+public abstract class AbstractSlingServlet implements SlingServlet {
+    
+    private void throwMethodNotImplementedException(HttpServletRequest req) throws Exception {
+        final String msg = req.getMethod() + " method is not supported by " + getClass().getSimpleName();
+        throw new HttpStatusCodeException(501,msg);
+    }
+    
+    public void doDelete(HttpServletRequest req, HttpServletResponse resp) throws Exception {
+        throwMethodNotImplementedException(req);
+    }
+
+    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws Exception {
+        throwMethodNotImplementedException(req);
+    }
+
+    public void doHead(HttpServletRequest req, HttpServletResponse resp) throws Exception {
+        throwMethodNotImplementedException(req);
+    }
+
+    public void doOptions(HttpServletRequest req, HttpServletResponse resp) throws Exception {
+        throwMethodNotImplementedException(req);
+    }
+
+    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws Exception {
+        throwMethodNotImplementedException(req);
+    }
+
+    public void doPut(HttpServletRequest req, HttpServletResponse resp) throws Exception {
+        throwMethodNotImplementedException(req);
+    }
+    
+    protected Resource getCurrentResource(HttpServletRequest req) {
+        return (Resource)req.getAttribute(RequestAttributeNames.REQUEST_ATTR_RESOURCE);
+    }
+}

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/AbstractSlingServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/AbstractSlingServlet.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/HttpConstants.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/HttpConstants.java?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/HttpConstants.java (added)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/HttpConstants.java Thu Oct 11 05:20:33 2007
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+package org.apache.sling.microsling.etc;
+
+/** HTTP-related constants */
+public interface HttpConstants {
+    String METHOD_OPTIONS = "OPTIONS";
+    String METHOD_GET = "GET";
+    String METHOD_HEAD = "HEAD";
+    String METHOD_POST = "POST";
+    String METHOD_PUT = "PUT";
+    String METHOD_DELETE = "DELETE";
+    String METHOD_TRACE = "TRACE";
+    String METHOD_CONNECT = "CONNECT";
+}

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/HttpConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/etc/HttpConstants.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/RequestAttributeNames.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/RequestAttributeNames.java?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/RequestAttributeNames.java (added)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/RequestAttributeNames.java Thu Oct 11 05:20:33 2007
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+package org.apache.sling.microsling.request;
+
+/** Define standard names for Request attributes used by Sling */
+public interface RequestAttributeNames {
+    String PREFIX = "sling.";
+    
+    String REQUEST_ATTR_RESOURCE = PREFIX + "resource";
+}

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/RequestAttributeNames.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/request/RequestAttributeNames.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/resource/ResourceResolverFilter.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/resource/ResourceResolverFilter.java?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/resource/ResourceResolverFilter.java (added)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/resource/ResourceResolverFilter.java Thu Oct 11 05:20:33 2007
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+package org.apache.sling.microsling.resource;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.sling.microsling.api.RequestFilter;
+import org.apache.sling.microsling.api.Resource;
+import org.apache.sling.microsling.request.RequestAttributeNames;
+
+/** A RequestFilter that selects the Resource to process */
+public class ResourceResolverFilter implements RequestFilter {
+
+    public void doFilter(HttpServletRequest req) {
+        final String path = req.getPathInfo();
+        
+        // TODO use the JCR Repository for this!
+        final Resource r = new Resource() {
+            public Object getData() {
+                return "This is the Resource for path " + path;
+            }
+            public String getURI() {
+                return path;
+            }
+        };
+            
+        // end requests with "notfound" to test the "not found" response
+        if(!path.endsWith("notfound")) {
+            req.setAttribute(RequestAttributeNames.REQUEST_ATTR_RESOURCE, r);
+        }
+    }
+    
+}

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/resource/ResourceResolverFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/resource/ResourceResolverFilter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/servlet/MicroSlingServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/servlet/MicroSlingServlet.java?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/servlet/MicroSlingServlet.java (added)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/servlet/MicroSlingServlet.java Thu Oct 11 05:20:33 2007
@@ -0,0 +1,119 @@
+/*
+ * 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.
+ */
+package org.apache.sling.microsling.servlet;
+
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.sling.microsling.api.HttpStatusCodeException;
+import org.apache.sling.microsling.api.RequestFilter;
+import org.apache.sling.microsling.api.SlingServlet;
+import org.apache.sling.microsling.etc.HttpConstants;
+import org.apache.sling.microsling.resource.ResourceResolverFilter;
+import org.apache.sling.microsling.slingservlets.DefaultSlingServlet;
+
+/** The main Microsling servlet: processes requests using the Sling filters 
+ *  to select a Resource and to apply processing to it.
+ */
+public class MicroSlingServlet extends HttpServlet {
+
+    private static final long serialVersionUID = 1L;
+
+    private List<RequestFilter> requestFilters = new LinkedList<RequestFilter> ();
+    private List<SlingServlet> servlets = new LinkedList<SlingServlet> ();
+    
+    @Override
+    public void init() throws ServletException {
+        super.init();
+        
+        // TODO use OSGi to setup this list
+        requestFilters.add(new ResourceResolverFilter());
+        
+        // TODO use OSGi to setup this list 
+        servlets.add(new DefaultSlingServlet());
+    }
+
+    /** Process all requests by delegating to the first SlingServlet that
+     *  can process the current request.
+     */
+    protected void service(HttpServletRequest req, HttpServletResponse resp)
+    throws ServletException, IOException {
+        
+        try {
+            // let our RequestFilters enhance the request information
+            // (select a Resource to act on, etc)
+            for(RequestFilter rf : requestFilters) {
+                rf.doFilter(req);
+            }
+            
+            // Select a SlingServlet and delegate the actual request processing to it 
+            final SlingServlet selectedServlet = selectSlingServlet(req);
+            if(selectedServlet!=null) {
+                delegateToSlingServlet(selectedServlet,req,resp);
+            } else {
+                throw new HttpStatusCodeException(500,"no SlingServlet found to process current request");
+            }
+            
+        } catch(HttpStatusCodeException hts) {
+            resp.sendError(hts.getStatusCode(),hts.getMessage());
+            
+        } catch(Exception e) {
+            // TODO log or add stack trace
+            resp.sendError(500,e.getMessage());
+        }
+        
+    }
+    
+    /** Select a SlingServlet to process the given request */
+    protected SlingServlet selectSlingServlet(HttpServletRequest req) throws Exception {
+        for(SlingServlet s : servlets) {
+            if(s.canProcess(req)) {
+                return s;
+            }
+        }
+        return null;
+    }
+    
+    /** Delegate to the given SlingServlet, based on the request HTTP method */
+    protected void delegateToSlingServlet(SlingServlet s,HttpServletRequest req,HttpServletResponse resp) 
+    throws Exception {
+        final String method = req.getMethod();
+        
+        if(HttpConstants.METHOD_GET.equals(method)) {
+            s.doGet(req,resp);
+        } else if(HttpConstants.METHOD_HEAD.equals(method)) {
+            s.doHead(req,resp);
+        } else if(HttpConstants.METHOD_POST.equals(method)) {
+            s.doPost(req,resp);
+        } else if(HttpConstants.METHOD_PUT.equals(method)) {
+            s.doPut(req,resp);
+        } else if(HttpConstants.METHOD_DELETE.equals(method)) {
+            s.doDelete(req,resp);
+        } else if(HttpConstants.METHOD_OPTIONS.equals(method)) {
+            s.doOptions(req,resp);
+        } else {
+            throw new HttpStatusCodeException(501,"HTTP Method not implemented:" + method);
+        }
+    }
+
+ }

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/servlet/MicroSlingServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/servlet/MicroSlingServlet.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/DefaultSlingServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/DefaultSlingServlet.java?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/DefaultSlingServlet.java (added)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/DefaultSlingServlet.java Thu Oct 11 05:20:33 2007
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+package org.apache.sling.microsling.slingservlets;
+
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.sling.microsling.api.HttpStatusCodeException;
+import org.apache.sling.microsling.api.Resource;
+import org.apache.sling.microsling.etc.AbstractSlingServlet;
+
+/** The default SlingServlet, used if no other SlingServlet
+ *  wants to process the current request.
+ */
+public class DefaultSlingServlet extends AbstractSlingServlet {
+
+    @Override
+    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws Exception {
+        resp.setContentType("text/plain");
+        
+        final Resource r = getCurrentResource(req);
+        if(r==null) {
+            throw new HttpStatusCodeException(404,"Resource not found: " + req.getPathInfo());
+        }
+        
+        final PrintWriter pw = new PrintWriter(new OutputStreamWriter(resp.getOutputStream()));
+        pw.println("The DefaultSlingServlet is just a skeleton for now...");
+        pw.println("servlet: " + getClass().getName());
+        pw.println("resource data: " + r.getData());
+        pw.flush();
+    }
+
+    public boolean canProcess(HttpServletRequest req) throws Exception {
+        return true;
+    }
+
+}

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/DefaultSlingServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/DefaultSlingServlet.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.dtd
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.dtd?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.dtd (added)
+++ incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.dtd Thu Oct 11 05:20:33 2007
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!-- Authors: Chris Taylor, Ceki Gulcu. -->
+
+<!-- Version: 1.2 -->
+
+<!-- A configuration element consists of optional renderer
+elements,appender elements, categories and an optional root
+element. -->
+
+<!ELEMENT log4j:configuration (renderer*, appender*, logger*, root?)>
+
+<!-- The "threshold" attribute takes a level value such that all -->
+<!-- logging statements with a level equal or below this value are -->
+<!-- disabled. -->
+
+<!-- Setting the "debug" enable the printing of internal log4j logging   -->
+<!-- statements.                                                         -->
+
+<!-- By default, debug attribute is "null", meaning that we not do touch -->
+<!-- internal log4j logging settings. The "null" value for the threshold -->
+<!-- attribute can be misleading. The threshold field of a repository	 -->
+<!-- cannot be set to null. The "null" value for the threshold attribute -->
+<!-- simply means don't touch the threshold field, the threshold field   --> 
+<!-- keeps its old value.                                                -->
+     
+<!ATTLIST log4j:configuration
+  xmlns:log4j              CDATA #FIXED "http://jakarta.apache.org/log4j/" 
+  threshold                (all|debug|info|warn|error|fatal|off|null) "null"
+  debug                    (true|false|null)  "null"
+>
+
+<!-- renderer elements allow the user to customize the conversion of  -->
+<!-- message objects to String.                                       -->
+
+<!ELEMENT renderer EMPTY>
+<!ATTLIST renderer
+  renderedClass  CDATA #REQUIRED
+  renderingClass CDATA #REQUIRED
+>
+
+<!-- Appenders must have a name and a class. -->
+<!-- Appenders may contain an error handler, a layout, optional parameters -->
+<!-- and filters. They may also reference (or include) other appenders. -->
+<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)>
+<!ATTLIST appender
+  name 		ID 	#REQUIRED
+  class 	CDATA	#REQUIRED
+>
+
+<!ELEMENT layout (param*)>
+<!ATTLIST layout
+  class		CDATA	#REQUIRED
+>
+
+<!ELEMENT filter (param*)>
+<!ATTLIST filter
+  class		CDATA	#REQUIRED
+>
+
+<!-- ErrorHandlers can be of any class. They can admit any number of -->
+<!-- parameters. -->
+
+<!ELEMENT errorHandler (param*, root-ref?, logger-ref*,  appender-ref?)> 
+<!ATTLIST errorHandler
+   class        CDATA   #REQUIRED 
+>
+
+<!ELEMENT root-ref EMPTY>
+
+<!ELEMENT logger-ref EMPTY>
+<!ATTLIST logger-ref
+  ref IDREF #REQUIRED
+>
+
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+  name		CDATA   #REQUIRED
+  value		CDATA	#REQUIRED
+>
+
+
+<!-- The priority class is org.apache.log4j.Level by default -->
+<!--
+    DEPRECATED
+
+<!ELEMENT priority (param*)>
+<!ATTLIST priority
+  class   CDATA	#IMPLIED
+  value	  CDATA #REQUIRED
+>
+-->
+
+<!-- The level class is org.apache.log4j.Level by default -->
+<!ELEMENT level (param*)>
+<!ATTLIST level
+  class   CDATA	#IMPLIED
+  value	  CDATA #REQUIRED
+>
+
+
+<!-- If no level element is specified, then the configurator MUST not -->
+<!-- touch the level of the named category. -->
+<!--
+    DEPRECATED
+
+<!ELEMENT category (param*,(priority|level)?,appender-ref*)>
+<!ATTLIST category
+  class         CDATA   #IMPLIED
+  name		CDATA	#REQUIRED
+  additivity	(true|false) "true"  
+>
+-->
+
+<!-- If no level element is specified, then the configurator MUST not -->
+<!-- touch the level of the named logger. -->
+<!ELEMENT logger (level?, appender-ref*)>
+<!ATTLIST logger
+  class         CDATA   #IMPLIED
+  name		ID	#REQUIRED
+  additivity	(true|false) "true"  
+>
+
+<!--
+    DEPRECATED
+
+<!ELEMENT categoryFactory (param*)>
+<!ATTLIST categoryFactory 
+   class        CDATA #REQUIRED>
+-->
+
+<!ELEMENT appender-ref EMPTY>
+<!ATTLIST appender-ref
+  ref IDREF #REQUIRED
+>
+
+<!-- If no priority element is specified, then the configurator MUST not -->
+<!-- touch the priority of root. -->
+<!-- The root category always exists and cannot be subclassed. -->
+<!ELEMENT root (param*, level?, appender-ref*)>
+
+
+<!-- ==================================================================== -->
+<!--                       A logging event                                -->
+<!-- ==================================================================== -->
+<!ELEMENT log4j:eventSet (log4j:event*)>
+<!ATTLIST log4j:eventSet
+  xmlns:log4j             CDATA #FIXED "http://jakarta.apache.org/log4j/" 
+  version                (1.1|1.2) "1.2" 
+  includesLocationInfo   (true|false) "true"
+>
+
+
+
+<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, 
+                       log4j:locationInfo?) >
+
+<!-- The timestamp format is application dependent. -->
+<!ATTLIST log4j:event
+    logger     CDATA #REQUIRED
+    level      CDATA #REQUIRED
+    thread     CDATA #REQUIRED
+    timestamp  CDATA #REQUIRED
+>
+
+<!ELEMENT log4j:message (#PCDATA)>
+<!ELEMENT log4j:NDC (#PCDATA)>
+
+<!ELEMENT log4j:throwable (#PCDATA)>
+
+<!ELEMENT log4j:locationInfo EMPTY>
+<!ATTLIST log4j:locationInfo
+  class  CDATA	#REQUIRED
+  method CDATA	#REQUIRED
+  file   CDATA	#REQUIRED
+  line   CDATA	#REQUIRED
+>

Propchange: incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.dtd
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.xml
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.xml?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.xml (added)
+++ incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.xml Thu Oct 11 05:20:33 2007
@@ -0,0 +1,49 @@
+<?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.
+  -->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+    <!-- ====================================================================== -->
+    <!-- A P P E N D E R S                                                      -->
+    <!-- ====================================================================== -->
+
+    <!-- console -->
+    <appender name="console" class="org.apache.log4j.ConsoleAppender">
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* %c{1}: %m (%F, line %L)%n"/>
+        </layout>
+    </appender>
+
+    <!-- log file -->
+    <appender name="file" class="org.apache.log4j.FileAppender">
+        <param name="File" value="logs/jackrabbit-monarca-webapp.log"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* %c{1}: %m (%F, line %L)%n"/>
+        </layout>
+    </appender>
+    
+    <!-- ====================================================================== -->
+    <!-- C A T E G O R I E S                                                    -->
+    <!-- ====================================================================== -->
+     <category name="org.apache.jackrabbit.monarca">
+      <priority value="debug"/>
+      <appender-ref ref="console"/>
+      <appender-ref ref="file"/>
+    </category>
+
+</log4j:configuration>

Propchange: incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/log4j.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/web.xml?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/web.xml Thu Oct 11 05:20:33 2007
@@ -0,0 +1,267 @@
+<?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.
+  -->
+
+<!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>Microsling Web Application</display-name>
+
+  <servlet>
+    <servlet-name>Logging</servlet-name>
+    <description>Configures the Log4J logging facility.</description>
+    <servlet-class>org.apache.jackrabbit.j2ee.LoggingServlet</servlet-class>
+
+    <init-param>
+      <param-name>log4j-config</param-name>
+      <param-value>/WEB-INF/log4j.xml</param-value>
+      <description>initial log4j configuration</description>
+    </init-param>
+
+    <load-on-startup>10</load-on-startup>
+  </servlet>
+
+  <servlet>
+    <servlet-name>JackrabbitRepository</servlet-name>
+    <description>
+      Creates a Jackrabbit repository (or opens it if already created) and makes it available as
+      a servlet context attribute.
+    </description>
+    <servlet-class>org.apache.jackrabbit.servlet.jackrabbit.JackrabbitRepositoryServlet</servlet-class>
+    <load-on-startup>20</load-on-startup>
+  </servlet>
+
+  <servlet>
+    <servlet-name>RepositoryAccess</servlet-name>
+    <description>
+      Used by the WebDAV servlet to access the repository
+    </description>
+    <servlet-class>org.apache.jackrabbit.j2ee.RepositoryAccessServlet</servlet-class>
+    
+    <init-param>
+      <param-name>repository.context.attribute.name</param-name>
+      <param-value>javax.jcr.Repository</param-value>
+    </init-param>
+    
+    <load-on-startup>40</load-on-startup>
+  </servlet>
+ 
+  <servlet>
+    <servlet-name>Webdav</servlet-name>
+    <description>Makes the repository available via WebDAV</description>
+    <servlet-class>org.apache.jackrabbit.j2ee.SimpleWebdavServlet</servlet-class>
+
+    <init-param>
+      <param-name>resource-path-prefix</param-name>
+      <param-value>/repository</param-value>
+      <description>defines the prefix for spooling resources out of the repository.</description>
+    </init-param>
+    <!--
+      <init-param>
+      <param-name>missing-auth-mapping</param-name>
+      <param-value>anonymous:anonymous</param-value>
+      <description>
+      Defines how a missing authorization header should be handled.
+      1) If this init-param is missing, a 401 response is generated.
+      This is suiteable for clients (eg. webdav clients) for which
+      sending a proper authorization header is not possible if the
+      server never sent a 401.
+      2) If this init-param is present with an empty value,
+      null-credentials are returned, thus forcing an null login
+      on the repository.
+      3) If this init-param has a 'user:password' value, the respective
+      simple credentials are generated.
+      </description>
+      </init-param>
+    -->
+    <!--
+      Optional parameter to define the value of the 'WWW-Authenticate' header
+    -->
+    <!--
+      <init-param>
+      <param-name>authenticate-header</param-name>
+      <param-value>Basic realm="Jackrabbit Webdav Server"</param-value>
+      <description>
+      Defines the value of the 'WWW-Authenticate' header.
+      </description>
+      </init-param>
+    -->
+    <!--
+      Parameter used to configure behaviour of webdav resources such as:
+      - destinction between collections and non-collections
+      - resource filtering
+    -->
+    <init-param>
+      <param-name>resource-config</param-name>
+      <param-value>/WEB-INF/webdav-resource-config.xml</param-value>
+      <description>Defines various dav-resource configuration parameters.</description>
+    </init-param>
+    <load-on-startup>50</load-on-startup>
+  </servlet>
+
+  <servlet>
+    <servlet-name>Microsling</servlet-name>
+    <description>Microsling support servlet</description>
+    <servlet-class>org.apache.sling.microsling.servlet.MicroSlingServlet</servlet-class>
+
+    <init-param>
+      <param-name>container-encoding</param-name>
+      <param-value>UTF-8</param-value>
+    </init-param>
+  
+    <init-param>
+      <param-name>form-encoding</param-name>
+      <param-value>UTF-8</param-value>
+    </init-param>
+  
+    <init-param>
+      <param-name>welcome-url</param-name>
+      <param-value>index.html</param-value>
+      <description>URL to redirect to when / is accessed</description>
+    </init-param>
+
+    <load-on-startup>999</load-on-startup>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>Microsling</servlet-name>
+    <url-pattern>/microsling/*</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>Webdav</servlet-name>
+    <url-pattern>/repository/*</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>JackrabbitRepository</servlet-name>
+    <url-pattern>/repository-info</url-pattern>
+  </servlet-mapping>
+
+  <!-- ====================================================================== -->
+  <!-- M I M E T Y P E   M A P P I N G                                          -->
+  <!-- ====================================================================== -->
+  <mime-mapping>
+    <extension>doc</extension>
+    <mime-type>application/msword</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>bin</extension>
+    <mime-type>application/octet-stream</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>pdf</extension>
+    <mime-type>application/pdf</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>ai</extension>
+    <mime-type>application/postscript</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>eps</extension>
+    <mime-type>application/postscript</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>ps</extension>
+    <mime-type>application/postscript</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>rtf</extension>
+    <mime-type>application/rtf</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>mif</extension>
+    <mime-type>application/vnd.mif</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>ppt</extension>
+    <mime-type>application/vnd.ms-powerpoint</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>vcd</extension>
+    <mime-type>application/x-cdlink</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>js</extension>
+    <mime-type>application/x-javascript</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>mp3</extension>
+    <mime-type>audio/mpeg</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>ram</extension>
+    <mime-type>audio/x-pn-realaudio</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>rm</extension>
+    <mime-type>audio/x-pn-realaudio</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>ra</extension>
+    <mime-type>audio/x-realaudio</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>gif</extension>
+    <mime-type>image/gif</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>jpeg</extension>
+    <mime-type>image/jpeg</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>jpg</extension>
+    <mime-type>image/jpeg</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>png</extension>
+    <mime-type>image/png</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>tiff</extension>
+    <mime-type>image/tiff</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>tif</extension>
+    <mime-type>image/tiff</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>css</extension>
+    <mime-type>text/css</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>asc</extension>
+    <mime-type>text/plain</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>txt</extension>
+    <mime-type>text/plain</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>xml</extension>
+    <mime-type>text/xml</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>html</extension>
+    <mime-type>text/html</mime-type>
+  </mime-mapping>
+  <mime-mapping>
+    <extension>htm</extension>
+    <mime-type>text/html</mime-type>
+  </mime-mapping>
+</web-app>

Propchange: incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/webdav-resource-config.xml
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/webdav-resource-config.xml?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/webdav-resource-config.xml (added)
+++ incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/webdav-resource-config.xml Thu Oct 11 05:20:33 2007
@@ -0,0 +1,162 @@
+<?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.
+  -->
+<!--
+<!DOCTYPE config [
+        <!ELEMENT config (iomanager , propertymanager, (collection | noncollection)? , filter?) >
+
+        <!ELEMENT iomanager (class, iohandler*) >
+        <!ELEMENT iohandler (class) >
+
+        <!ELEMENT propertymanager (class, propertyhandler*) >
+        <!ELEMENT propertyhandler (class) >
+
+        <!ELEMENT collection (nodetypes) >
+        <!ELEMENT noncollection (nodetypes) >
+
+        <!ELEMENT filter (class, namespaces?, nodetypes?) >
+
+        <!ELEMENT class >
+        <!ATTLIST class
+            name  CDATA #REQUIRED
+        >
+        <!ELEMENT namespaces (prefix | uri)* >
+        <!ELEMENT prefix (CDATA) >
+        <!ELEMENT uri (CDATA) >
+
+        <!ELEMENT nodetypes (nodetype)* >
+        <!ELEMENT nodetype (CDATA) >
+]>
+-->
+
+<config>
+    <!--
+    Defines the IOManager implementation that is responsible for passing import/export
+    request to the individual IO-handlers.
+    -->
+    <iomanager>
+        <!-- class element defines the manager to be used. The specified class
+             must implement the IOManager interface.
+             Note, that the handlers are being added and called in the order
+             they appear in the configuration.
+        -->
+        <class name="org.apache.jackrabbit.server.io.IOManagerImpl" />
+        <iohandler>
+            <class name="org.apache.jackrabbit.server.io.ZipHandler" />
+        </iohandler>
+        <iohandler>
+            <class name="org.apache.jackrabbit.server.io.XmlHandler" />
+        </iohandler>
+        <iohandler>
+            <class name="org.apache.jackrabbit.server.io.DirListingExportHandler" />
+        </iohandler>
+        <iohandler>
+            <class name="org.apache.jackrabbit.server.io.DefaultHandler" />
+        </iohandler>
+    </iomanager>
+    <!--
+    Example config for iomanager that populates its list of handlers with
+    default values. Therefore the 'iohandler' elements are omited.
+    -->
+    <!--
+    <iomanager>
+        <class name="org.apache.jackrabbit.server.io.DefaultIOManager" />
+    </iomanager>
+    -->
+    <!--
+    Defines the PropertyManager implementation that is responsible for export
+    and import of resource properties.
+    -->
+    <propertymanager>
+        <!-- class element defines the manager to be used. The specified class
+             must implement the PropertyManager interface.
+             Note, that the handlers are being added and called in the order
+             they appear in the configuration.
+        -->
+        <class name="org.apache.jackrabbit.server.io.PropertyManagerImpl" />
+        <propertyhandler>
+            <class name="org.apache.jackrabbit.server.io.ZipHandler" />
+        </propertyhandler>
+        <propertyhandler>
+            <class name="org.apache.jackrabbit.server.io.XmlHandler" />
+        </propertyhandler>
+        <propertyhandler>
+            <class name="org.apache.jackrabbit.server.io.DirListingExportHandler" />
+        </propertyhandler>
+        <propertyhandler>
+            <class name="org.apache.jackrabbit.server.io.DefaultHandler" />
+        </propertyhandler>
+    </propertymanager>
+    <!--
+    Define nodetypes, that should never by displayed as 'collection'
+    -->
+    <noncollection>
+        <nodetypes>
+            <nodetype>nt:file</nodetype>
+            <nodetype>nt:resource</nodetype>
+        </nodetypes>
+    </noncollection>
+    <!--
+    Example: Defines nodetypes, that should always be displayed as 'collection'.
+    -->
+    <!--
+    <collection>
+        <nodetypes>
+            <nodetype>nt:folder</nodetype>
+            <nodetype>rep:root</nodetype>
+        </nodetypes>
+    </collection>
+    -->
+    <!--
+     Filter that allows to prevent certain items from being displayed.
+     Please note, that this has an effect on PROPFIND calls only and does not
+     provide limited access to those items matching any of the filters.
+
+     However specifying a filter may cause problems with PUT or MKCOL if the
+     resource to be created is being filtered out, thus resulting in inconsistent
+     responses (e.g. PUT followed by PROPFIND on parent).
+     -->
+    <filter>
+        <!-- class element defines the resource filter to be used. The specified class
+             must implement the ItemFilter interface -->
+        <class name="org.apache.jackrabbit.webdav.simple.DefaultItemFilter" />
+        <!-- Nodetype names to be used to filter child nodes.
+             A child node can be filtered if the declaring nodetype of its definition
+             is one of the nodetype names specified in the nodetypes Element.
+             E.g. defining 'rep:root' as filtered nodetype whould result in jcr:system
+             being hidden but no other child node of the root node, since those
+             are defined by the nodetype nt:unstructered.
+        -->
+        <!--
+        <nodetypes>
+            <nodetype>rep:root</nodetype>
+        </nodetypes>
+        -->
+        <!-- Namespace prefixes or uris. Items having a name that matches any of the
+             entries will be filtered.
+        -->
+        <namespaces>
+            <prefix>rep</prefix>
+            <prefix>jcr</prefix>
+            <!--
+            <uri>internal</uri>
+            <uri>http://www.jcp.org/jcr/1.0</uri>
+            -->
+        </namespaces>
+    </filter>
+</config>
+

Propchange: incubator/sling/whiteboard/microsling/src/main/webapp/WEB-INF/webdav-resource-config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/sling/whiteboard/microsling/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/webapp/index.html?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/webapp/index.html (added)
+++ incubator/sling/whiteboard/microsling/src/main/webapp/index.html Thu Oct 11 05:20:33 2007
@@ -0,0 +1,68 @@
+<html>
+<head>
+  <title>Microsling homepage</title>
+  <link rel="stylesheet" href="microsling.css"/>
+</head>
+<body>
+  <h1>Microsling homepage</h1>
+  
+  <p>
+  	Sling request processing, reduced to the max!
+  </p>
+  
+  <h2>Overview</h2>
+  <p>
+	The goal of this prototype is to demonstrate the Sling HTTP
+	request processing in the simplest possible way, to help the
+	community converge on the goals and architecture of this 
+	module.
+  </p>
+  
+  <h2>No OSGi</h2>
+  <p>
+  	To keep things simple, microsling does <em>not</em> use OSGi.
+  	We will of course continue to use OSGi in the real Sling, and there are many
+  	places in the code which say <em>TODO - use OSGi plugins here</em>. Keeping things
+  	"static" for this example makes it easier to concentrate on the basics.
+  </p>
+
+  <h2>Status</h2>
+  <p>
+  	The basic request filtering and SlingServlet selection mechanisms are in place, but nothing
+  	is connected to the JCR Repository yet.
+  </p>
+  
+  <h2>Microsling test links</h2>
+  <p>
+    <ul>
+      <li>
+        <a href="microsling/testing-one-two">microsling/testing-one-two</a> should return a plain text response 
+      </li>
+      <li>
+        <a href="microsling/testing-one-two.notfound">microsling/testing-one-two.notfound</a> should return a 404
+      </li>
+    </ul>
+    <form action="microsling/whatever" method="POST">
+      <p>
+      	Submitting this form should cause an error 501: <em>POST method is not supported by DefaultSlingServlet</em>.
+      </p>
+      <input type="submit"/>
+    </form>
+  </p>
+  
+  <h2>More Test links</h2>
+  <p>
+    <ul>
+      <li>
+        <a href="repository-info">repository-info</a>, dumps the JCR repository
+        properties.
+      </li>
+      <li>
+        <a href="repository/default">WebDAV mount point</a>, use this URL to mount
+        the repository via WebDAV.
+      </li>
+    </ul>
+  </p>
+  
+</body>
+</html>
\ No newline at end of file

Propchange: incubator/sling/whiteboard/microsling/src/main/webapp/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/sling/whiteboard/microsling/src/main/webapp/microsling.css
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/webapp/microsling.css?rev=583796&view=auto
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/webapp/microsling.css (added)
+++ incubator/sling/whiteboard/microsling/src/main/webapp/microsling.css Thu Oct 11 05:20:33 2007
@@ -0,0 +1,15 @@
+/* use the jackrabbit site CSS */
+@import url("http://jackrabbit.apache.org/css/maven-base.css");
+@import url("http://jackrabbit.apache.org/css/maven-theme.css");
+@import url("http://jackrabbit.apache.org/css/site.css");
+
+/* for some reason the jackrabbit CSS doesn't define h1 */
+h1 {
+	border-color:#999999;
+	border-style:solid solid dotted;
+	border-width:0px 0px 1px;
+	color:#869900;
+	font-size:x-large;
+	font-weight:900;
+	padding:20px 4px 4px 0px;
+}

Propchange: incubator/sling/whiteboard/microsling/src/main/webapp/microsling.css
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message