You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by rachid harradi <ra...@gmx.net> on 2007/01/05 13:15:50 UTC

passing Value from Pipline to another Pipline

Hello together

i have Sitemape like :
<map:pipelines>
   <map:pipeline>
   
      <map:match pattern="Mail_InfoAppealAcceptedHTML">
         <map:generate type="Mail_InfoAppealAcceptedGenerator" src=""/>
         <map:transform type="mailme" src="mailinfo.xslt">
         <!-- map:parameter name="contextPath" value="{request:contextPath}"/-->
         </map:transform>
         <map:serialize type="html"/>
      </map:match>
      </map:pipeline> 
    
    <map:pipeline> 
        <map:match pattern="dart">
        	<map:read src="dart.GIF" mime-type="image/gif" />
      	</map:match>
    </map:pipeline> 
    
    <map:pipeline> 
      	 <map:match pattern="dartlinks">
        	<map:read src="dartlinks.GIF" mime-type="image/gif"/>
      	  </map:match>
    </map:pipeline> 
    
    <map:pipeline> 
    <map:match pattern="Mail_InfoAppealAccepted.html">
   	 <map:generate type="file" src="cocoon:/Mail_InfoAppealAcceptedHTML"/>
   	 <map:transform src="saveFile.xsl">
         <map:parameter name="serializer" value="html" />
         <map:parameter name="filepath" value="E:/temp/Mail_InfoAppealAccepted.html" />
     </map:transform>
      <map:transform type ="savefiles"/>
  	<map:serialize type="html"/>
	</map:match>
   </map:pipeline>
   
</map:pipelines

i will filepath dynamic set. however i get values from first pipline "Mail_InforAppealAcceptedHTML" so from Mail_InfoAppealAcceptedGenerator.java.

i dont know how can i pass the value from first Pipline on the second Pipline "SaveFilesTransformer". have you any Idea?


Rachid Harradi


-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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


Set request attribute from sitemap (was Re: passing Value from Pipline to another Pipline)

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jan 5, 2007, at 7:45 AM, Toby wrote:

> Thinking about it, I'm not sure if you can *set* a request attribute
> from the sitemap.

You can.

There are 2 ways:

1) Use a PropagatorAction configured with the 
RequestAttributeOutputModule

2) Use the SetterAction configured in "request-attrubute" mode.

They both do the same thing.  (1) is better IMHO, hopefully (2) will be 
deprecated someday.

cheers,
—ml—


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


Re: passing Value from Pipline to another Pipline

Posted by Toby <to...@linux.it>.
rachid harradi wrote:
> hello Tobia,
> many thanks for your answer. 
> I would have gladly an example of it

Sure.


Flowscript:

  cocoon.request.getAttribute('foo')

  cocoon.request.setAttribute('foo', bar)

JX:

  ${request.getAttribute('foo')}

  ${request.setAttribute('foo', bar)}

XSP or XSP-action:

  <request:get-attribute name="foo"/>

  <request:set-attribute name="foo">
    <xsp:expr>
      bar
    </xsp:expr>
  </request:set-attribute>

Sitemap:

  <components>
    <selectors>
      <selector name="request-attribute"
                src="org.apache.cocoon.selection.RequestAttributeSelector"/>
    </selectors>
  </components>

  ...

  <select type="request-attribute">
    <parameter name="attribute-name" value="foo"/>

    <when test="bar">
      ...
    </when>
    <otherwise>
      ...
    </otherwise>
  </select>
  

You can use the following matchers and selectors in the sitemap:

  RequestAttributeMatcher
  WildcardRequestAttributeMatcher
  RegexpRequestAttributeMatcher
  RequestAttributeSelector


Thinking about it, I'm not sure if you can *set* a request attribute
from the sitemap.


Toby

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


Re: passing Value from Pipline to another Pipline

Posted by rachid harradi <ra...@gmx.net>.
hello Tobia,

many thanks for your answer. 

I would have gladly an example of it(sitemap)



Rachid harradi

-------- Original-Nachricht --------
Datum: Fri, 5 Jan 2007 15:12:03 +0100
Von: Toby <to...@linux.it>
An: users@cocoon.apache.org
Betreff: Re: passing Value from Pipline to another Pipline

> rachid harradi wrote:
> > i dont know how can i pass the value from first Pipline on the second
> > Pipline "SaveFilesTransformer". have you any idea?
> 
> I would use request attributes.  You can set them from actions, from jx
> transformers, from flowscript and from a lot of other places and you can
> query them from the sitemap with matchers and selectors.
> 
> 
> HTH,
> Toby
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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


Re: passing Value from Pipline to another Pipline

Posted by Toby <to...@linux.it>.
rachid harradi wrote:
> i dont know how can i pass the value from first Pipline on the second
> Pipline "SaveFilesTransformer". have you any idea?

I would use request attributes.  You can set them from actions, from jx
transformers, from flowscript and from a lot of other places and you can
query them from the sitemap with matchers and selectors.


HTH,
Toby

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