Return-Path: Delivered-To: apmail-forrest-svn-archive@www.apache.org Received: (qmail 85953 invoked from network); 30 Aug 2007 00:15:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Aug 2007 00:15:56 -0000 Received: (qmail 40801 invoked by uid 500); 30 Aug 2007 00:15:52 -0000 Delivered-To: apmail-forrest-svn-archive@forrest.apache.org Received: (qmail 40766 invoked by uid 500); 30 Aug 2007 00:15:52 -0000 Mailing-List: contact svn-help@forrest.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Forrest Developers List" List-Id: Delivered-To: mailing list svn@forrest.apache.org Received: (qmail 40757 invoked by uid 99); 30 Aug 2007 00:15:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2007 17:15:52 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Aug 2007 00:16:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 275391A9832; Wed, 29 Aug 2007 17:15:33 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r570993 - in /forrest/trunk/whiteboard/forrest2/core/src: conf/defaultForrestContext.xml examples/helloWorld/src/forrestContext.xml examples/helloWorld/src/locationmap.xml main/org/apache/forrest/core/plugin/XSLTOutputPlugin.java Date: Thu, 30 Aug 2007 00:15:32 -0000 To: svn@forrest.apache.org From: rgardler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070830001533.275391A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rgardler Date: Wed Aug 29 17:15:32 2007 New Revision: 570993 URL: http://svn.apache.org/viewvc?rev=570993&view=rev Log: Use the locationmap to resolve output XSLTs Modified: forrest/trunk/whiteboard/forrest2/core/src/conf/defaultForrestContext.xml forrest/trunk/whiteboard/forrest2/core/src/examples/helloWorld/src/forrestContext.xml forrest/trunk/whiteboard/forrest2/core/src/examples/helloWorld/src/locationmap.xml forrest/trunk/whiteboard/forrest2/core/src/main/org/apache/forrest/core/plugin/XSLTOutputPlugin.java Modified: forrest/trunk/whiteboard/forrest2/core/src/conf/defaultForrestContext.xml URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/src/conf/defaultForrestContext.xml?rev=570993&r1=570992&r2=570993&view=diff ============================================================================== --- forrest/trunk/whiteboard/forrest2/core/src/conf/defaultForrestContext.xml (original) +++ forrest/trunk/whiteboard/forrest2/core/src/conf/defaultForrestContext.xml Wed Aug 29 17:15:32 2007 @@ -32,6 +32,6 @@ class="org.apache.forrest.core.plugin.XSLTOutputPlugin"> + value="internal-to-html.xsl" /> Modified: forrest/trunk/whiteboard/forrest2/core/src/examples/helloWorld/src/forrestContext.xml URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/src/examples/helloWorld/src/forrestContext.xml?rev=570993&r1=570992&r2=570993&view=diff ============================================================================== --- forrest/trunk/whiteboard/forrest2/core/src/examples/helloWorld/src/forrestContext.xml (original) +++ forrest/trunk/whiteboard/forrest2/core/src/examples/helloWorld/src/forrestContext.xml Wed Aug 29 17:15:32 2007 @@ -32,6 +32,6 @@ class="org.apache.forrest.core.plugin.XSLTOutputPlugin"> + value="internal-to-html.xsl" /> Modified: forrest/trunk/whiteboard/forrest2/core/src/examples/helloWorld/src/locationmap.xml URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/src/examples/helloWorld/src/locationmap.xml?rev=570993&r1=570992&r2=570993&view=diff ============================================================================== --- forrest/trunk/whiteboard/forrest2/core/src/examples/helloWorld/src/locationmap.xml (original) +++ forrest/trunk/whiteboard/forrest2/core/src/examples/helloWorld/src/locationmap.xml Wed Aug 29 17:15:32 2007 @@ -16,13 +16,16 @@ limitations under the License. --> - + - + - + + + + Modified: forrest/trunk/whiteboard/forrest2/core/src/main/org/apache/forrest/core/plugin/XSLTOutputPlugin.java URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/src/main/org/apache/forrest/core/plugin/XSLTOutputPlugin.java?rev=570993&r1=570992&r2=570993&view=diff ============================================================================== --- forrest/trunk/whiteboard/forrest2/core/src/main/org/apache/forrest/core/plugin/XSLTOutputPlugin.java (original) +++ forrest/trunk/whiteboard/forrest2/core/src/main/org/apache/forrest/core/plugin/XSLTOutputPlugin.java Wed Aug 29 17:15:32 2007 @@ -33,6 +33,8 @@ import org.apache.forrest.core.Controller; import org.apache.forrest.core.document.DefaultOutputDocument; import org.apache.forrest.core.document.IDocument; +import org.apache.forrest.core.document.AbstractSourceDocument; +import org.apache.forrest.core.exception.ProcessingException; import org.apache.log4j.Logger; /** @@ -59,17 +61,16 @@ final TransformerFactory tFactory = TransformerFactory.newInstance(); log.debug("Processing document with output stylesheet from " + this.getXsltPath()); try { - final String xsltURL = this.getClass().getResource( - this.getXsltPath()).toExternalForm(); - final File xslt = new File(new URI(xsltURL)); + final AbstractSourceDocument xsltDoc = controller.getSourceDocuments(new URI(this.getXsltPath())); Transformer transformer; - transformer = tFactory.newTransformer(new StreamSource(xslt)); - final StringReader reader = new StringReader(doc - .getContentAsString()); + transformer = tFactory.newTransformer(new StreamSource(new StringReader(xsltDoc.getContentAsString()))); + log.debug("Got transformer "); + final StringReader reader = new StringReader(doc.getContentAsString()); final StreamSource in = new StreamSource(reader); final ByteArrayOutputStream outStream = new ByteArrayOutputStream(); final StreamResult out = new StreamResult(outStream); transformer.transform(in, out); + log.debug("Transformed"); return new DefaultOutputDocument(doc.getRequestURI(), outStream.toString()); } catch (final TransformerConfigurationException e) { // TODO Auto-generated catch block @@ -83,7 +84,11 @@ // TODO Auto-generated catch block e.printStackTrace(); return null; - } + } catch (final ProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } } public String getXsltPath() {