forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r179988 - in /forrest/trunk/main/fresh-site/src/documentation: content/xdocs/samples/linking.xml content/xdocs/samples/subdir/test4.html content/xdocs/test1.html content/xdocs/test2.html sitemap.xmap
Date Sat, 04 Jun 2005 13:37:44 GMT
Author: rgardler
Date: Sat Jun  4 06:37:42 2005
New Revision: 179988

URL: http://svn.apache.org/viewcvs?rev=179988&view=rev
Log:
Provide information on how to emulate the behaviour of 0.6 and earlier with respect to serving
raw HTML (FIXES FOR-505)

Added:
    forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples/subdir/test4.html
      - copied unchanged from r178279, forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples/subdir/test4.html
    forrest/trunk/main/fresh-site/src/documentation/content/xdocs/test1.html
      - copied unchanged from r177954, forrest/trunk/main/fresh-site/src/documentation/content/xdocs/test1.html
    forrest/trunk/main/fresh-site/src/documentation/content/xdocs/test2.html
      - copied unchanged from r177954, forrest/trunk/main/fresh-site/src/documentation/content/xdocs/test2.html
Modified:
    forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples/linking.xml
    forrest/trunk/main/fresh-site/src/documentation/sitemap.xmap

Modified: forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples/linking.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples/linking.xml?rev=179988&r1=179987&r2=179988&view=diff
==============================================================================
--- forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples/linking.xml (original)
+++ forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples/linking.xml Sat
Jun  4 06:37:42 2005
@@ -56,14 +56,19 @@
     <section id="resource-space">
       <title>Mapping the local resource space to the final URI space</title>
       <p>
-       For the generated files, the top-level of the
+       For both generated and raw (un-processed) files, the top-level of the
        URI space corresponds to the "<code>content/xdocs/</code>" directory,
        i.e. the location of the "<code>site.xml</code>" configuration file.
       </p>
-      <p>
-       For the raw un-processed content, the top-level of the URI space
-       corresponds to the "<code>content/</code>" directory.
-      </p>
+      <note>
+        In versions prior to 0.7 raw un-processed content was stored in
+        the "<code>content/</code>" directory. In 0.7 onwards, raw
+        un-processed data is stored alongside the xdocs. In addition,
+        in 0.6 and earlier HTML documents could be stored in the xdocs
+        directory and served without processing. If you 
+        you wish to emulate the behaviour of 0.6 and earlier see the 
+        next section.
+      </note>
       <p>
         A diagram will help.
       </p>
@@ -84,16 +89,25 @@
  content/xdocs/subdir/hello.sxw                subdir/hello.sxw
 ]]></source>
 
-<note>By using <a href="/docs/plugins/index.html">Forrest Input Plugins</a>
-you can process some file formats, such as
-OpenOffice.org documents and produce processed content from them. For example,
-content/xdocs/hello.sxw can be used to produce a skinned version of the
-document at hello.html. Similarly, you can use 
-<a href="/docs/plugins/index.html">Forrest Output Plugins</a> to
-create different output formats such as PDF, in this case content/xdocs/hello.sxw
-can produce hello.pdf</note>
-
-      <p>Now for some examples ...</p>
+  <section>
+    <title>How Plugins May Affect The URI Space</title>
+      <p>By using <a href="/docs/plugins/index.html">Forrest Input Plugins</a>
+      you can process some file formats, such as
+      OpenOffice.org documents and produce processed content from them. For example,
+      the file <code>content/xdocs/hello.sxw</code> can be used to produce a

+      skinned version of the document at with the name <code>hello.html</code>.
+      Similarly, you can use <a href="/docs/plugins/index.html">Forrest Output 
+      Plugins</a> to #create different output formats such as PDF, in this 
+      case <code>content/xdocs/hello.sxw</code> can produce 
+      <code>hello.pdf</code>.</p>
+      
+      <p>However, this does not affect the handling of raw content. That is, you 
+      can still retrieve the raw un-processed version with, for example, 
+      <code>hello.sxw</code>. If you want to prevent the user retrieving the

+      un-processed version you will have to create matchers that intercept
+      these requests within your projects sitemap.</p>
+      </section>
+  
     </section>
 
     <section id="generated">
@@ -133,6 +147,76 @@
       <code>content/hello.pdf</code> ...
       </p>
       <source><![CDATA[<a href="../hello.pdf">]]><a href="../hello.pdf">../hello.pdf</a><![CDATA[</a>]]></source>
+      
+      <section>
+        <title>Emulating the Behaviour of pre 0.7 Versions of Forrest</title>
+        
+        <p>In versions prior to 0.7 raw un-processed content was stored in
+        the "<code>content/</code>" directory. In 0.7 onwards, raw
+        un-processed data is stored alongside the xdocs. In addition
+        in 0.6 and earlier HTML files could be stored in the xdocs 
+        directory and they would be served without further processing.
+        As described above, this is not the case in 0.7 where HTML files
+        are, by default, skinned by Forrest.</p>
+        
+        <p>If you 
+        you wish to emulate the behaviour of 0.6 and earlier then you
+        must add the following to your projects sitemap.</p>
+        
+        <source>
+&lt;map:match pattern="**.html"&gt;
+ &lt;map:select type="exists"&gt;
+  &lt;map:when test="{project:content}{0}"&gt;
+    &lt;map:read src="{project:content}/{0}" mime-type="text/html"/&gt;
+    &lt;!--
+      Use this instead if you want JTidy to clean up your HTML
+      &lt;map:generate type="html" src="{project:content}/{0}" /&gt;
+      &lt;map:serialize type="html"/&gt;
+    --&gt;
+  &lt;/map:when&gt;
+  &lt;map:when test="{project:content.xdocs}{0}"&gt;
+    &lt;map:read src="{project:content.xdocs}/{0}" mime-type="text/html"/&gt;
+    &lt;!--
+      Use this instead if you want JTidy to clean up your HTML
+      &lt;map:generate type="html" src="{project:content.xdocs}/{0}" /&gt;
+      &lt;map:serialize type="html"/&gt;
+    --&gt;
+  &lt;/map:when&gt;
+ &lt;/map:select&gt;
+&lt;/map:match&gt;
+        </source>
+        
+        <p>This allows us to create links to un-processed skinned files stored
+        in the <code>{project:content}</code> directory. For example:  
+        <a href="/test1.html">href="/test1.html"</a> and 
+        <a href="/test2.html">href="/test2.html"</a>.</p>
+        
+        <p>We can also create links to un-processed skinned files stored
+        in the <code>{project:content.xdocs}</code> directory. For example: 

+        <a href="test3.html">href="test3.html"</a> and 
+        <a href="subdir/test4.html">subdir/test4.html</a>.</p>
+        
+        <p>Note that you can change the matchers above to selectively serve some
+        content as raw un-processed content, whilst still serving other content
+        as skinned documents. For example, the following snippet would allow
+        you to serve the content of an old, deprecated site without processing
+        from Forrest whilst still allowing all other content to be processed 
+        by Forrest in the normal way:</p>
+        
+        <source>
+&lt;map:match pattern="old_site/**.html"&gt;
+ &lt;map:select type="exists"&gt;
+  &lt;map:when test="{project:content}{0}"&gt;
+    &lt;map:read src="{project:content}/{0}" mime-type="text/html"/&gt;
+    &lt;!--
+      Use this instead if you want JTidy to clean up your HTML
+      &lt;map:generate type="html" src="{project:content}/{0}" /&gt;
+      &lt;map:serialize type="html"/&gt;
+    --&gt;
+  &lt;/map:when&gt;
+&lt;/map:match&gt;
+        </source>
+      </section>
     </section>
 
     <section id="url">

Modified: forrest/trunk/main/fresh-site/src/documentation/sitemap.xmap
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/fresh-site/src/documentation/sitemap.xmap?rev=179988&r1=179987&r2=179988&view=diff
==============================================================================
--- forrest/trunk/main/fresh-site/src/documentation/sitemap.xmap (original)
+++ forrest/trunk/main/fresh-site/src/documentation/sitemap.xmap Sat Jun  4 06:37:42 2005
@@ -18,6 +18,36 @@
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:pipelines>
   <map:pipeline>
+    <!-- Emulate the behaviour of version 0.6
+         You do not need this if you are not using raw HTML files
+         or if you are not upgrading from 0.6 
+         
+         Note you can use modfications of the matching patterns to
+         handle different types of HTML content differently, that
+         is some could be skinned, whilst some could be served
+         un-processed.
+         -->
+    <map:match pattern="**.html">
+     <map:select type="exists">
+      <map:when test="{project:content}{0}">
+        <map:read src="{project:content}/{0}" mime-type="text/html"/>
+        <!--
+          Use this instead if you want JTidy to clean up your HTML
+          <map:generate type="html" src="{project:content}/{0}" />
+          <map:serialize type="html"/>
+        -->
+      </map:when>
+      <map:when test="{project:content.xdocs}{0}">
+        <map:read src="{project:content.xdocs}/{0}" mime-type="text/html"/>
+        <!--
+          Use this instead if you want JTidy to clean up your HTML
+          <map:generate type="html" src="{project:content.xdocs}/{0}" />
+          <map:serialize type="html"/>
+        -->
+      </map:when>
+     </map:select>
+   </map:match>
+  
    <map:match pattern="**custom.xml">
     <map:generate src="{project:content.xdocs}{1}custom.xml" />
     <map:transform src="{project:resources.stylesheets}/hello2document.xsl" />



Mime
View raw message