AW: Core Documentation

2005-11-21 Thread Stefan Pietschmann
No actually you got it right, but the point is that every element can have
that attribute, so I'd have to write such an action around every element in
the pipeline. We have quite a long pipeline, so this seems a bit bulky to me
and I'd want a more elegant solution.

Stefan
 
| -Ursprüngliche Nachricht-
| Von: Christoph Hermann [mailto:[EMAIL PROTECTED]
| Gesendet: Montag, 21. November 2005 09:15
| An: dev@cocoon.apache.org
| Betreff: Re: Core Documentation
| 
| Stefan Pietschmann schrieb:
| 
| Hello,
| 
|  | What do you mean by attributes. Transformers, etc. can have
| hardwired
|  | attributes associated with them when they are configured in the
|  | component section of the sitemap. In addition, they can have
| parameters
|  | declared in the pipelines which are passed as parameters to the setup
|  | method.
| 
|  The elements in the pipeline shall have attributes like
| 
|  map:transform type=xyz conf=someID/
| 
|  once this node is transfered, the code should use the manager and this
|  attribute to decide, whether to append the component to the pipeline or
| not.
| 
| So you want to have parts of the sitemap executed dependent on some sort
| of value?
| Why not use an action? The contents of the action are only executed if
| you return an Hashmap (i.e. you can check your ID and decide).
| (Maybe i didn't understand your problem well?)
| 
| map:match ...
| ...
| map:act type=myAttributeCheckAction
|   map:parameter name=conf value=someID /
|   map:transform src=... /
| /map:act
| map:act type=myAttributeCheckAction
|   map:parameter name=conf value=someOtherID /
|   map:transform src=... /
| /map:act
| ...
| /map:match
| 
| HTH
| Christoph



Re: AW: Core Documentation

2005-11-21 Thread Andrew Stevens

From: Ralph Goers [EMAIL PROTECTED]
Date: Sun, 20 Nov 2005 19:03:02 -0800



Stefan Pietschmann wrote:



The elements in the pipeline shall have attributes like

map:transform type=xyz conf=someID/





I don't believe you can do that.  Instead you need to either do:

map:components
 map:transformers
map:transformer name=my-transformer 
src=com.whatever.MyTransformer

  confsomeID/someID
/map:transformer
 /map:transformers
/map:components

Then implement the configurable interface and int the configure method do 
config.getChild(conf).getValue() to get the value.


or in your pipeline

map:transformer type=my-transformer src=protocol://some.input.data
 parameter name=conf value=someID/
/map:transformer

Then implement Parameterizable. The conf parameter will be passed to the 
parameterize method.


Or finally in your pipeline do:

map:transformer type=my-transformer src=protocol://some.input.data
 map:parameter name=conf value=someID/
/map:transformer


I think you'll find that should be map:transform, not map:transformer...


Andrew.



In this case the conf parameter will be passed in the Parameters object to 
the transformer's setup method.


HTH

Ralph





Re: AW: Core Documentation

2005-11-21 Thread Ralph Goers



Andrew Stevens wrote:



or in your pipeline

map:transformer type=my-transformer src=protocol://some.input.data
 parameter name=conf value=someID/
/map:transformer

Then implement Parameterizable. The conf parameter will be passed to 
the parameterize method.


Or finally in your pipeline do:

map:transformer type=my-transformer src=protocol://some.input.data
 map:parameter name=conf value=someID/
/map:transformer



I think you'll find that should be map:transform, not map:transformer...


Andrew.


Of course.  Thanks for the correction.

Ralph


AW: Core Documentation

2005-11-20 Thread Stefan Pietschmann
Thank you for your quick response :)

| You should create a component that implements the required Avalon
| interfaces and then declare it in cocoon.xconf. You will need to assign
| it a role (faily simple - look at other components to see how they do
| it). The code that uses the component then calls the component manager
| to look up the role and return the component attached to it. The manager
| will be initialized the first time it is looked up.

Will have to take a look at it. 

| What do you mean by attributes. Transformers, etc. can have hardwired
| attributes associated with them when they are configured in the
| component section of the sitemap. In addition, they can have parameters
| declared in the pipelines which are passed as parameters to the setup
| method.

The elements in the pipeline shall have attributes like

map:transform type=xyz conf=someID/

once this node is transfered, the code should use the manager and this
attribute to decide, whether to append the component to the pipeline or not.

Is there some entry point to the pipeline building, where I can setup the
manager? It needs to be setup with every new request.

Cheers,
Stefan 

| Ralph
| 
| 
| Stefan Pietschmann wrote:
| 
|  Hello Cocooners,
| 
|  I'm desperately looking for Cocoon Core Documentation of any kind. I
|  have - quite unsuccessfully - tried to get a clue from looking at the
|  soure, but this whole sitemap processing seems quite complex.
| 
|  What I need to do - and I will bug you with this in detail for sure
|  later - is in short: To setup a kind of manager object once the
|  sitemap is read. Then any element in a pipeline - like transform, act
|  etc - might have an additional attribute, which is to be evaluated by
|  this manager. So I need to know:
| 
| 1. where to instanciate the manager
| 2. where and how to get the attributes of the pipeline elements
|before they are appended to the ProcessingPipeline
| 3. and how to access the manager object from there
| 
|  For this any documentation or tips would be great. I read that
|  Bertrand gave an introduction on the Cocoon internals at the
|  CocoonGT2005. Are there any docs from there perhaps?
| 
|  Thanx alot,
| 
|  Stefan
| 



Re: AW: Core Documentation

2005-11-20 Thread Ralph Goers



Stefan Pietschmann wrote:



The elements in the pipeline shall have attributes like

map:transform type=xyz conf=someID/


 


I don't believe you can do that.  Instead you need to either do:

map:components
 map:transformers
map:transformer name=my-transformer 
src=com.whatever.MyTransformer

  confsomeID/someID
/map:transformer
 /map:transformers
/map:components

Then implement the configurable interface and int the configure method 
do config.getChild(conf).getValue() to get the value.


or in your pipeline

map:transformer type=my-transformer src=protocol://some.input.data
 parameter name=conf value=someID/
/map:transformer

Then implement Parameterizable. The conf parameter will be passed to the 
parameterize method.


Or finally in your pipeline do:

map:transformer type=my-transformer src=protocol://some.input.data
 map:parameter name=conf value=someID/
/map:transformer

In this case the conf parameter will be passed in the Parameters object 
to the transformer's setup method.


HTH

Ralph