You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jonathan Linczak <li...@hiram.edu> on 2004/10/04 17:51:54 UTC

Help with selector - very basic

Hi all,

First time using a selector (don't laugh!) and I wrote a simple  
pipeline that changes based on the parameter matched:

     <map:pipeline>
       <map:match pattern="**/*/*/teamstats.html">
         <map:select type="parameter">
           <map:parameter name="parameter-selector-test" value="{2}"/>
           <map:when test="menssports">
             <map:read mime-type="text/html"  
src="content/authoring/stats/m-{3}/teamstats.htm"/>
           </map:when>
           <map:when test="womenssports">
             <map:read mime-type="text/html"  
src="content/authoring/stats/w-{3}/teamstats.htm"/>
           </map:when>
         </map:select>
       </map:match>
     </map:pipeline>

When I go to the page:  
http://www.someplace.com:8080/lenya/athletics/authoring/menssports/ 
football/teamstats.html

I get the following error:

org.apache.cocoon.ProcessingException: Failed to execute pipeline.:  
org.apache.cocoon.ProcessingException: Streaming of an internal  
pipeline is not possible with a reader.

I have my files in the right place, and I followed the examples in the  
documentation online and in the Cocoon book.  Any thoughts about what I  
need to check to get this to work?

Jon


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Help with selector - very basic

Posted by Joerg Heinicke <jo...@gmx.de>.
On 04.10.2004 17:51, Jonathan Linczak wrote:

> First time using a selector (don't laugh!) and I wrote a simple  
> pipeline that changes based on the parameter matched:
> 
>     <map:pipeline>
>       <map:match pattern="**/*/*/teamstats.html">
>         <map:select type="parameter">
>           <map:parameter name="parameter-selector-test" value="{2}"/>
>           <map:when test="menssports">
>             <map:read mime-type="text/html"  
> src="content/authoring/stats/m-{3}/teamstats.htm"/>
>           </map:when>
>           <map:when test="womenssports">
>             <map:read mime-type="text/html"  
> src="content/authoring/stats/w-{3}/teamstats.htm"/>
>           </map:when>
>         </map:select>
>       </map:match>
>     </map:pipeline>
> 
> When I go to the page:  
> http://www.someplace.com:8080/lenya/athletics/authoring/menssports/ 
> football/teamstats.html
> 
> I get the following error:
> 
> org.apache.cocoon.ProcessingException: Failed to execute pipeline.:  
> org.apache.cocoon.ProcessingException: Streaming of an internal  
> pipeline is not possible with a reader.

There is no error in using the selector, but it seems that the above 
pipeline is included into another one (that's why the error message 
talks about internal pipeline). It's difficult to say without seeing the 
rest of the sitemap. But replacing the reader with a generator and a 
serializer as suggested by Mark should work in every case. If the file 
is HTML and not XML, you need the HTMLGenerator and the HTMLSerializer.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Help with selector - very basic

Posted by Jonathan Linczak <li...@hiram.edu>.
> On Oct 4, 2004, at 8:51 AM, Jonathan Linczak wrote:
>
>> Hi all,
>>
>> First time using a selector (don't laugh!) and I wrote a simple  
>> pipeline that changes based on the parameter matched:
>>
>>     <map:pipeline>
>>       <map:match pattern="**/*/*/teamstats.html">
>>         <map:select type="parameter">
>>           <map:parameter name="parameter-selector-test" value="{2}"/>
>>           <map:when test="menssports">
>>             <map:read mime-type="text/html"  
>> src="content/authoring/stats/m-{3}/teamstats.htm"/>
>>           </map:when>
>>           <map:when test="womenssports">
>>             <map:read mime-type="text/html"  
>> src="content/authoring/stats/w-{3}/teamstats.htm"/>
>>           </map:when>
>>         </map:select>
>>       </map:match>
>>     </map:pipeline>
>>
>> When I go to the page:  
>> http://www.someplace.com:8080/lenya/athletics/authoring/menssports/ 
>> football/teamstats.html
>>
>> I get the following error:
>>
>> org.apache.cocoon.ProcessingException: Failed to execute pipeline.:  
>> org.apache.cocoon.ProcessingException: Streaming of an internal  
>> pipeline is not possible with a reader.
>
> You might try using a generator+serializer instead of a reader.   
> Replace the reader with a generator, and put the serializer right  
> after the selector.

Mark, I'm a bit confused in that I don't really need to generate or  
serialize since I just want to read in the file that was pre-generated  
by another application.  I thought it would make my life easier if I  
threw the documents into Apache's document root instead, and then  
replaced the <map:read> tags with <map:redirect-to> tags, but not I get  
the following error:

org.apache.cocoon.ProcessingException: Failed to execute pipeline.:  
java.io.IOException

Very strange...  should I not even be doing this?

Jon


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Help with selector - very basic

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Oct 4, 2004, at 8:51 AM, Jonathan Linczak wrote:

> Hi all,
>
> First time using a selector (don't laugh!) and I wrote a simple  
> pipeline that changes based on the parameter matched:
>
>     <map:pipeline>
>       <map:match pattern="**/*/*/teamstats.html">
>         <map:select type="parameter">
>           <map:parameter name="parameter-selector-test" value="{2}"/>
>           <map:when test="menssports">
>             <map:read mime-type="text/html"  
> src="content/authoring/stats/m-{3}/teamstats.htm"/>
>           </map:when>
>           <map:when test="womenssports">
>             <map:read mime-type="text/html"  
> src="content/authoring/stats/w-{3}/teamstats.htm"/>
>           </map:when>
>         </map:select>
>       </map:match>
>     </map:pipeline>
>
> When I go to the page:  
> http://www.someplace.com:8080/lenya/athletics/authoring/menssports/ 
> football/teamstats.html
>
> I get the following error:
>
> org.apache.cocoon.ProcessingException: Failed to execute pipeline.:  
> org.apache.cocoon.ProcessingException: Streaming of an internal  
> pipeline is not possible with a reader.

You might try using a generator+serializer instead of a reader.   
Replace the reader with a generator, and put the serializer right after  
the selector.

HTH,
mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org