forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Williams" <william...@gmail.com>
Subject Re: svn commit: r479061 - in /forrest/trunk/whiteboard/forrest2/core/src: core/org/apache/forrest/cli/ core/org/apache/forrest/core/ core/org/apache/forrest/core/document/ core/org/apache/forrest/core/plugin/ core/org/apache/forrest/core/reader/ test
Date Sat, 25 Nov 2006 12:00:33 GMT
On 11/24/06, rgardler@apache.org <rgardler@apache.org> wrote:
> Author: rgardler
> Date: Fri Nov 24 16:34:49 2006
> New Revision: 479061
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=479061
> Log:
> Make the requestURI visible throughout the document processing pipeline by keeping it
within the document generated at each stage of the pipeline.
> We can then use this to save the document content to a file in the CLI.
>
> Modified:
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/cli/CLI.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/Controller.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/AbstractDocument.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/AbstractOutputDocument.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/AbstractSourceDocument.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/AggregatedSourceDocument.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/DefaultOutputDocument.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/DefaultSourceDocument.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/DocumentFactory.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/IDocument.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalDocument.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/XMLSourceDocument.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/plugin/BaseOutputPlugin.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/plugin/PassThroughInputPlugin.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/plugin/XSLTInputPlugin.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/plugin/XSLTOutputPlugin.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/reader/FileReader.java
>     forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/reader/HTTPReader.java
>     forrest/trunk/whiteboard/forrest2/core/src/test/org/apache/forrest/test/core/plugins/input/HelloWorldInputPlugin.java
>
> Modified: forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/cli/CLI.java
> URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/cli/CLI.java?view=diff&rev=479061&r1=479060&r2=479061
> ==============================================================================
> --- forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/cli/CLI.java (original)
> +++ forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/cli/CLI.java Fri
Nov 24 16:34:49 2006
> @@ -16,6 +16,8 @@
>   */
>  package org.apache.forrest.cli;
>
> +import java.io.File;
> +import java.io.FileWriter;
>  import java.io.IOException;
>  import java.net.MalformedURLException;
>  import java.net.URI;
> @@ -56,7 +58,6 @@
>                 }
>
>                 try {
> -                       AbstractOutputDocument doc = null;
>                         controller = new Controller();
>                         System.out.println("\n Processing request for " + args[0]);
>                         unProcessedUris.add(args[0]);
> @@ -93,12 +94,27 @@
>                                 log.debug("Processing: " + strUri);
>                                 doc = controller.getOutputDocument(uri);
>                                 unProcessedUris.addAll(doc.getLocalDocumentLinks());
> -                               System.out.println("\n Resulting document for request
" + uri
> -                                               + " is:\n");
> -                               System.out.println(doc.getContentAsString());
> +                               outputDocument(doc, uri);
>                                 processedUris.add(strUri);
>                         }
>                 }
> +       }
> +
> +       /**
> +        * Output the document.
> +        * @param doc
> +        * @param uri
> +        * @throws IOException
> +        */
> +       private static void outputDocument(AbstractOutputDocument doc, URI uri) throws
IOException {
> +               System.out.println("\n Resulting document for request " + uri
> +                               + " is:\n");
> +               System.out.println(doc.getContentAsString());
> +
> +               File outFile = new File("c:\\tmp\\" + doc.getPath());

I know this is experimental code, but....
--tim

Mime
View raw message