Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 41313 invoked by uid 500); 8 May 2003 05:05:19 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 41302 invoked by uid 500); 8 May 2003 05:05:18 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 41297 invoked from network); 8 May 2003 05:05:18 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 8 May 2003 05:05:18 -0000 Received: (qmail 200 invoked by uid 1342); 8 May 2003 05:05:22 -0000 Date: 8 May 2003 05:05:22 -0000 Message-ID: <20030508050522.199.qmail@icarus.apache.org> From: vgritsenko@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/webapp/samples/hello-world samples.xml sitemap.xmap X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N vgritsenko 2003/05/07 22:05:22 Modified: src/java/org/apache/cocoon/serialization ZipArchiveSerializer.java src/webapp sitemap.xmap src/webapp/samples/hello-world samples.xml sitemap.xmap Added: src/webapp/samples/hello-world/style/xsl page2sxw.xsl Log: Add OpenOffice Writer Hello World sample. Fix ZipSerializer: ensure no start/end element is called after exception. Revision Changes Path 1.1 cocoon-2.1/src/webapp/samples/hello-world/style/xsl/page2sxw.xsl Index: page2sxw.xsl =================================================================== OpenOffice.org 1.0.3 (Win32) Cocoon Sample Document 2003-05-07T22:59:08 2003-05-07T23:01:22 en-US 3 PT2M21S 0 0 26222 15004 true false false false view2 9202 4410 0 0 26220 15002 0 100 false false false 1 0 false false true true true true kgP+/1xcdmdyaXRzZW5rb3BjMlxIUCBMYXNlckpldCA1TAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= 0 true true false false false false Addresses \\vgritsenkopc2\HP LaserJet 5L true false false true 0 true Contacts true false 1.2 +38 -17 cocoon-2.1/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java Index: ZipArchiveSerializer.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ZipArchiveSerializer.java 9 Mar 2003 00:09:37 -0000 1.1 +++ ZipArchiveSerializer.java 8 May 2003 05:05:22 -0000 1.2 @@ -150,6 +150,12 @@ private NamespaceSupport nsSupport = new NamespaceSupport(); /** + * Store exception + */ + private SAXException exception = null; + + + /** * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager) */ public void compose(ComponentManager manager) throws ComponentException { @@ -199,30 +205,37 @@ */ public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { + + // Damage control. Sometimes one exception is just not enough... + if (this.exception != null) { + throw this.exception; + } + switch (state) { - case START_STATE : + case START_STATE: // expecting "zip" as the first element if (namespaceURI.equals(ZIP_NAMESPACE) && localName.equals("archive")) { this.nsSupport.pushContext(); this.state = IN_ZIP_STATE; } else { - throw new SAXException( - "Expecting 'archive' root element (got '" + localName + "')"); + throw this.exception = + new SAXException("Expecting 'archive' root element (got '" + localName + "')"); } break; - case IN_ZIP_STATE : + case IN_ZIP_STATE: // expecting "entry" element if (namespaceURI.equals(ZIP_NAMESPACE) && localName.equals("entry")) { this.nsSupport.pushContext(); // Get the source addEntry(atts); } else { - throw new SAXException("Expecting 'entry' element (got '" + localName + "')"); + throw this.exception = + new SAXException("Expecting 'entry' element (got '" + localName + "')"); } break; - case IN_CONTENT_STATE : + case IN_CONTENT_STATE: this.contentDepth++; super.startElement(namespaceURI, localName, qName, atts); break; @@ -248,20 +261,21 @@ protected void addEntry(Attributes atts) throws SAXException { String name = atts.getValue("name"); if (name == null) { - throw new SAXException("No name given to the Zip entry"); + throw this.exception = + new SAXException("No name given to the Zip entry"); } String src = atts.getValue("src"); String serializerType = atts.getValue("serializer"); if (src == null && serializerType == null) { - throw new SAXException( - "No source nor serializer given for the Zip entry '" + name + "'"); + throw this.exception = + new SAXException("No source nor serializer given for the Zip entry '" + name + "'"); } if (src != null && serializerType != null) { - throw new SAXException( - "Cannot specify both 'src' and 'serializer' on a Zip entry '" + name + "'"); + throw this.exception = + new SAXException("Cannot specify both 'src' and 'serializer' on a Zip entry '" + name + "'"); } Source source = null; @@ -302,7 +316,7 @@ }); // Set it as the current XMLConsumer - this.setConsumer(serializer); + setConsumer(serializer); // start its document this.serializer.startDocument(); @@ -310,7 +324,6 @@ // and give it any namespaces already declared Enumeration prefixes = this.nsSupport.getPrefixes(); while (prefixes.hasMoreElements()) { - String prefix = (String) prefixes.nextElement(); super.startPrefixMapping(prefix, this.nsSupport.getURI(prefix)); } @@ -322,9 +335,9 @@ } catch (RuntimeException re) { throw re; } catch (SAXException se) { - throw se; + throw this.exception = se; } catch (Exception e) { - throw new SAXException(e); + throw this.exception = new SAXException(e); } finally { this.resolver.release( source ); } @@ -335,6 +348,12 @@ */ public void endElement(String namespaceURI, String localName, String qName) throws SAXException { + + // Damage control. Sometimes one exception is just not enough... + if (this.exception != null) { + throw this.exception; + } + if (state == IN_CONTENT_STATE) { super.endElement(namespaceURI, localName, qName); this.contentDepth--; @@ -354,7 +373,7 @@ try { this.zipOutput.closeEntry(); } catch (IOException ioe) { - throw new SAXException(ioe); + throw this.exception = new SAXException(ioe); } super.setConsumer(null); @@ -381,10 +400,12 @@ throw new SAXException(ioe); } } + /** * @see org.apache.avalon.excalibur.pool.Recyclable#recycle() */ public void recycle() { + this.exception = null; if (this.serializer != null) { this.selector.release(this.serializer); } 1.15 +5 -1 cocoon-2.1/src/webapp/sitemap.xmap Index: sitemap.xmap =================================================================== RCS file: /home/cvs/cocoon-2.1/src/webapp/sitemap.xmap,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- sitemap.xmap 8 May 2003 00:05:04 -0000 1.14 +++ sitemap.xmap 8 May 2003 05:05:22 -0000 1.15 @@ -127,6 +127,10 @@ + + + +