cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: [RT] Views for readers
Date Thu, 14 Aug 2003 16:45:23 GMT
Vadim Gritsenko wrote:

> 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. 


Picky sidenote : this is configurable using the <content-view-query> 
config of the <lucene-xml-indexer> component ;-)

>> 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> 


I'm afraid this won't work :

- a generator specific to a given content-type is very unlikely to 
produce the document type expected by the view. We will most often need 
an additional transformation (e.g. the "xword2xdoc.xsl" that was in my 
example)

- views, through their associated labels, can be plugged at any point of 
the pipelines. Defining pair generators restricts views to be only 
from-label="start".

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


Doesn't seem so awful to me, since the reader should be executed 
"unless" certain conditions are met, which are that the specified 
label(s) correspond to the one at which the requested view should start.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Mime
View raw message