Calling a block of transformations

2005-08-25 Thread Stewart, Gary
Hi there,

Another newbie question I'm afraid. There are a set of transformers that I 
commonly call from a lot of pipelines and that I'd like to be able to possibly 
change at a later date. I was wondering if there is a way to call another 
pipeline inside a generate - serialize block so something like:

map:match pattern=edit-data
map:generate src=data-chunk.xml/
!--Do some specific transform--
  map:transform type=session/
!--Call another pipeline to do some more transformations--
??
map:serialize /
/map:match

map:pipeline internal-only=true
map:match pattern=xforms-convert
map:transform src=context://stylesheets/system.xsl /
map:transform src=context://stylesheets/base.xsl
map:transform src=context://stylesheets/client/xforms.xsl/
  /map:match
/map:pipeline

I don't think redirect is what I'm looking for but I don't think I want to use 
the aggregation (as there no generator) as seen in 
http://cocoon.apache.org/2.1/snippet/snippet-internal-pipeline.html.

Thanks,

Gary

**
The information contained in this message may be confidential or legally 
privileged and is intended for the addressee only, If you have received this 
message in error or there are any problems please notify the originator 
immediately. The unauthorised use, disclosure, copying or alteration of this 
message is strictly forbidden.
**

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Calling a block of transformations

2005-08-25 Thread Reinhard Poetz

Stewart, Gary wrote:

Hi there,

Another newbie question I'm afraid. There are a set of transformers that I commonly call from a lot of pipelines and that I'd like to be able to possibly change at a later date. 


You're looking for map:resource. See 
http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html#The+%3Cmap%3Aresources%3E 
 and the samples.


You can combine a group of sitemap components within a resource and call them 
from other pipelines by map:call resource=[name]/.
Please note that this will be deprecated in Cocoon 2.2 in favour of the concept 
of virtual sitemap components.


Also note that there is no inheritance of resources which means that they are 
only available within the sitemap where they are declared. This is one issue 
that virtual sitemap components will fix.



--
Reinhard Pötz   Independent Consultant, Trainer  (IT)-Coach 


{Software Engineering, Open Source, Web Applications, Apache Cocoon}

   web(log): http://www.poetz.cc


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Calling a block of transformations

2005-08-25 Thread Chris Marasti-Georg
Check into resources.  They are basically a group of tags that you can
call easily... I use one at the end of all my pipelines to strip
namespaces from the final xhtml and serialize...  It would look
somehting like this:

map:resources
map:resource name=xforms-convert
map:transform src=context://stylesheets/system.xsl /
map:transform src=context://stylesheets/base.xsl
map:transform
src=context://stylesheets/client/xforms.xsl/
/map:resource
/map:resources

And in your pipeline

map:match pattern=edit-data
map:generate src=data-chunk.xml/
!--Do some specific transform--
map:transform type=session/
map:call resource=xforms-convert/
map:serialize /
/map:match


Note that (unless I just missed it), you can't call a resource from a
different sitemap... So if you have a main sitemap with mounted sitemaps
that need to use the same resource, you have to copy it into each of
them.

HTH
Chris Marasti-Georg
 

 -Original Message-
 From: Stewart, Gary [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, August 25, 2005 11:01 AM
 To: users@cocoon.apache.org
 Subject: Calling a block of transformations
 
 Hi there,
 
 Another newbie question I'm afraid. There are a set of 
 transformers that I commonly call from a lot of pipelines and 
 that I'd like to be able to possibly change at a later date. 
 I was wondering if there is a way to call another pipeline 
 inside a generate - serialize block so something like:
 
 map:match pattern=edit-data
   map:generate src=data-chunk.xml/
   !--Do some specific transform--
   map:transform type=session/
   !--Call another pipeline to do some more transformations--
   ??
   map:serialize /
 /map:match
 
 map:pipeline internal-only=true
   map:match pattern=xforms-convert
   map:transform src=context://stylesheets/system.xsl /
   map:transform src=context://stylesheets/base.xsl
   map:transform 
 src=context://stylesheets/client/xforms.xsl/
   /map:match
 /map:pipeline
 
 I don't think redirect is what I'm looking for but I don't 
 think I want to use the aggregation (as there no generator) 
 as seen in 
 http://cocoon.apache.org/2.1/snippet/snippet-internal-pipeline.html.
 
 Thanks,
 
 Gary
 
 **
 The information contained in this message may be confidential 
 or legally privileged and is intended for the addressee only, 
 If you have received this message in error or there are any 
 problems please notify the originator immediately. The 
 unauthorised use, disclosure, copying or alteration of this 
 message is strictly forbidden.
 **
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Calling a block of transformations

2005-08-25 Thread Stewart, Gary


 -Original Message-
 From: Reinhard Poetz [mailto:[EMAIL PROTECTED]

 You can combine a group of sitemap components within a 
 resource and call them 
 from other pipelines by map:call resource=[name]/.
 Please note that this will be deprecated in Cocoon 2.2 in 
 favour of the concept 
 of virtual sitemap components.

Thank you kindly for yours and Chris Marasti-Gerorg's replies. I'll keep the 
virtual sitemap concept in mind for when 2.2 is released and I'm porting to it. 
I have seen resources previously used in this manor so why it didn't click I'm 
not sure. 

Thanks again,

Gary

**
The information contained in this message may be confidential or legally 
privileged and is intended for the addressee only, If you have received this 
message in error or there are any problems please notify the originator 
immediately. The unauthorised use, disclosure, copying or alteration of this 
message is strictly forbidden.
**

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Calling a block of transformations

2005-08-25 Thread JD Daniels
I depend heavily on resources... Is there any form of virtual sitemap 
components in the 2.1.x tree?


Reinhard Poetz wrote:

Stewart, Gary wrote:


Hi there,

Another newbie question I'm afraid. There are a set of transformers 
that I commonly call from a lot of pipelines and that I'd like to be 
able to possibly change at a later date. 



You're looking for map:resource. See 
http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html#The+%3Cmap%3Aresources%3E 
 and the samples.


You can combine a group of sitemap components within a resource and call 
them from other pipelines by map:call resource=[name]/.
Please note that this will be deprecated in Cocoon 2.2 in favour of the 
concept of virtual sitemap components.


Also note that there is no inheritance of resources which means that 
they are only available within the sitemap where they are declared. This 
is one issue that virtual sitemap components will fix.





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Calling a block of transformations

2005-08-25 Thread Stewart, Gary


 -Original Message-
 From: JD Daniels [mailto:[EMAIL PROTECTED]

 I depend heavily on resources... Is there any form of virtual sitemap 
 components in the 2.1.x tree?

Reinhard did say deprecated so I imagine you'll still be able to use resources 
for some versions to come.

Gary

**
The information contained in this message may be confidential or legally 
privileged and is intended for the addressee only, If you have received this 
message in error or there are any problems please notify the originator 
immediately. The unauthorised use, disclosure, copying or alteration of this 
message is strictly forbidden.
**

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Calling a block of transformations

2005-08-25 Thread Reinhard Poetz

JD Daniels wrote:
I depend heavily on resources... 


as most of us that want to avoid code duplication do ;-)
of course resources will go through an appropriate deprecation cycle

Is there any form of virtual sitemap 
components in the 2.1.x tree?


no, only in trunk (they should work there)

--
Reinhard Pötz   Independent Consultant, Trainer  (IT)-Coach 


{Software Engineering, Open Source, Web Applications, Apache Cocoon}

   web(log): http://www.poetz.cc


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]