You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by rg...@apache.org on 2006/11/20 23:56:25 UTC
svn commit: r477384 -
/forrest/trunk/whiteboard/forrest2/src/docs/createAReader.html
Author: rgardler
Date: Mon Nov 20 14:56:25 2006
New Revision: 477384
URL: http://svn.apache.org/viewvc?view=rev&rev=477384
Log:
Start of "how to create a reader" documentation
Added:
forrest/trunk/whiteboard/forrest2/src/docs/createAReader.html (with props)
Added: forrest/trunk/whiteboard/forrest2/src/docs/createAReader.html
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/src/docs/createAReader.html?view=auto&rev=477384
==============================================================================
--- forrest/trunk/whiteboard/forrest2/src/docs/createAReader.html (added)
+++ forrest/trunk/whiteboard/forrest2/src/docs/createAReader.html Mon Nov 20 14:56:25 2006
@@ -0,0 +1,69 @@
+<!--
+ 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 html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>How to Create a Reader</title>
+</head>
+<body>
+ <h1>Overview</h1>
+
+ <p>Readers are te first stage in the processing pipeline.
+ They read the source document for subsequent processing.
+ It is worth noting that a reader may no actually read a
+ file, it may generate the files content dynamically. This
+ document describes how to create a new reader.</p>
+
+ <h2>Chained Readers</h2>
+
+ <p>Chained readers provide a means of pre and/or post
+ processing a document retrieved from some other reader.</p>
+
+ <p class="todo">Bring over description from
+ examples/affiliateProductCatalogue.html</p>
+
+ <h2>Java Readers</h2>
+
+ <p>If you want to do complex processing in order to
+ generate the source document you can create a Java
+ class to carry out thge necessary processing. This
+ is really easy, simply extend
+ <span class="code">org.apache.forrest.core.reader.AbstractReader</span>
+ and implement <span class="code">public AbstractSourceDocument read(IController controller, URI requestURI, final Location location)</span>.
+ For example:
+ </p>
+
+ <p class="code">![CDATA[
+ public AbstractSourceDocument read(IController controller, URI requestURI,
+ Location location) throws MalformedURLException,
+ ProcessingException {
+ String content = "<example><document></example>";
+ String type = "org.apache.forrest.example";
+ XMLSourceDocument doc = new XMLSourceDocument(content, type);
+ return doc;
+ }
+ ]]></p>
+
+ <p>If your reader needs to do some initialisation before it
+ executes the read method you should override
+ <span class="code">public void init()</span>.</p>
+
+
+
+</body>
+</html>
\ No newline at end of file
Propchange: forrest/trunk/whiteboard/forrest2/src/docs/createAReader.html
------------------------------------------------------------------------------
svn:eol-style = native