|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cocoon.util.AbstractLogEnabled
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) and their content either as URLs or inline data :
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:entry name="index.html" serializer="html"> <html> <head> <title>Index page</title> </head> <body> Please go <a href="foo.html">there</a> </body< </html> </zip:entry> </zip:archive:zip>
Field Summary | |
protected byte[] |
buffer
Temporary byte buffer to read source data |
protected int |
contentDepth
Current depth of the serialized content |
protected ServiceManager |
manager
The component manager |
protected SourceResolver |
resolver
The resolver to get sources |
protected ServiceSelector |
selector
The serializer component selector |
protected org.apache.cocoon.serialization.Serializer |
serializer
Serializer used when in IN_CONTENT state |
protected int |
state
The current state |
static String |
ZIP_NAMESPACE
The namespace for elements handled by this serializer, "http://apache.org/cocoon/zip-archive/1.0". |
protected 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, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.serialization.Serializer |
ROLE |
Constructor Summary | |
ZipArchiveSerializer()
|
Method Summary | |
protected void |
addEntry(Attributes atts)
Add an entry in the archive. |
void |
characters(char[] buffer,
int offset,
int length)
|
void |
dispose()
|
void |
endDocument()
|
void |
endElement(String namespaceURI,
String localName,
String qName)
|
void |
endPrefixMapping(String prefix)
|
String |
getMimeType()
Returns default mime type for zip archives, application/zip . |
void |
recycle()
|
void |
service(ServiceManager manager)
|
void |
startDocument()
|
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
|
void |
startPrefixMapping(String prefix,
String uri)
Begin the scope of a prefix-URI Namespace mapping. |
Methods inherited from class org.apache.cocoon.serialization.AbstractSerializer |
setOutputStream, shouldSetContentLength |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
comment, endCDATA, endDTD, endEntity, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startEntity |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
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 |
ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity |
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 String ZIP_NAMESPACE
protected ServiceManager manager
protected ServiceSelector selector
protected ZipOutputStream zipOutput
protected int state
protected SourceResolver resolver
protected byte[] buffer
protected org.apache.cocoon.serialization.Serializer serializer
protected int contentDepth
Constructor Detail |
public ZipArchiveSerializer()
Method Detail |
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
Serviceable.service(ServiceManager)
public String getMimeType()
application/zip
.
Can be overridden in the sitemap.
getMimeType
in interface org.apache.cocoon.sitemap.SitemapOutputComponent
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
ContentHandler.startDocument()
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
prefix
- The Namespace prefix being declared.uri
- The Namespace URI the prefix is mapped to.
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
SAXException
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
SAXException
ContentHandler.startElement(String, String, String, Attributes)
public void characters(char[] buffer, int offset, int length) throws SAXException
characters
in interface ContentHandler
SAXException
ContentHandler.characters(char[], int, int)
protected void addEntry(Attributes atts) throws SAXException
atts
- the attributes that describe the entry
SAXException
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
SAXException
ContentHandler.endElement(String, String, String)
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
ContentHandler.endDocument()
public void recycle()
recycle
in interface Recyclable
Recyclable.recycle()
public void dispose()
dispose
in interface Disposable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |