cvs commit: xml-cocoon2/src/java/org/apache/cocoon/serialization ZipArchiveSerializer.java

2003-01-06 Thread sylvain
sylvain 2003/01/06 07:24:12

  Modified:.Tag: cocoon_2_0_3_branch changes.xml
   src/documentation/xdocs/userdocs/serializers Tag:
cocoon_2_0_3_branch serializers.xml
ziparchive-serializer.xml
   src/java/org/apache/cocoon/serialization Tag:
cocoon_2_0_3_branch ZipArchiveSerializer.java
  Log:
  ZipArchiveSerializer now accepts inline content for archive entries
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.138.2.82 +5 -1  xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.138.2.81
  retrieving revision 1.138.2.82
  diff -u -r1.138.2.81 -r1.138.2.82
  --- changes.xml   28 Dec 2002 07:06:51 -  1.138.2.81
  +++ changes.xml   6 Jan 2003 15:24:11 -   1.138.2.82
  @@ -40,6 +40,10 @@

   

  +  
  +ZipArchiveSerializer now accepts inline content for entries of the zip archive
  +and not only source URLs.
  +  
 
   Update XML Serializer, HTML Serializer , and Text Serializer documentation, 
   added XHTML Serializer documentation in the serializer user documentation 
section.
  
  
  
  No   revision
  
  
  No   revision
  
  
  1.1.2.3   +1 -0  
xml-cocoon2/src/documentation/xdocs/userdocs/serializers/serializers.xml
  
  Index: serializers.xml
  ===
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/serializers/serializers.xml,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- serializers.xml   28 Dec 2002 07:06:52 -  1.1.2.2
  +++ serializers.xml   6 Jan 2003 15:24:12 -   1.1.2.3
  @@ -57,6 +57,7 @@
   SVG/TIFF Serializer
   VRML Serializer
   Link Serializer
  +Zip archive 
Serializer
 
   
 
  
  
  
  1.1.2.2   +29 -15
xml-cocoon2/src/documentation/xdocs/userdocs/serializers/ziparchive-serializer.xml
  
  Index: ziparchive-serializer.xml
  ===
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/serializers/ziparchive-serializer.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ziparchive-serializer.xml 31 Oct 2002 16:22:49 -  1.1.2.1
  +++ ziparchive-serializer.xml 6 Jan 2003 15:24:12 -   1.1.2.2
  @@ -15,22 +15,36 @@

  The Zip archive serializer generates a zip archive by aggregating 
several sources.

  -   The input document should describe entries of the archive by 
means of
  -   their name (which can be a path) in the archive and the source of the 
entry
  -   contents. These are Cocoon sources, and as such can use any of the 
protocols
  -   handled by Cocoon, including "cocoon:" to include dynamically generated
  -   content in the archive.
  -
  + The input document should describe entries of the archive by means of
  + their name (which can be a path) and their content either as URLs or
  + inline data :
  + 
  +   URLs, given by the "src" attribute, are Cocoon sources and as such
  +   can use any of the protocols handled by Cocoon, including "cocoon:" to
  +   include dynamically generated content in the archive.
  +   inline data is represented by an XML document that is serialized to the
  +   zip entry using the serializer identified by the "serializer" attribute.
  +   
  + 
  +   Example :
  + 
  +
  +;
  +  
  +  
  +  
  +
  +  
  +Index page
  +  
  +  
  +Please go there
  +  
  +
  +  
  +
  +
   
  -
  -  Example :
  -
  -  
   
 Name: zip
 Class: 
org.apache.cocoon.serialization.ZipArchiveSerializer
  
  
  
  No   revision
  
  
  No   revision
  
  
  1.1.2.2   +248 -66   
xml-cocoon2/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java
  
  Index: ZipArchiveSerializer.java
  ===
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Zip

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/serialization ZipArchiveSerializer.java

2003-01-06 Thread sylvain
sylvain 2003/01/06 07:21:24

  Modified:.changes.xml
   src/documentation/xdocs/userdocs/serializers serializers.xml
ziparchive-serializer.xml
   src/java/org/apache/cocoon/serialization
ZipArchiveSerializer.java
  Log:
  ZipArchiveSerializer now accepts inline content for archive entries
  
  Revision  ChangesPath
  1.329 +5 -1  xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.328
  retrieving revision 1.329
  diff -u -r1.328 -r1.329
  --- changes.xml   6 Jan 2003 06:10:24 -   1.328
  +++ changes.xml   6 Jan 2003 15:21:24 -   1.329
  @@ -40,6 +40,10 @@

   

  +  
  +ZipArchiveSerializer now accepts inline content for entries of the zip archive
  +and not only source URLs.
  +  
 
   ImageReader extends now ResourceReader and therefor the
   "expire-time" parameter is now "expires". Also removed the
  
  
  
  1.6   +1 -0  
xml-cocoon2/src/documentation/xdocs/userdocs/serializers/serializers.xml
  
  Index: serializers.xml
  ===
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/serializers/serializers.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- serializers.xml   25 Dec 2002 07:05:55 -  1.5
  +++ serializers.xml   6 Jan 2003 15:21:24 -   1.6
  @@ -57,6 +57,7 @@
   SVG/TIFF Serializer
   VRML Serializer
   Link Serializer
  +Zip archive 
Serializer
 
   
 
  
  
  
  1.3   +29 -15
xml-cocoon2/src/documentation/xdocs/userdocs/serializers/ziparchive-serializer.xml
  
  Index: ziparchive-serializer.xml
  ===
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/serializers/ziparchive-serializer.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ziparchive-serializer.xml 31 Oct 2002 16:48:55 -  1.2
  +++ ziparchive-serializer.xml 6 Jan 2003 15:21:24 -   1.3
  @@ -15,22 +15,36 @@

  The Zip archive serializer generates a zip archive by aggregating 
several sources.

  -   The input document should describe entries of the archive by 
means of
  -   their name (which can be a path) in the archive and the source of the 
entry
  -   contents. These are Cocoon sources, and as such can use any of the 
protocols
  -   handled by Cocoon, including "cocoon:" to include dynamically generated
  -   content in the archive.
  -
  + The input document should describe entries of the archive by means of
  + their name (which can be a path) and their content either as URLs or
  + inline data :
  + 
  +   URLs, given by the "src" attribute, are Cocoon sources and as such
  +   can use any of the protocols handled by Cocoon, including "cocoon:" to
  +   include dynamically generated content in the archive.
  +   inline data is represented by an XML document that is serialized to the
  +   zip entry using the serializer identified by the "serializer" attribute.
  +   
  + 
  +   Example :
  + 
  +
  +;
  +  
  +  
  +  
  +
  +  
  +Index page
  +  
  +  
  +Please go there
  +  
  +
  +  
  +
  +
   
  -
  -  Example :
  -
  -  
   
 Name: zip
 Class: 
org.apache.cocoon.serialization.ZipArchiveSerializer
  
  
  
  1.4   +235 -73   
xml-cocoon2/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java
  
  Index: ZipArchiveSerializer.java
  ===
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ZipArchiveSerializer.java 3 Dec 2002 10:20:01 -   1.3
  +++ ZipArchiveSerializer.java 6 Jan 2003 15:21:24 -   1.4
  @@ -51,16 +51,26 @@
   
   package org.apache.cocoon.serialization;
   
  +import org.apache.avalon.excalibur.pool.Recyclable;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.component.ComponentSelector;
   impo

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/serialization ZipArchiveSerializer.java

2002-12-03 Thread cziegeler
cziegeler2002/12/03 02:20:02

  Modified:src/java/org/apache/cocoon/serialization
ZipArchiveSerializer.java
  Log:
  Avoid private internal calls and use the allowed api instead
  
  Revision  ChangesPath
  1.3   +64 -44
xml-cocoon2/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java
  
  Index: ZipArchiveSerializer.java
  ===
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ZipArchiveSerializer.java 31 Oct 2002 16:48:55 -  1.2
  +++ ZipArchiveSerializer.java 3 Dec 2002 10:20:01 -   1.3
  @@ -51,12 +51,11 @@
   
   package org.apache.cocoon.serialization;
   
  -import org.apache.cocoon.caching.CacheValidity;
  -import org.apache.cocoon.caching.Cacheable;
  -import org.apache.cocoon.components.CocoonComponentManager;
  -import org.apache.cocoon.environment.Source;
  -import org.apache.cocoon.environment.SourceResolver;
  -
  +import org.apache.avalon.framework.component.ComponentException;
  +import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.component.Composable;
  +import org.apache.excalibur.source.Source;
  +import org.apache.excalibur.source.SourceResolver;
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;
   
  @@ -96,63 +95,70 @@
   //  ...
   //
   
  -public class ZipArchiveSerializer extends AbstractSerializer
  -{
  +public class ZipArchiveSerializer
  +extends AbstractSerializer
  +implements Composable {
   /**
* The namespace for elements handled by this serializer, 
* "http://apache.org/cocoon/zip-archive/1.0";.
*/
  -public static final String ZIP_NAMESPACE = 
"http://apache.org/cocoon/zip-archive/1.0";;
  -
  +public static final String ZIP_NAMESPACE =
  +"http://apache.org/cocoon/zip-archive/1.0";;
  +
   /** The Zip stream where entries will be written */
   protected ZipOutputStream zipOutput;
  -
  +
   /** Have we encountered the toplevel "zip" element ? */
   protected boolean inZip = false;
  -
  -/** The resolver to get sources */
  -protected SourceResolver resolver;
  -
  +
   /** Temporary byte buffer to read source data */
   protected byte[] buffer = new byte[1024];
  -
  +
  +protected ComponentManager manager;
  +
   /**
* Always return "application/x-zip" which is the default for Zip archives.
*/
  -public String getMimeType()
  -{
  +public String getMimeType() {
   return "application/x-zip";
   }
   
   /**
* @see org.xml.sax.ContentHandler#startDocument()
*/
  -public void startDocument() throws SAXException
  -{
  +public void startDocument() throws SAXException {
   this.zipOutput = new ZipOutputStream(this.output);
   this.inZip = false;
  -this.resolver = CocoonComponentManager.getCurrentEnvironment();
   }
   
   /**
* @see org.xml.sax.ContentHandler#startElement(String, String, String, 
Attributes)
*/
  -public void startElement(String namespaceURI, String localName, String qName, 
Attributes atts) throws SAXException
  -{
  +public void startElement(String namespaceURI,
  +String localName,
  +String qName,
  +Attributes atts)
  +throws SAXException {
   if (!inZip) {
   // expecting "zip" as the first element
  -if (namespaceURI.equals(ZIP_NAMESPACE) && localName.equals("archive")) {
  +if (namespaceURI.equals(ZIP_NAMESPACE)
  +&& localName.equals("archive")) {
   this.inZip = true;
   } else {
  -throw new SAXException("Expecting 'archive' root element (got '" + 
localName + "')");
  +throw new SAXException(
  +"Expecting 'archive' root element (got '"
  ++ localName
  ++ "')");
   }
   } else {
   // expecting "entry" element
  -if (namespaceURI.equals(ZIP_NAMESPACE) && localName.equals("entry")) {
  +if (namespaceURI.equals(ZIP_NAMESPACE)
  +&& localName.equals("entry")) {
   // Get the source
   addEntry(atts);
   } else {
  -throw new SAXException("Expecting 'entry' element (got '" + 
localName + "')");
  +throw new SAXException(
  +"Expecting 'entry' element (got '" + localName + "')");
   }
   }
   }
  @@ -161,56 +167,70 @@
* Add an entry in the archive.
* @param atts the attribut

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/serialization ZipArchiveSerializer.java

2002-10-31 Thread sylvain
sylvain 2002/10/31 08:48:55

  Modified:.changes.xml
   src/documentation/xdocs/userdocs/serializers book.xml
  Added:   src/documentation/xdocs/userdocs/serializers
ziparchive-serializer.xml
   src/java/org/apache/cocoon/serialization
ZipArchiveSerializer.java
  Log:
  New ZipArchiveSerializer
  
  Revision  ChangesPath
  1.277 +6 -1  xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.276
  retrieving revision 1.277
  diff -u -r1.276 -r1.277
  --- changes.xml   31 Oct 2002 03:23:15 -  1.276
  +++ changes.xml   31 Oct 2002 16:48:55 -  1.277
  @@ -40,6 +40,11 @@

   

  +  
  +New ZipArchiveSerializer to build zip files aggregating various sources
  +as archive entries. Can be used to generate zip files, sxw files (OpenOffice),
  +jar files, etc.
  +  
 
   TraxTransformer does not have use-deli parameter anymore. If deli is
   configured in the cocoon.xconf, it always will be used.
  
  
  
  1.3   +1 -0  
xml-cocoon2/src/documentation/xdocs/userdocs/serializers/book.xml
  
  Index: book.xml
  ===
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/serializers/book.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- book.xml  18 Apr 2002 16:21:10 -  1.2
  +++ book.xml  31 Oct 2002 16:48:55 -  1.3
  @@ -26,6 +26,7 @@
   
   
   
  +
 
 
   
  
  
  
  1.2   +41 -0 
xml-cocoon2/src/documentation/xdocs/userdocs/serializers/ziparchive-serializer.xml
  
  
  
  
  1.2   +216 -0
xml-cocoon2/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java
  
  
  
  

--
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail:  [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




cvs commit: xml-cocoon2/src/java/org/apache/cocoon/serialization ZipArchiveSerializer.java

2002-10-31 Thread sylvain
sylvain 2002/10/31 08:22:49

  Modified:.Tag: cocoon_2_0_3_branch changes.xml
   src/documentation/xdocs/userdocs/serializers Tag:
cocoon_2_0_3_branch book.xml
  Added:   src/documentation/xdocs/userdocs/serializers Tag:
cocoon_2_0_3_branch ziparchive-serializer.xml
   src/java/org/apache/cocoon/serialization Tag:
cocoon_2_0_3_branch ZipArchiveSerializer.java
  Log:
  New ZipArchiveSerializer
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.138.2.66 +6 -1  xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.138.2.65
  retrieving revision 1.138.2.66
  diff -u -r1.138.2.65 -r1.138.2.66
  --- changes.xml   31 Oct 2002 03:23:15 -  1.138.2.65
  +++ changes.xml   31 Oct 2002 16:22:49 -  1.138.2.66
  @@ -39,6 +39,11 @@

   

  +  
  +New ZipArchiveSerializer to build zip files aggregating various sources
  +as archive entries. Can be used to generate zip files, sxw files (OpenOffice),
  +jar files, etc.
  +  
 
   TraxTransformer does not have use-deli parameter anymore. If deli is
   configured in the cocoon.xconf, it always will be used.
  
  
  
  No   revision
  
  
  No   revision
  
  
  1.1.2.2   +1 -0  
xml-cocoon2/src/documentation/xdocs/userdocs/serializers/book.xml
  
  Index: book.xml
  ===
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/serializers/book.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- book.xml  7 Jun 2002 19:58:28 -   1.1.2.1
  +++ book.xml  31 Oct 2002 16:22:49 -  1.1.2.2
  @@ -26,6 +26,7 @@
   
   
   
  +
 
 
   
  
  
  
  No   revision
  
  
  No   revision
  
  
  1.1.2.1   +41 -0 
xml-cocoon2/src/documentation/xdocs/userdocs/serializers/Attic/ziparchive-serializer.xml
  
  
  
  
  No   revision
  
  
  No   revision
  
  
  1.1.2.1   +216 -0
xml-cocoon2/src/java/org/apache/cocoon/serialization/Attic/ZipArchiveSerializer.java
  
  
  
  

--
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail:  [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]