Permalink
Browse files

Deleted sitemesh-docs from main source tree... moving it to a dedicat…

…ed sitemesh-website project
  • Loading branch information...
1 parent f52ac80 commit 45de21f004260b441088cf536f5f71dee99639c4 @joewalnes joewalnes committed Jan 20, 2010
View
3 BUILD.txt
@@ -16,13 +16,12 @@ You can also run mvn from a module directory to work just with that.
The subdirectories in this package are modules. They are:
* sitemesh : Main SiteMesh project
-* sitemesh-docs: End-user documentation
* sitemesh-examples-*: End user examples
* sitemesh-tools-*: Tools used by SiteMesh development team
=== IDE instructions ===
-IntelliJ 8: Create new project from existing structure (Maven), using pom.xml in sitemesh module.
+IntelliJ 9: Create new project from existing structure (Maven), using pom.xml in sitemesh module.
View
2 package.sh
@@ -7,7 +7,7 @@
POM_VERSION=3.0.0-SNAPSHOT
RELEASE_VERSION=3.0-alpha-1
-MODULES_TO_PACKAGE="sitemesh sitemesh-examples-* sitemesh-docs sitemesh-tools-benchmark"
+MODULES_TO_PACKAGE="sitemesh sitemesh-examples-* sitemesh-tools-benchmark"
mvn clean && mvn package
View
1 pom.xml
@@ -18,7 +18,6 @@
<modules>
<module>sitemesh</module>
- <module>sitemesh-docs</module>
<module>sitemesh-tools-benchmark</module>
<module>sitemesh-examples-hellowebapp</module>
</modules>
View
4 sitemesh-docs/.gitignore
@@ -1,4 +0,0 @@
-.classpath
-.project
-.settings
-target/*
View
16 sitemesh-docs/README.txt
@@ -1,16 +0,0 @@
-This is the SiteMesh documentation.
-
-Currently it exists as web-app, however as soon as SiteMesh offline support
-has been implemented, it will also be a generated offline website included
-in the SiteMesh documentation.
-
-To view:
- mvn package
- mvn -Djetty.port=1234 jetty:run
- Goto http://localhost:1234/sitemesh-docs/
-
-To publish the public site, you need Google AppEngine Java SDK installed and
-a Google Account that is marked as a developer for the 'sitemesh-docs' AppEngine
-project.
- mvn package
- [app-engine-dir]/bin/appcfg.sh update target/sitemesh-docs
View
27 sitemesh-docs/pom.xml
@@ -1,27 +0,0 @@
-<project>
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>sitemesh-parent</artifactId>
- <groupId>org.sitemesh</groupId>
- <version>3.0.0-SNAPSHOT</version>
- <relativePath>../</relativePath>
- </parent>
-
- <artifactId>sitemesh-docs</artifactId>
- <name>SiteMesh end-user documentation</name>
- <packaging>war</packaging>
-
- <build>
- <finalName>sitemesh-docs</finalName>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sitemesh</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
View
17 sitemesh-docs/src/main/webapp/WEB-INF/appengine-web.xml
@@ -1,17 +0,0 @@
-<!--
- This is a Google AppEngine configuration.
- AppEngine is used to host the public SiteMesh docs at http://sitemesh-docs.appspot.com/
- See README.txt
--->
-<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
-
- <application>sitemesh-docs</application>
-
- <version>dev</version>
-
- <!-- Don't treat any of the files as static - so Servlet engine (and SiteMesh) can handle them. -->
- <static-files>
- <exclude path="**"/>
- </static-files>
-
-</appengine-web-app>
View
3 sitemesh-docs/src/main/webapp/WEB-INF/sitemesh3.xml
@@ -1,3 +0,0 @@
-<sitemesh>
- <mapping path="/*" decorator="/decorators/main.html"/>
-</sitemesh>
View
19 sitemesh-docs/src/main/webapp/WEB-INF/web.xml
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- version="2.5">
-
- <display-name>SiteMesh Documentation</display-name>
-
- <filter>
- <filter-name>sitemesh</filter-name>
- <filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>sitemesh</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-</web-app>
View
41 sitemesh-docs/src/main/webapp/ant-examples/build.xml
@@ -1,41 +0,0 @@
-<project name="ant-examples">
-
- <taskdef name="sitemesh"
- classname="org.sitemesh.ant.SiteMeshTask"
- classpath="path/to/sitemesh-3.x.jar"/>
-
- <target name="generate-basic-documentation"
- description="Generate static content with the company look and feel.">
- <sitemesh srcdir="documentation"
- config="config/sitemesh.xml"
- destdir="site/documentation"
- includes="**/*.html"
- excludes="decorators/*"/>
- </target>
-
- <target name="generate-advance-documentation"
- description="Generate static content with the company look and feel that isn't private.">
- <sitemesh destdir="site/documentation"
- config="config/sitemesh.xml">
- <sitemeshfileset dir="documentation">
- <include name="**/*.html"/>
- <exclude name="private/*"/>
- </sitemeshfileset>
-
- <sitemeshfileset dir="presentation">
- <include name="**/*.html"/>
- </sitemeshfileset>
- </sitemesh>
- </target>
-
- <target name="generate-with-custom-decorator"
- description="Generate static content that's internal to the company.">
- <sitemesh destdir="site/documentation">
- <sitemeshfileset dir="documentation"
- decorator="decorators/private.html">
- <include name="private/*.html"/>
- </sitemeshfileset>
- </sitemesh>
- </target>
-
-</project>
View
170 sitemesh-docs/src/main/webapp/configuration.html
@@ -1,170 +0,0 @@
-<html>
- <head>
- <title>Configuring SiteMesh</title>
- </head>
- <body>
-
- <p>SiteMesh supports two main approaches to configurations - <b>XML</b> or <b>Java</b>. It's up to you which you use. In fact, you can even use them both.</p>
-
- <table class="definitionTable">
- <tr>
- <th>XML</th>
- <th>Java</th>
- </tr>
- <tr>
- <td>
- <ul>
- <li>Simplest to get started with</li>
- <li>Automatically reloads when config file changes</li>
- <li>Does not require Java programming</li>
- </ul>
- </td>
- <td>
- <ul>
- <li>Allows for greater customization of SiteMesh</li>
- <li>Avoids yet another configuration file</li>
- <li>Can be used from higher level languages such as JRuby, Groovy, Scala...</li>
- </ul>
- </td>
- </tr>
- </table>
-
- <h2>XML based configuration</h2>
-
- <p>The configuration file should live in <code><b>/WEB-INF/sitemesh3.xml</b></code> in your web-application.</p>
-
- <h4>Example</h4>
- <pre class='code'>&lt;sitemesh&gt;
- &lt;mapping path="<b>/*</b>" decorator="<b>/decorator.html</b>"/&gt;
- &lt;mapping path="<b>/admin/*</b>" decorator="<b>/admin-decorator.html</b>"/&gt;
-&lt;/sitemesh&gt;</pre>
-
- <h2>Java based configuration</h2>
-
- <p>To use the Java based configuration, subclass <code><b>org.sitemesh.config.ConfigurableSiteMeshFilter</b></code>
- and overload the <code><b>applyCustomConfiguration(SiteMeshFilterBuilder builder)</b></code> method.
- You shall be passed an object that you can use to configure SiteMesh. You then deploy this filter in to your web-application.</p>
-
- <h4>Example</h4>
- <pre class='code'>public class MySiteMeshFilter extends ConfigurableSiteMeshFilter {
- @Override
- protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) {
- <b>builder.addDecoratorPath("/*", "/decorator.html")
- .addDecoratorPath("/admin/*", "/admin/decorator.html");</b>
- }
-}</pre>
-
- <p><b>Note:</b> The <code><b>SiteMeshFilterBuilder</b></code> class supports a chainable API where each method returns an instance of itself. This is a convenience, but you
- don't have to use this style.</p>
-
- <p><b>Note:</b> If you also have an XML config file, SiteMesh will load this before calling <code>applyCustomConfiguration()</code>.
- This allows you to use XML for some configuration and Java for more advanced aspects.</p>
-
-
-
- <h2>Configuring Decorator Mappings</h2>
-
- <p>This is the most common configuration applied to SiteMesh - mapping which decorators are applied based on the paths.</p>
-
- <p>Things you can do:</p>
- <ul>
- <li>Map a default decorator to all paths</li>
- <li>Map a decorator to a specific path</li>
- <li>Map multiple decorators to a path - each decorator is applied to the result of the previous</li>
- <li>Exclude a path from being decorated</li>
- </ul>
-
- <h4>XML</h4>
- <pre class="code">&lt;sitemesh&gt;
-
- &lt;!-- Map default decorator. This shall be applied to all paths if no other paths match. --&gt;
- <b>&lt;mapping decorator="/default-decorator.html"/&gt;</b>
-
- &lt;!-- Map decorators to path patterns. --&gt;
- <b>&lt;mapping path="/admin/*" decorator="/another-decorator.html"/&gt;</b>
- <b>&lt;mapping path="/*.special.jsp" decorator="/special-decorator.html"/&gt;</b>
-
- &lt;!-- Alternative convention. This is more verbose but allows multiple decorators
- to be applied to a single path. --&gt;
- <b>&lt;mapping&gt;
- &lt;path&gt;/articles/*&lt;/path&gt;
- &lt;decorator&gt;/decorators/article.html&lt;/decorator&gt;
- &lt;decorator&gt;/decorators/two-page-layout.html&lt;/decorator&gt;
- &lt;decorator&gt;/decorators/common.html&lt;/decorator&gt;
- &lt;/mapping&gt;</b>
-
- &lt;!-- Exclude path from decoration. --&gt;
- <b>&lt;mapping path="/javadoc/*" exclue="true"/&gt;</b>
- <b>&lt;mapping path="/brochures/*" exclue="true"/&gt;</b>
-
-&lt;/sitemesh&gt;</pre>
-
- <h4>Java</h4>
- <pre class='code'>public class MySiteMeshFilter extends ConfigurableSiteMeshFilter {
- @Override
- protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) {
- // Map default decorator. This shall be applied to all paths if no other paths match.
- <b>builder.addDecoratorPath("/*", "/default-decorator.html")</b>
- // Map decorators to path patterns.
- <b>.addDecoratorPath("/admin/*", "/another-decorator.html")</b>
- <b>.addDecoratorPath("/*.special.jsp", "/special-decorator.html")</b>
- // Map multiple decorators to the a single path.
- <b>.addDecoratorPaths("/articles/*", "/decorators/article.html",
- "/decoratos/two-page-layout.html",
- "/decorators/common.html")</b>
- // Exclude path from decoration.
- <b>.addExcludedPath("/javadoc/*")</b>
- <b>.addExcludedPath("/brochures/*")</b>;
- }
-}</pre>
-
- <h2>Advanced Configuration</h2>
-
- <p>For most users, the decorator mappings above should be enough. But if you want more options...</p>
-
- <h3>MIME Types</h3>
-
- <p>By default, SiteMesh will only intercept responses that set the <b><code>Content-Type</code></b> HTTP header to <b><code>text/html</code></b>.</p>
-
- <p>This can be altered to allow SiteMesh to intercept responses for other types. This is only applicable for the SiteMesh Filter - it is ignored by the offline site builder.</p>
-
- <h4>XML</h4>
- <pre class="code">&lt;sitemesh&gt;
- <b>&lt;mime-type&gt;text/html&lt;/mime-type&gt;
- &lt;mime-type&gt;application/vnd.wap.xhtml+xml&lt;/mime-type&gt;
- &lt;mime-type&gt;application/xhtml+xml&lt;/mime-type&gt;</b>
- ...
-&lt;/sitemesh&gt;</pre>
-
- <h4>Java</h4>
- <pre class='code'>public class MySiteMeshFilter extends ConfigurableSiteMeshFilter {
- @Override
- protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) {
- <b>builder.setMimeTypes("text/html", "application/xhtml+xml", "application/vnd.wap.xhtml+xml")</b>;
- }
-}</pre>
-
- <h3>Deploying Tag Rule Bundles</h3>
-
- <p>An advanced feature of SiteMesh is the ability to define custom rules that manipulate tags on a page.
- These are classes that implement <code>org.sitemesh.content.tagrules.TagRuleBundle</code>.</p>
-
- <h4>XML</h4>
- <pre class="code">&lt;sitemesh&gt;
- <b>&lt;content-processor&gt;
- &lt;tag-rule-bundle class="com.something.CssCompressingBundle"/&gt;
- &lt;tag-rule-bundle class="com.something.LinkRewritingBundle"/&gt;
- &lt;/content-processor&gt;</b>
- ...
-&lt;/sitemesh&gt;</pre>
-
- <h4>Java</h4>
- <pre class='code'>public class MySiteMeshFilter extends ConfigurableSiteMeshFilter {
- @Override
- protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) {
- <b>builder.addTagRuleBundles(new CssCompressingBundle(), new LinkRewritingBundle())</b>;
- }
-}</pre>
-
- </body>
-</html>
View
BIN sitemesh-docs/src/main/webapp/decorators/background.png
Deleted file not rendered
View
149 sitemesh-docs/src/main/webapp/decorators/main.html
@@ -1,149 +0,0 @@
-<html>
- <head>
- <title><sitemesh:write property='title'>SiteMesh3 documentation</sitemesh:write></title>
- <style type='text/css'>
-
- /* Shared style */
- body {
- font-family: "Trebuchet MS", verdana, arial, sans-serif;
- font-size: 12px;
- background: #cacaca url('decorators/background.png') repeat-x scroll 0 0;
- padding: 0;
- }
- pre {
- background-color: #eeeeee;
- border: 1px solid #aaaaaa;
- padding: 4px;
- margin: 20px;
- overflow: auto;
- }
- .definitionTable {
- margin: 10px 20px 10px 20px;
- border-collapse: collapse;
- }
- .definitionTable th {
- border: 1px solid #cccccc;
- background-color: #eeeeee;
- font-weight: bold;
- text-align: left;
- }
- .definitionTable td {
- border: 1px solid #cccccc;
- padding: 3px;
- font-size: 12px;
- }
-
- /* Decorator layout */
- #layoutContainer {
- width: 800px;
- border: 1px solid #aaaaaa;
- margin: 0 auto;
- padding: 4px 0 0 4px;
- background-color: #cccccc;
- }
- .layoutSection {
- border: 1px solid #aaaaaa;
- background-color: #ffffff;
- margin: 0 4px 4px 0;
- padding: 10px;
- }
-
- /* Top links */
- #topLinks {
- text-align: right;
- }
-
- #topLinks a {
- padding: 0.5em;
- display: inline-block;
- margin: 0;
- font-size: 110%;
- }
-
- #topLinks a:hover {
- background-color: #f9f9f9;
- }
-
- #topLinks a.selected {
- background-color: #fb9d2c;
- color: #ffffff;
- }
-
- /* Curve the corners of the page to match the logo. Works on FireFox/Safari/Chrome, but not IE/Opera (though degrades nicely). */
- #layoutContainer {
- border-radius: 15px;
- -moz-border-radius: 15px;
- -webkit-border-radius: 15px;
- }
- .layoutSection:first-child {
- border-top-left-radius: 10px;
- border-top-right-radius: 10px;
- -moz-border-radius-topleft: 10px;
- -moz-border-radius-topright: 10px;
- -webkit-border-top-left-radius: 10px;
- -webkit-border-top-right-radius: 10px;
- }
- .layoutSection:last-child {
- border-bottom-left-radius: 10px;
- border-bottom-right-radius: 10px;
- -moz-border-radius-bottomleft: 10px;
- -moz-border-radius-bottomright: 10px;
- -webkit-border-bottom-left-radius: 10px;
- -webkit-border-bottom-right-radius: 10px;
- }
-
- </style>
- <sitemesh:write property='head'/>
- </head>
- <body>
- <div id='layoutContainer'>
- <div class='layoutSection'>
- <a href="index.html" title="Return to SiteMesh homepage"><img src='decorators/sitemesh-logo.gif' width='330' height='82' alt='SiteMesh 3' border='0' style='float: left; padding-right: 20px'/></a>
- <div id="topLinks">
- <a href="overview.html" title="Learn about what SiteMesh is, why it's useful, and how it can help you">Overview</a>
- <a href="http://github.com/sitemesh/sitemesh3/downloads" target="external" title="Download the latest version of the SiteMesh library, examples and documentation">Download</a>
- <a class="selected" href="index.html" title="Browse the SiteMesh user manual">Documentation</a>
- <a href="http://groups.google.com/group/sitemesh3-users" target="external" title="Get help, and discuss SiteMesh with other users">Discuss</a>
- <a href="http://dev.sitemesh.org/" target="external" title="Get involved in the SiteMesh project - suggest features, report issues, contribute changes...">Contribute</a>
- </div>
- <p id="linkTitle">
- <div class="warning" style="border: 1px solid #cccccc; background-color: #ffeeee; padding: 1px; margin: 2px 2px 2px 350px;">
- SiteMesh 3 is <b>ALPHA</b> quality - not even BETA yet. There's lots missing.<br/>
- If you are looking for a stable version, try <a href="http://www.opensymphony.com/sitemesh/">SiteMesh 2</a> instead.
- </div>
- </p>
- <span style='clear:left'></span>
- </div>
- <div class='layoutSection' style='background-color: white; text-align: justify;'>
- <h1 style='margin: 0;'><sitemesh:write property='title'/></h1>
-
- <sitemesh:write property='body'>
- <h1>Here is a title</h1>
- <p>Main body goes here.<p>
- <p>Blah de blah blah blah blah blah blah de blah blah blah blah blah blah de blah blah blah blah blah blah.
- Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.
- Blah de blah blah blah blah blah blah de blah blah blah blah blah blah de blah blah blah blah blah blah.
- Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. </p>
- </sitemesh:write>
-
- </div>
- <div class='layoutSection' style='text-align: center'>
- &copy; 1999-2009 <a href="http://www.sitemesh.org/">sitemesh.org</a> - This site built with SiteMesh (of course)
- </div>
- </div>
-
- <!-- Google Analytics -->
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- try {
- var pageTracker = _gat._getTracker("UA-110973-3");
- pageTracker._setDomainName(".sitemesh.org"); // Track across all *.sitemesh.org subdomains.
- pageTracker._trackPageview();
- } catch(err) {}
- </script>
-
- </body>
-</html>
View
BIN sitemesh-docs/src/main/webapp/decorators/sitemesh-logo.gif
Deleted file not rendered
View
222 sitemesh-docs/src/main/webapp/getting-started.html
@@ -1,222 +0,0 @@
-<html>
- <head>
- <title>Getting started with SiteMesh3</title>
- <meta name='author' content='Joe Walnes'>
- <style type='text/css'>
- .decorator { color: #000099; }
- .content { color: #990000; }
- </style>
- </head>
- <body>
-
- <h2>Introduction</h2>
-
- <p>This tutorial is a quick introduction to using SiteMesh3 in a web-application. It covers:</p>
- <ul>
- <li>A high level overview of how SiteMesh3 works</li>
- <li>Installation and configuration</li>
- <li>Building and applying a simple decorator</li>
- </ul>
-
- <p>It is recommend you read the high level <a href="overview.html">SiteMesh Overview</a> before this tutorial.</p>
-
- <h2>SiteMesh in web applications</h2>
-
- <p>In a web application, SiteMesh acts as a Servler Filter. It allows requests to be handled by the Servlet engine as normal,
- but the resulting HTML (referred to as the <b>content</b>) will be intercepted before being returned to the browser.</p>
-
- <p>The intercepted content has certain properties extracted (typically the contents of the
- <code>&lt;title&gt;</code>, <code>&lt;head&gt;</code> and <code>&lt;body&gt;</code> tags and is then passed on to a
- second request that should return the common look and feel for the site (referred to as the <b>decorator</b>). The decorator
- contains placeholders for where the properties extracted from the content should be inserted.</p>
-
- <p>Under the hood, a key component of the SiteMesh architecture is the <b>content processor</b>. This is an efficient engine
- for transforming and extracting content from HTML content. For most users, it's fine to use it as it comes, but it is also possible
- to define your own transformation and extraction rules.</p>
-
- <p>SiteMesh does not care what technologies are used to generate the content or the decorator. They may be
- static files, Servlet, JSPs, other filters, MVC frameworks, etc. So long as it's served by the Servlet engine, SiteMesh can
- work with it.</p>
-
- <h2>Dependencies</h2>
-
- <p>Running SiteMesh3 requires at least:</p>
- <ul>
- <li>JDK 1.5</li>
- <li>A Servlet 2.5 compliant container</li>
- <li>The SiteMesh runtime library</li>
- </ul>
-
- <p>The SiteMesh library should be <a href="http://github.com/sitemesh/sitemesh3/downloads" target="external">downloaded</a> and placed in <code><b>/WEB-INF/lib/</b></code>.</p>
-
- <h2>Setup</h2>
-
- <p>Insert the SiteMesh Filter in <code><b>/WEB-INF/web.xml</b></code>:</p>
-<pre class='code'>&lt;web-app&gt;
-
- ...
-
- &lt;filter&gt;
- &lt;filter-name&gt;<b>sitemesh</b>&lt;/filter-name&gt;
- &lt;filter-class&gt;<b>org.sitemesh.config.ConfigurableSiteMeshFilter</b>&lt;/filter-class&gt;
- &lt;/filter&gt;
-
- &lt;filter-mapping&gt;
- &lt;filter-name&gt;<b>sitemesh</b>&lt;/filter-name&gt;
- &lt;url-pattern&gt;<b>/*</b>&lt;/url-pattern&gt;
- &lt;/filter-mapping&gt;
-
-&lt;/web-app&gt;</pre>
-
- <p>Deploy the web-application to your Servlet container. From this point onwards, this tutorial assumes the web-app is running at <code><b>http://myserver/</b></code>.
-
- <h2>Creating a decorator</h2>
-
- <p>The <b>decorator</b> contains the common layout and style that should be applied to the pages in the web application.
- It is a template that contains place holders for the content's <code>&lt;title&gt;</code>, <code>&lt;head&gt;</code> and
- <code>&lt;body&gt;</code> elements.</p>
-
- <p>At the bare minimum, it should contain:</p>
-
- <pre class='code decorator'>&lt;html&gt;
- &lt;head&gt;
- &lt;title&gt;<b>&lt;sitemesh:write property='title'/&gt;</b>&lt;/title&gt;
- <b>&lt;sitemesh:write property='head'/&gt;</b>
- &lt;/head&gt;
- &lt;body&gt;
- <b>&lt;sitemesh:write property='body'/&gt;</b>
- &lt;/body&gt;
-&lt;/html&gt;</pre>
-
- <p>The <code><b>&lt;sitemesh:write property='...'/&gt;</b></code> tag will be rewritten by SiteMesh to include properties extracted from
- the content. There are more properties that can be extracted from the content and it's possible to define your own rules - that will
- be covered in another tutorial.</p>
-
- <p>The bare minimum decorator isn't very useful. Let's add some style and a bit of common layout.</p>
-
- <p>Create the file <code><b>/decorator.html</b></code> in your web-app, containing:</p>
-
- <pre class='code decorator'>&lt;html&gt;
- &lt;head&gt;
- &lt;title&gt;SiteMesh example: <b>&lt;sitemesh:write property='title'/&gt;</b>&lt;/title&gt;
- &lt;style type='text/css'&gt;
- /* Some CSS */
- body { font-family: arial, sans-serif; background-color: #ffffcc; }
- h1, h2, h3, h4 { text-align: center; background-color: #ccffcc; border-top: 1px solid #66ff66; }
- .mainBody { padding: 10px; border: 1px solid #555555; }
- .disclaimer { text-align: center; border-top: 1px solid #cccccc; margin-top: 40px; color: #666666; font-size: smaller; }
- &lt;/style&gt;
- <b>&lt;sitemesh:write property='head'/&gt;</b>
- &lt;/head&gt;
- &lt;body&gt;
-
- &lt;h1 class='title'&gt;SiteMesh example site: <b>&lt;sitemesh:write property='title'/&gt;</b>&lt;/h1&gt;
-
- &lt;div class='mainBody'&gt;
- <b>&lt;sitemesh:write property='body'/&gt;</b>
- &lt;/div&gt;
-
- &lt;div class='disclaimer'&gt;Site disclaimer. This is an example.&lt;/div&gt;
-
- &lt;/body&gt;
-&lt;/html&gt;</pre>
-
- <p>In this example, the decorator is a static <code>.html</code> file, but if you want the decorator to be more dynamic, technologies such as JSP, FreeMarker, etc can be used.
- SiteMesh doesn't care - it just needs a path that can be served content by the Servlet engine.</p>
-
- <h2>Configuration</h2>
-
- <p>SiteMesh needs to be configured to know about this decorator and what it should do with it.</p>
-
- <p>The configuration file should be created at <code><b>/WEB-INF/sitemesh3.xml</b></code>:</p>
-<pre class='code'>&lt;sitemesh&gt;
- &lt;mapping path="<b>/*</b>" decorator="<b>/decorator.html</b>"/&gt;
-&lt;/sitemesh&gt;</pre>
-
- <p>This tells SiteMesh that requests matching the path <code>/*</code> (i.e. all requests) should be decorated with <code>/decorator.html</code> that we just created.</p>
-
- <p><i>If you don't like the idea of having to use XML to configure SiteMesh, don't worry - there are alternative mechanisms including
- directly in <code>WEB-INF/web.xml</code>, programatically through a Java API, through Spring, by naming convention, or any custom way you may choose to plug in.
- These are explained further in <a href="configuration.html">another article</a>.</i></p>
-
- <h2>Creating some content</h2>
-
- <p>Now to create some content. This is defined in plain HTML content. Create <code><b>/hello.html</b></code>:</p>
-
- <pre class='code content'>&lt;html&gt;
- &lt;head&gt;
- &lt;title&gt;<b>Hello World</b>&lt;/title&gt;
- <b>&lt;meta name='description' content='A simple page'&gt;</b>
- &lt;/head&gt;
- &lt;body&gt;
- <b>&lt;p&gt;Hello &lt;strong&gt;world&lt;/strong&gt;!&lt;/p&gt;</b>
- &lt;/body&gt;
-&lt;/html&gt;</pre>
-
- <p>Like the decorator, the content may be static files or dynamically generated by the Servlet engine (e.g. JSP).</p>
-
- <h2>The result</h2>
-
- <p>Pointing your browser to <code><b>http://myserver/hello.html</b></code> will serve the content you just created, with the
- decorator applied. The resulting merged HTML will look like this:</p>
-
- <pre class='code decorator'>&lt;html&gt;
- &lt;head&gt;
- &lt;title&gt;SiteMesh example: <b class='content'>Hello World</b>&lt;/title&gt;
- &lt;style type='text/css'&gt;
- /* Some CSS */
- body { font-family: arial, sans-serif; background-color: #ffffcc; }
- h1, h2, h3, h4 { text-align: center; background-color: #ccffcc; border-top: 1px solid #66ff66; }
- .mainBody { padding: 10px; border: 1px solid #555555; }
- .disclaimer { text-align: center; border-top: 1px solid #cccccc; margin-top: 40px; color: #666666; font-size: smaller; }
- &lt;/style&gt;
- <b class='content'>&lt;meta name='description' content='A simple page'&gt;</b>
- &lt;/head&gt;
- &lt;body&gt;
-
- &lt;h1 class='title'&gt;SiteMesh example site: <b class='content'>Hello World</b>&lt;/h1&gt;
-
- &lt;div class='mainBody'&gt;
- <b class='content'>&lt;p&gt;Hello &lt;strong&gt;world&lt;/strong&gt;!&lt;/p&gt;</b>
- &lt;/div&gt;
-
- &lt;div class='disclaimer'&gt;Site disclaimer. This is an example.&lt;/div&gt;
-
- &lt;/body&gt;
-&lt;/html&gt;</pre>
-
- <p>As you can see, the <code>&lt;title&gt;</code>, <code>&lt;head&gt;</code> and <code>&lt;body&gt;</code> have
- been extracted from the content and inserted into the decorator template.</p>
-
- <h2>Summary</h2>
-
- <p>A quick recap:</p>
- <ul>
- <li>SiteMesh is installed by dropping the library jar in <code><b>/WEB-INF/lib</b></code> and creating a filter (with mapping) in <code><b>/WEB-INF/web.xml</b></code></li>
- <li>It can be configured by creating a <code><b>/WEB-INF/sitemesh3.xml</b></code> file, or through <a href="configuration.html">other configuration methods</a></li>
- <li>The filter intercepts requests to <b>Content</b>, runs it through the <b>Content Processor</b> and merges with a <b>Decorator</b>
- <li>The <b>Content</b> is defined by an HTML page, that contains the vanilla HTML content of the site</li>
- <li>The <b>Decorator</b> is also defined by an HTML page, that contains the look and feel of the site, and placeholder <code><b>&lt;sitemesh:write&gt;</b></code> tags to indicate where the <b>Content</b> should be merged in</li>
- <li>The <b>Content Processor</b> contains the rules for extracting and transforming the content - it has some simple default rules and can be customized</li>
- </ul>
-
- <!--
- <h2>Learn more</h2>
-
- <p>This tutorial skipped over many of the features of SiteMesh. You have enough information to start using SiteMesh, but if you want to learn more...</p>
-
- <ul>
- <li><a href="overview.html">SiteMesh overview</a></li>
- <li><a href="configuration.html">Configuring SiteMesh</a></li>
- <li><a href="inline.html">Decorating inline page fragments</a></li>
- <li><a href="chaining.html">Chaining decorators</a></li>
- <li><a href="composition.html">Page composition</a></li>
- <li><a href="content-processor.html">Content processor and tag reference</a></li>
- <li><a href="offline.html">Building offline websites</a></li>
- <li><a href="examples/index.html">Browse examples</a></li>
- <li><a href="cookbook/index.html">SiteMesh cookbook</a></li>
- </ul>
- -->
-
- </body>
-</html>
View
27 sitemesh-docs/src/main/webapp/index.html
@@ -1,27 +0,0 @@
-<html>
- <head>
- <title>SiteMesh3 Documentation</title>
- <meta name='author' content='Joe Walnes'>
- </head>
- <body>
-
- <h2>Articles</h2>
- <ul>
- <li><a href="overview.html">SiteMesh overview</a></li>
- <li><a href="new-in-sitemesh3.html">What's new in SiteMesh 3?</a></li>
- <li><a href="getting-started.html">Getting started</li>
- <li><a href="configuration.html">Configuring SiteMesh</a></li>
- <li><a href="offline.html">Building offline websites</a></li>
- </ul>
-
- <!--
- <h2>Building sites</h2>
- <ul>
- <li><a href="inline.html">Decorating inline page fragments</a></li>
- <li><a href="chaining.html">Chaining decorators</a></li>
- <li><a href="composition.html">Page composition</a></li>
- </ul>
- -->
-
- </body>
-</html>
View
47 sitemesh-docs/src/main/webapp/new-in-sitemesh3.html
@@ -1,47 +0,0 @@
- <html>
- <head>
- <title>What's new in SiteMesh 3?</title>
- </head>
- <body>
-
- <p>SiteMesh 3 has been completely rebuilt from the ground up. It's more efficient, easier to use and extensible. While the code is new, it still holds the same
- values of SiteMesh 2, namely simplicity, robustness and performance.</p>
-
- <h2>New Content Processor Architecture</h2>
- <p>The internals of how SiteMesh processes content have been radically changed. The result is typically a 3X gain in throughput and half the memory usage (based on some typical sized samples).</p>
- <p>The new architecture also opens up new possibilities for upcoming features...</p>
-
- <h2>Decorator Chaining</h2>
- <p>Decorators can now be chained together in a website. That is, content can be decorated, then decorated again (and again).
- The new architecture of the content processor means there is little overhead in applying multiple decorators.</p>
- <!--For example: mypage.html -> two-column-decorator.html -> common-look-and-feel-decorator.html-->
-
- <h2>No Tie-ins to Templating Systems</h2>
- <p>No longer do you need to commit to JSP or Velocity to build your decorators. Like content, decorators can be generated by any technology - even static .html files.</p>
-
- <h2>Simplified Configuration</h2>
- <p>Want to configure purely through Java code, through XML, through Spring, or maybe by convention? It's your choice.
- And it's easy to plug in your own configuration mechanism.</p>
-
- <h2>Offline Site Generation</h2>
- <p>SiteMesh comes with tools to allow you decorators to content for static websites as an offline task. This can be invoked from a command line tool, an Ant task or through a Java API.</p>
- <p>Can be used to cut the cost of hosting (no Java runtime needed on servers) or simplify distribution (e.g. include web-site as part of a downloaded package).</p>
-
- <h2>Code Modernization</h2>
- <p>Under the hood, over 10 years worth of cruft has been cleaned up. This means a simpler API. And many long-standing design
- decisions have been revisited, which has made the things above possible, and opens the possibility of your own extensions.</p>
- <p>The various extension APIs have been revisited to make the easier to understand, with useful hooks and clear documentation.</p>
-
- <h2>Reusable Core Building Blocks</h2>
- <p>Many of the underlying building blocks of SiteMesh are useful to other applications. These have been decoupled from the code, allowing you to
- reuse them in your own application, even if you don't intend to use SiteMesh.</p>
- <ul>
- <li>The ContentBufferingFilter is a reusable Servlet Filter that intercepts responses and allows modifications to be made to the content.</li>
- <li>The HTML TagProcessor is a high-performant and extensible tag parser that allows for extraction and transformations of content.</li>
- </ul>
-
- <h2>Relicensed under the Apache Software License v2.0</h2>
- <p>This license is used much more widely and approved by many organizations.</p>
-
- </body>
-</html>
View
196 sitemesh-docs/src/main/webapp/offline.html
@@ -1,196 +0,0 @@
-<html>
- <head>
- <title>Building offline websites with SiteMesh</title>
- <style>
- .attribute{
- color: blue;
- font-weight: bold;
- }
- .node {
- color: #330099;
- font-weight: bold;
- }
- </style>
- </head>
- <body>
-
- <p>A new feature in SiteMesh 3 is being able to apply decorators to content as an offline task, typically as part of a build step.</p>
-
- <p>If both your content and your decorators are static, this offers a few benefits:</p>
- <ul>
- <li>Allows final content to be distributed as pre-generated folder. Useful for including documentation with products without having to include a full Servlet compliant web-server.</li>
- <li>Cuts down server loads - most web-server architectures are optimized for serving static files.</li>
- <li>Provides more flexibility on where you can host content.</li>
- </ul>
-
- <p>It's also possible to reuse decorators and configuration between a web application that generates decorated content on the fly,
- and offline generated files.</p>
-
- <h2>Usage</h2>
-
- <p>There are a few different approaches to invoking the SiteMesh offline generator:</p>
- <ol>
- <li><b>Command line interface</b></li>
- <li><b><a href="http://ant.apache.org/" target="external">Apache Ant</a> task</b></li>
- <li><b>Java API</b> (this can be embedded in applications, or used from higher level languages such as JRuby, Groovy or Scala)</li>
- </ol>
-
- <p>Each of these can have the mappings of the decorators passed directly to them, or load from the SiteMesh <a href="configuration.html">configuration file</a>.</p>
-
- <p>Use the approach that suits your project.</p>
-
- <h2>Command line interface</h2>
-
- <p>You can invoke the command line interface by running the executable sitemesh.jar. It requires Java 5 but no other dependencies.</p>
-
- <p>Invoking on it's own will output a detailed help message:</p>
-
- <pre class="code"><b>java -jar sitemesh-3.x.jar</b></pre>
-
- <h4>Arguments</h4>
- <p>The following arguments need to be passed to the command line:</p>
- <table class="definitionTable">
- <tr>
- <td><b><code>-src</code></b></td>
- <td>Required</td>
- <td>Path to source directory, containing content and decorators</td>
- </tr>
- <tr>
- <td><b><code>-dest</code></b></td>
- <td>Required</td>
- <td>Path to destination directory, where decorated content will be written</td>
- </tr>
- <tr>
- <td><b><code>-dest</code></b></td>
- <td>Required</td>
- <td>Path to destination directory, where decorated content will be written</td>
- </tr>
- <tr>
- <td><b><code>-config</code></b></td>
- <td rowspan="2">One of these</td>
- <td>Path to <a href="configuration.html">configuration file</a></td>
- </tr>
- <tr>
- <td><b><code>-decoratorMapping</code></b></td>
- <td>TODO</a></td>
- </tr>
- <tr>
- <td><b><code>FILE1 FILE2 FILE3...</code></b></td>
- <td>Required</td>
- <td>List of content files to apply decorators to. These must be relative to the <code>src</code> directory</td>
- </tr>
- </table>
-
- <h4>Example</h4>
- <pre class="code">java -jar sitemesh-3.x.jar -src project/src -config project/sitemesh.xml -dest project/build index.html page1.html page2.html</pre>
-
- <h2>Ant Task</h2>
-
- <h3>Overview</h3>
- <p>The sitemesh.jar comes prepackaged with a custom Ant task that can be used for offline processing. In the following examples, we're going to look
- at how to install and use the SiteMeshTask to generate static content in the offline mode.</p>
-
- <h3>SiteMeshTask</h3>
- <p>The SiteMeshTask defines the following attributes:</p>
- <ol>
- <li>destDir - The output folder in which all of the decorated files will be placed.</li>
- <li>config - The location of the SiteMesh configuration file.</li>
- <li>srcdir - The source directory which contains all of the files to be decorated.</li>
- <li>includes - An Ant style filter of what files to include.</li>
- <li>excludes - An Ant style filter of what files to exclude.</li>
- </ol>
- <p>The SiteMeshTask can also accept the following child nodes:</p>
- <ol>
- <li>fileset - The standard Ant <a href="http://ant.apache.org/manual/CoreTypes/fileset.html">FileSet</a> that will use the srcdir of the sitemesh node.</li>
- <li>sitemeshfileset - A custom SiteMesh FileSet that supports an additional attribute called "decorator" which can be used to associate a decorator with the
- given FileSet.</li>
- </ol>
-
- <h3>Getting started!</h3>
- <p>The below provides a high level outline of what steps we're going to cover in this section.</p>
- <ol>
- <li>Create a SiteMesh configuration file.</li>
- <li>Register the SiteMeshTask with Ant</li>
- <li>Define the &lt;<span class="node">sitemesh</span>/&gt; node.</li>
- <li>Execute Ant</li>
- </ol>
-
- <h4>1. Creating the SiteMesh configuration file</h4>
- <p>The SiteMeshTask can be given a configuration file to tell SiteMesh how to decorate files. The power of this feature is that the configuration is then
- externalized from the buid.xml file. In our first two examples, we're going to show how to use this form of the SiteMeshTask. Below is a very simple
- SiteMesh configuration file that applies the main.html decorator to all pages.</p>
- <pre>&lt;<span class="node">sitemesh</span>&gt;
- &lt;<span class="node">mapping</span> <span class="attribute">path</span>="/*" <span class="attribute">decorator</span>="/decorators/main.html"/&gt;
-&lt;<span class="node">/sitemesh</span>&gt;
-</pre>
-
- <h4>2. Registering SiteMeshTask with Ant</h4>
- <p>In order to use SiteMesh from within Ant, the first thing you will need to do is register the SiteMeshTask with Ant using the following
- &lt;<span class="node">taskdef</span>/&gt; declaration.</p>
- <pre class="code">&lt;<span class="node">project</span> <span class="attribute">name</span>="my-ant-project"&gt;
-
- <b>&lt;<span class="node">taskdef</span> <span class="attribute">name</span>="sitemesh"
- <span class="attribute">classname</span>="org.sitemesh.ant.SiteMeshTask"
- <span class="attribute">classpath</span>="path/to/sitemesh-3.x.jar"/&gt;</b>
-
- ...
-
-&lt;<span class="node">/project</span>&gt;</pre>
- <p>For more information on registering custom tasks within Ant, please see <a href="http://ant.apache.org/manual/tutorial-writing-tasks.html" target="_new">Writing Ant Tasks</a>.</p>
-
- <h4>3. Define the &lt;<span class="node">sitemesh</span>/&gt; node.</h4>
- <p>Now that we've created the SiteMesh configuration file and registered the SiteMeshTask with Ant, it's time to start using SiteMesh within our tasks.</p>
-
- <h5>Using the sitemesh task without a fileset.</h5>
- <p>Let's look at how to provide &lt;<span class="node">sitemesh</span>/&gt; with a configuration file and tell it what directories to include or exclude.</p>
- <p>In this example, we're going to process all of the files stored in "project/src" and place the decorated files into "project/build".</p>
- <pre class="code">&lt;<span class="node">project</span> <span class="attribute">name</span>="my-ant-project"&gt;
-
- &lt;<span class="node">target</span> <span class="attribute">name</span>="my-target"&gt;
- <b>&lt;<span class="node">sitemesh</span> <span class="attribute">srcdir</span>="project/src"
- <span class="attribute">config</span>="project/sitemesh.xml"
- <span class="attribute">destdir</span>="project/build"
- <span class="attribute">includes></span>="**/*.html"
- <span class="attribute">excludes</span>="decorators/*"/&gt;</b>
- &lt;<span class="node">/target</span>&gt;
-
-&lt;<span class="node">/project</span>&gt;</pre>
-
- <p>The benefit to the above is that all configuration is externalized from the the build.xml file.</p>
-
- <h5>Using the sitemesh task with the sitemeshfileset</h5>
- <p>In the below example, multiple source folders are used by provided a sitemeshfileset. This provides greater control over what folders
- should be included or excluded, but still leverage a common destination folder and configuration file.</p>
- <pre class="code">&lt;<span class="node">project</span> <span class="attribute">name</span>="my-ant-project"&gt;
-
- &lt;<span class="node">sitemesh</span> <span class="attribute">destdir</span>="site/documentation"
- <span class="attribute">config</span>="config/sitemesh.xml"&gt;
- &lt;<span class="node">sitemeshfileset</span> <span class="attribute">dir</span>="documentation"&gt;
- &lt;<span class="node">include</span> <span class="attribute">name</span>="**/*.html"/&gt;
- &lt;<span class="node">exclude</span> <span class="attribute">name</span>="private/*"/&gt;
- &lt;<span class="node">/sitemeshfileset</span>&gt;
-
- &lt;<span class="node">sitemeshfileset</span> <span class="attribute">dir</span>="presentation"&gt;
- &lt;<span class="node">include</span> <span class="attribute">name</span>="**/*.html"/&gt;
- &lt;<span class="node">/sitemeshfileset</span>&gt;
- &lt;<span class="node">/sitemesh</span>&gt;
-
-&lt;<span class="node">/project</span>&gt;</pre>
-
- <h5>Using the sitemesh task with the sitemeshfileset with an associated decorator</h5>
- <p>In our finaly example, a decorator will be used on each sitemeshfileset.</p>
- <pre class="code">&lt;<span class="node">project</span> <span class="attribute">name</span>="my-ant-project"&gt;
-
- &lt;<span class="node">target</span> <span class="attribute">name</span>="generate-with-custom-decorator"
- <span class="attribute">description</span>="Generate static content that's internal to the company."&gt;
- &lt;<span class="node">sitemesh</span> <span class="attribute">destdir</span>="site/documentation"&gt;
- &lt;<span class="node">sitemeshfileset</span> <span class="attribute">dir</span>="documentation"
- <span class="attribute">decorator</span>="decorators/private.html"&gt;
- &lt;<span class="node">include</span> <span class="attribute">name</span>="private/*.html"/&gt;
- &lt;<span class="node">/sitemeshfileset</span>&gt;
- &lt;<span class="node">/sitemesh</span>&gt;
- &lt;<span class="node">/target</span>&gt;
-
-&lt;<span class="node">/project</span>&gt;</pre>
- </body>
-</html>
View
BIN sitemesh-docs/src/main/webapp/overview.gif
Deleted file not rendered
View
22 sitemesh-docs/src/main/webapp/overview.html
@@ -1,22 +0,0 @@
-<html>
- <head>
- <title>SiteMesh3 Overview</title>
- </head>
- <body>
-
- <ul>
- <li>SiteMesh is a web-page layout and decoration framework and web- application integration framework to aid in
- creating sites consisting of pages for which a consistent look/feel, navigation and layout scheme is required.</li>
- <li>SiteMesh intercepts requests to any static or dynamically generated HTML page requested through the
- web-server, processes the content and then merges it with one or more <i>decorators</i> to build the final result.</li>
- <li>SiteMesh can also be used compose large pages of smaller pages and layouts.</li>
- <li>SiteMesh is fast. Really fast.</li>
- <li>SiteMesh can be used in Java based web-applications, or applied to content as an offline job.</li>
- <li>SiteMesh is extensible.</li>
- <li><a href="getting-started.html">Get started...</a></li>
- </ul>
-
- <p style="text-align:center; padding: 20px;"><img src="overview.gif" width="585" height="825" alt="" border=""/></p>
-
- </body>
-</html>

0 comments on commit 45de21f

Please sign in to comment.