Sylvain Wallez wrote:

Vadim Gritsenko wrote:

Sylvain Wallez wrote:


<snip/>


Any other proposal or opinion on this subject before we start a vote ?



Can't you just enable generators in map:view in case when view starts with reader?



No, since views "capture" the (XML) output at certain points of the pipeline to provide a different formatting.


In case of the reader, there is no (XML) output in the pipeline. It's special case, unless you want to introduce binary pipelines (and I hope you don't want to), so it would require special handling.


E.g. the processing for the "indexable-content" view


Sidenote: It's called "content" -- the view which you use to build a site search index.


is the same for all URIs, be them XML pipelines or a single reader.

So there's no way other than having a generator _before_ jumping to the view, feeding that view with the kind of XML content it expects.


Here is another wild (or not?) thought.

All this discussion comes down to the requirement of generating some XML out of the content usually served by the reader, if that's possible (and it is possible for some of the types of the content), in order to feed this XMLized content into the view. This generated XML is somewhat "equivalent" to the binary represenation for the purpose of view building. So, I'm going to the conclusion that some types of readers can be paired with the generator producing "equivalent", but XMLized, content. The best place to indicate such pairing is the time when you declare a reader:

<map:readers default="resource">
<map:reader name="resource" src="org.apache.cocoon.reading.ResourceReader"/>
<map:reader name="html" src="org.apache.cocoon.reading.ResourceReader">
<generator-paired-to-this-reader>html</generator-paired-to-this-reader>
</map:reader>
<map:reader name="msexcel" src="org.apache.cocoon.reading.ResourceReader">
<generator-paired-to-this-reader>poi-excel-generator</generator-paired-to-this-reader>
</map:reader>
<map:reader name="pdf" src="org.apache.cocoon.reading.ResourceReader">
<generator-paired-to-this-reader>pdf-text-extractor-generator</generator-paired-to-this-reader>
</map:reader>
</map:readers>



PS: Modifying sitemap syntax to allow reader/generator pairs with some "unless" attrbiutes looks awful to me.


Vadim


Reply via email to