|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.xml.AbstractXMLProducer | +--org.apache.cocoon.xml.AbstractXMLPipe | +--org.apache.cocoon.serialization.AbstractSerializer | +--org.apache.cocoon.serialization.ZipArchiveSerializer
A serializer that builds Zip archives 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.
Example :
<zip:archive xmlns:zip="http://apache.org/cocoon/zip-archive/1.0"> <zip:entry name="foo.html" src="cocoon://dynFoo.html"/> <zip:entry name="images/bar.jpeg" src="bar.jpeg"/> </zip:archive:zip>
Field Summary | |
protected byte[] |
buffer
Temporary byte buffer to read source data |
protected boolean |
inZip
Have we encountered the toplevel "zip" element ? |
protected SourceResolver |
resolver
The resolver to get sources |
static java.lang.String |
ZIP_NAMESPACE
The namespace for elements handled by this serializer, "http://apache.org/cocoon/zip-archive/1.0". |
protected java.util.zip.ZipOutputStream |
zipOutput
The Zip stream where entries will be written |
Fields inherited from class org.apache.cocoon.serialization.AbstractSerializer |
output |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
contentHandler, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.serialization.Serializer |
ROLE |
Constructor Summary | |
ZipArchiveSerializer()
|
Method Summary | |
protected void |
addEntry(org.xml.sax.Attributes atts)
Add an entry in the archive. |
void |
endDocument()
Receive notification of the end of a document. |
java.lang.String |
getMimeType()
Always return "application/x-zip" which is the default for Zip archives. |
void |
startDocument()
Receive notification of the beginning of a document. |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
Receive notification of the beginning of an element. |
Methods inherited from class org.apache.cocoon.serialization.AbstractSerializer |
recycle, setOutputStream, shouldSetContentLength |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
characters, comment, endCDATA, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
characters, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
setConsumer |
Field Detail |
public static final java.lang.String ZIP_NAMESPACE
protected java.util.zip.ZipOutputStream zipOutput
protected boolean inZip
protected SourceResolver resolver
protected byte[] buffer
Constructor Detail |
public ZipArchiveSerializer()
Method Detail |
public java.lang.String getMimeType()
getMimeType
in interface SitemapOutputComponent
getMimeType
in class AbstractSerializer
public void startDocument() throws org.xml.sax.SAXException
AbstractXMLPipe
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class AbstractXMLPipe
org.xml.sax.SAXException
ContentHandler.startDocument()
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
AbstractXMLPipe
startElement
in interface org.xml.sax.ContentHandler
startElement
in class AbstractXMLPipe
namespaceURI
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.localName
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.qName
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.atts
- The attributes attached to the element. If there are no
attributes, it shall be an empty Attributes object.
org.xml.sax.SAXException
ContentHandler.startElement(String, String, String, Attributes)
protected void addEntry(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes that describe the entry
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
AbstractXMLPipe
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class AbstractXMLPipe
org.xml.sax.SAXException
ContentHandler.endDocument()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |