This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new 43fa98a5 Update README and index page
43fa98a5 is described below
commit 43fa98a512fb45e425c54660e82b09bebac689f9
Author: Bertrand Delacretaz <[email protected]>
AuthorDate: Thu Aug 28 18:29:22 2025 +0200
Update README and index page
---
history/microsling/.gitignore | 2 +-
history/microsling/README.md | 24 ++++
history/microsling/README.txt | 39 ------
history/microsling/src/main/webapp/index.html | 193 ++++++++++++--------------
4 files changed, 116 insertions(+), 142 deletions(-)
diff --git a/history/microsling/.gitignore b/history/microsling/.gitignore
index 28953189..335188f6 100644
--- a/history/microsling/.gitignore
+++ b/history/microsling/.gitignore
@@ -1,4 +1,4 @@
derby.log
jackrabbit-repository
logs
-velocity.log
+velocity.log*
diff --git a/history/microsling/README.md b/history/microsling/README.md
new file mode 100644
index 00000000..2989f9fa
--- /dev/null
+++ b/history/microsling/README.md
@@ -0,0 +1,24 @@
+# Microsling: the Sling request processing, reduced to the max
+
+THIS CODE IS KEPT FOR HISTORICAL REASONS ONLY !
+
+As it helped define the Sling design back in the times.
+
+The goal of this prototype, created
+[back in
2007](https://grep.codeconsult.ch/2007/10/12/microsling-yet-another-cool-web-applications-framework/)
+was 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
+
+To build and run this use
+
+ mvn clean package jetty:run
+
+Which should say "Started [email protected]:8080" once
+the build is done.
+
+Then, connect to http://localhost:8080/ which should return a page
+saying "Microsling homepage" with instructions for playing with
+this code.
diff --git a/history/microsling/README.txt b/history/microsling/README.txt
deleted file mode 100644
index ce6f3e36..00000000
--- a/history/microsling/README.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-------------------------------------------------------------
-Microsling: the Sling request processing, reduced to the max
- ****
- THIS IS OBSOLETE - see the microsling-core module in
- the main sling code repository
- ****
-------------------------------------------------------------
-
-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 [email protected]: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.
diff --git a/history/microsling/src/main/webapp/index.html
b/history/microsling/src/main/webapp/index.html
index 25d9a01f..ecff5b24 100644
--- a/history/microsling/src/main/webapp/index.html
+++ b/history/microsling/src/main/webapp/index.html
@@ -1,29 +1,25 @@
<html>
+
<head>
- <title>microsling homepage</title>
- <link rel="stylesheet" href="microsling.css"/>
+ <title>Apache Sling :: Microsling homepage</title>
+ <link rel="stylesheet" href="microsling.css" />
</head>
+
<body>
- <h1>microsling homepage</h1>
+ <h1>Apache Sling :: Microsling homepage</h1>
- <div style="color:red; font-weight:bold; font-size: 18pt">
- The microsling code from the sling-whiteboard is OBSOLETE,
- see the microsling-code module in the main Sling code
- repository instead.
- </div>
-
<p>
- <em>Sling request processing, reduced to the max!</em>
+ <em>Exploratory code from back in the days, when Sling was being designed,
in 2007.</em>
</p>
-
+
<h2>Overview</h2>
<p>
- The goal of microsling 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.
+ The goal of microsling 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>microsling test links</h2>
<ul>
<li>
@@ -47,87 +43,79 @@
</a>: explains how to use FreeMarker templates to render content.
</li>
</ul>
-
+
<h2>Show me the code</h2>
<p>
- Here's a brief description of how microsling processes HTTP requests.
Follow the links to the source code
- for more details.
+ Here's a brief description of how microsling processes HTTP requests.
+ </p>
+ <p>
+ It was updated in 2025 as many links to code were broken, so it might not
be 100% accurate
+ but it shows the general idea. Which is very similar to what Sling ended
up doing!
+ </p>
+ <ul>
<ul>
<li>
- The main <a
href="http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/servlet/MicroSlingServlet.java?view=markup">MicroSlingServlet</a>
- handles HTTP requests. That's probably where you want to
- start studying the code.
- </li>
- <li>
- <a
href="http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/RequestFilter.java?view=markup">RequestFilter</a>
- objects process the incoming requests before passing them on to
SlingServlet objects
- which do the actual processing.
- <ul>
- <li>
- The
- <a
href="http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/resource/ResourceResolverFilter.java?view=markup">ResourceResolverFilter</a>
- selects the <a
href="http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/Resource.java?view=markup">Resource</a>
(currently a JCR Node, OCM is not used yet) to process.
- </li>
- <li>
- The <a
href="http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/contenttype/ResponseContentTypeResolverFilter.java?view=markup">ResponseContentTypeResolverFilter</a>
- computes the desired <em>Content-Type</em> for the
response, so that rendering scripts or SlingServlets know what output format to
generate.
- </li>
- </ul>
- Other filters would include
- Locale selection, client capabilities analysis, etc.
-
- </li>
- <li>
- After applying the RequestFilters, the MicroSlingServlet selects a
- <a
href="http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/api/SlingServlet.java?view=markup">SlingServlet</a>
to process the request.
- The first SlingServlet where canProcess(...) returns true is used.
- </li>
- <li>
- The <a
href="http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/requestcontext/SlingRequestContext.java?view=markup">SlingRequestContext</a>
is
- stored as a request attribute, and gives access to Sling-specific
objects (Resource, repository Session, etc.) used for request processing.
- </li>
- <li>
- A few SlingServlet classes are implemented (source code <a
href="http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/">here</a>):
- <ul>
- <li>
- The SlingPostServlet allows Nodes to be created by POSTing to URLs
ending
- with ".sling".
- </li>
- <li>
- The VelocityTemplatesServlet and RhinoJavascriptServlet execute
server-side scripts in those
- languages to process requests.
- </li>
- <li>
- The DefaultSlingServlet is used when no other SlingServlet wants
the request.
- </li>
- </ul>
- </li>
- <li>
- The <a
href="http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/scripting/SlingScriptResolver.java?view=markup">SlingScriptResolver</a>
- is used by the scripting SlingServlet classes to locate scripts in the
repository.
- See comments in that class for how script paths are computed based on
the Resource's resourceType and the
- request method and extension.
- </li>
- <li>
- Rendering scripts can generate various output formats, for example a
Velocity script named "get.xml.vlt" will
- cause a page with <em>Content-Type=text/xml</em> to be generated by
the VelocityTemplatesServlet.
+ The
+ <code>ResourceResolverFilter</code>
+ selects the <code>Resource</code> (currently a JCR Node, OCM is not
used yet) to process.
</li>
<li>
- The microsling architecture allows
- additional scripting engines (JSP, JRuby, BSF,...) to be plugged in
easily - and this would
- of course be much easier with OSGi.
+ The <code>ResponseContentTypeResolverFilter</code>
+ computes the desired <em>Content-Type</em> for the response, so that
rendering scripts or SlingServlets know
+ what output format to generate.
</li>
- <li>
- We'll probably need a ResponseFilter interface at some point, but for
now it's not needed. It could be useful
- to apply "rendering standards" to the output, adding
header/footers/glitter to HTML pages for example.
- </li>
- </ul>
- <p>
- If you have followed the links to source code in the above descriptions,
you've seen most or all of the interesting
- microsling source code. What's remaining are a few simple support
classes.
- </p>
+ </ul>
+ Other filters would include
+ Locale selection, client capabilities analysis, etc.
+ </li>
+ <li>
+ After applying the RequestFilters, the MicroSlingServlet selects a
+ <code>SlingServlet</code> to process the request.
+ The first SlingServlet where canProcess(...) returns true is used.
+ </li>
+ <li>
+ The <code>SlingRequestContext</code> is
+ stored as a request attribute, and gives access to Sling-specific
objects (Resource, repository Session, etc.)
+ used for request processing.
+ </li>
+ <li>
+ A few SlingServlet classes are implemented:
+ <ul>
+ <li>
+ The SlingPostServlet allows Nodes to be created by POSTing to URLs
ending
+ with ".sling".
+ </li>
+ <li>
+ The VelocityTemplatesServlet and RhinoJavascriptServlet execute
server-side scripts in those
+ languages to process requests.
+ </li>
+ <li>
+ The DefaultSlingServlet is used when no other SlingServlet wants the
request.
+ </li>
+ </ul>
+ </li>
+ <li>
+ The <code>SlingScriptResolver</code>
+ is used by the scripting SlingServlet classes to locate scripts in the
repository.
+ See comments in that class for how script paths are computed based on
the Resource's resourceType and the
+ request method and extension.
+ </li>
+ <li>
+ Rendering scripts can generate various output formats, for example a
Velocity script named "get.xml.vlt" will
+ cause a page with <em>Content-Type=text/xml</em> to be generated by the
VelocityTemplatesServlet.
+ </li>
+ <li>
+ The microsling architecture allows
+ additional scripting engines (JSP, JRuby, BSF,...) to be plugged in
easily - and this would
+ of course be much easier with OSGi.
+ </li>
+ <li>
+ We'll probably need a <code>ResponseFilter</code> interface at some
point, but for now it's not needed. It could be useful
+ to apply "rendering standards" to the output, adding
header/footers/glitter to HTML pages for example.
+ </li>
+ </ul>
</p>
-
+
<h2>No OSGi</h2>
<p>
To keep things simple, microsling does <em>not</em> use OSGi.
@@ -135,19 +123,20 @@
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>More test links</h2>
+
+ <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 (login = admin/admin).
- </li>
- </ul>
+ <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 (login = admin/admin).
+ </li>
+ </ul>
</p>
</body>
-</html>
+
+</html>
\ No newline at end of file