cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] WritingReaders sandbox Tue May 11 10:00:02 2004
Date Tue, 11 May 2004 08:00:02 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=WritingReaders , version: 1 on Mon May 11 07:30:23
2004 by ChristianHaul

New page created:
+ A reader is sort of a generator and a serializer in one package. Therefore, it is not possible
to modify or transform the data lateron on the way to the browser. Consequently,
+ a reader does not deal with SAX but reads or creates an arbitrary format and returns a stream
of binary data.
+ 
+ The output stream is set through the SitemapOutputComponent interface's method setOutputStream().
The generate() method triggers the actual reading.
+ 
+ Other than that, a reader is a regular SitemapModelComponent and gets its parameters
+ passed through the setup() method. Like any other SitemapModelComponent, it may but does

+ not need to implement CacheableProcessingComponent to enable caching.
+ 
+ To write your own reader, you should inherit from one of the existing readers like the ServiceableReader
or the RessourceReader or even the AbstractReader.
+ 
+ All that needs to be done to write a custom reader based on the AbstractReader class, is
to override the generate() method and dump whatever data this reader deals with to 
+ the OutputStream this.out.
+ 
+ Of cause, to write a good reader, the implementation should handle exceptions gracefully,
like unexpected closing of the output stream when the user instructs the browser to stop loading
for example and should try to work with the caching subsystem in order to provide good performance.
+ 


Page: http://wiki.cocoondev.org/Wiki.jsp?page=sandbox , version: 13 on Mon May 11 07:09:38
2004 by AntonioGallardo

- [网站建设 |http://www.99986.com/ ]
- [网页设计 |http://www.99986.com/ ]
- [网页制作 |http://www.99986.com/ ]
- [网站推广 |http://www.99986.com/ ]
+ 



Mime
View raw message