You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Daniel Glöckner <xm...@gloeckner.biz> on 2004/09/06 17:11:08 UTC

lookup the components of a pipeline

Hi, 

at the moment I've run out of ideas, concerning possible methods to access the 
components of a cocoon pipeline. What I need is a way to get the class (or 
the whole object) of the previous and the following component of the current 
component. I dug into the ComponentManager but couldn't find a way to solve 
this problem.

Thank you.

Regards
  Daniel

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


Re: lookup the components of a pipeline

Posted by Jorg Heymans <jh...@domek.be>.
<snip/>

> 
>  Perhaps I should have said that I have to implement an autarkic component, 
> the transformer, which cannot depend on a generated sitemap. It needs to 
> inspect its context at runtime. 
> 
> Any help is appreciated.

How about every of your components appends it's name to a special 
request attribute? At least then you know the preceding pipeline layout 
up to the currently executing component.

And what if your validating transformer inserts the error into the SAX 
stream (eg in a <stacktrace> or <exception> element), a following 
component detects this and executes your error logic.

This is IMO the only way it can work, you build up an xml 
control/logging structure in the SAX stream as you go along in the 
pipeline, then the serializer (or the last transformer) looks at this 
control structure and reacts.


Why is it important to know the next pipeline component as well? If a 
validating error has occured, then this is caused by components 
preceding your validator... but i guess there must be another valid reason.

Hope this makes sense,
Jorg



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


Re: lookup the components of a pipeline

Posted by Daniel Glöckner <da...@gloeckner.biz>.
Hi Jorg, 

thank you for helping me solving this design problem.

On Tuesday 07 September 2004 12:12, Jorg Heymans wrote:
> <snip/>
>
> > The usecase is quite simple. A custom transformer needs to know its
> > predecessor and its successor. The Transformer is a schema validating
> > Transformer used for validating SOAP messages. It needs to know its
> > position in the pipeline to generate specific SOAP errors in case of a
> > validation error.
>
> clear. I had a similar usecase a while ago and ended up having an
> abstract baseclass and different implementations depending on how it was
> positioned/used in the pipelined, nothing dynamic - all through sitemap
> configuration.
 Perhaps I should have said that I have to implement an autarkic component, 
the transformer, which cannot depend on a generated sitemap. It needs to 
inspect its context at runtime. 

Any help is appreciated.

Best regards,
  Daniel

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


Re: lookup the components of a pipeline

Posted by Jorg Heymans <jh...@domek.be>.
<snip/>

> 
> The usecase is quite simple. A custom transformer needs to know its 
> predecessor and its successor. The Transformer is a schema validating 
> Transformer used for validating SOAP messages. It needs to know its position 
> in the pipeline to generate specific SOAP errors in case of a validation 
> error.

clear. I had a similar usecase a while ago and ended up having an 
abstract baseclass and different implementations depending on how it was 
positioned/used in the pipelined, nothing dynamic - all through sitemap 
configuration.

> 
>>How about just passing the previous and next component as a parameter?
>>Sure it's hardcoded then, but this could be autogenerated.
> 
> This would be the fallback, just in case that there is no way to inspect the 
> components of a pipeline dynamically. I'd have to hardcode it in the 
> (sub-)sitemap then. But how could it be autogenerated?

The cocoon build uses a tool called XConfToolTask in tools/src/anttasks. 
This could be used to autogenerate your pipeline or modify an existing 
pipeline with an ant-script and some properties, nothing fancy really.

HTH
Jorg


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


Re: lookup the components of a pipeline

Posted by Daniel Glöckner <da...@gloeckner.biz>.
On Monday 06 September 2004 17:15, Jorg Heymans wrote:
> Daniel Glöckner wrote:
> > Hi,
> >
> > at the moment I've run out of ideas, concerning possible methods to
> > access the components of a cocoon pipeline. What I need is a way to get
> > the class (or the whole object) of the previous and the following
> > component of the current component. I dug into the ComponentManager but
> > couldn't find a way to solve this problem.
>
> Maybe you could describe your usecase to us, there might be an
> alternative way to solve your problem.
The usecase is quite simple. A custom transformer needs to know its 
predecessor and its successor. The Transformer is a schema validating 
Transformer used for validating SOAP messages. It needs to know its position 
in the pipeline to generate specific SOAP errors in case of a validation 
error.
>
> How about just passing the previous and next component as a parameter?
> Sure it's hardcoded then, but this could be autogenerated.
This would be the fallback, just in case that there is no way to inspect the 
components of a pipeline dynamically. I'd have to hardcode it in the 
(sub-)sitemap then. But how could it be autogenerated?

Best regards,
  Daniel

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


Re: lookup the components of a pipeline

Posted by Jorg Heymans <jh...@domek.be>.

Daniel Glöckner wrote:

> Hi, 
> 
> at the moment I've run out of ideas, concerning possible methods to access the 
> components of a cocoon pipeline. What I need is a way to get the class (or 
> the whole object) of the previous and the following component of the current 
> component. I dug into the ComponentManager but couldn't find a way to solve 
> this problem.

Maybe you could describe your usecase to us, there might be an 
alternative way to solve your problem.

How about just passing the previous and next component as a parameter? 
Sure it's hardcoded then, but this could be autogenerated.

HTH
Jorg


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