cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@informatik.tu-darmstadt.de>
Subject Re: [ANN] Module Source and XModule Source
Date Tue, 13 Jan 2004 22:27:25 GMT
Daniel Fagerstrom wrote:

<snip what="cool stuff"/>

> Open Issue
> ----------
> 
> A peculiarity in the RequestAttributeOutputModule and
> SessionAttributeOutputModule is that they as default prefix all 
> attribute names with 
> org.apache.cocoon.components.modules.output.OutputModule", why?

Sorry for the late reply. I had a reply started but no time to finish... :-(

Ok, quoting the docs for request attributes for example:

    Attribute names should follow the same conventions as package names.
    Names beginning with java.*, javax.*, and com.sun.*, are reserved for
    use by Sun Microsystems.

Second, I believe hardly any module should be used as is but one should
create a "private" instance that corresponds to a certain contract. This
way it will quite simple to change the storage location.

So, I believe for every application a new instance of those modules
should be used. This is a great chance to configure the key prefix :-)
The default prefix is kind of an extra motivation for doing it ;-)

> To make the samples for the xmodule source work this must be 
> reconfigured to using attribute names without prefixes. This is done in 
> the cocoon.xconf by puting an empty key-prefix" element:
> 
>   <key-prefix/>
> 
> as child to the configurations of the output-modules "request-attr" and 
> "session-attr".

According to the above reasoning, it would be best to configure two new
instances eg "xmodule-one" and "xmodule-two", both using eg. 
"org.apache.cocoon.samples.xmodule" as a key or none at all if that 
suits you better.

Consequently, one should create instances of input-modules that
automatically add those prefixes eg by wrapping the session and request
attribute modules with a simple mapping meta module.

<component-instance name="xmodule-one"
     class="...SimpleMappingMetaInputModule ....>
     <input-module name="request-attr"/>
     <prefix>org.apache.cocoon.samples.xmodule:</prefix>
</component-instance>


> To make writing with or without XPaths work in a decent way, there is 
> supposed to be booth an input and an output module that are configured 
> to have the same name and that gets and sets the same attribute.
> 
> Could we change the default behaviour for the 
> [Request|Session]AttributeOutputModules so that they not prepending any 
> "name spaces" as default. I found the current behaviour rather strange, 
> but maybe I am missing something.
> 
> --------
> 
> A nice enhancement would be to let the XModuleSource implement 
> ContentHandler, then one would avoid the serialize/parse step in some 
> cases. It could e.g. be used with processToSAX in flowscripts.

Mind you, easy access to modules from flow has been removed :-|

Speaking of modules: since the object model may be obtained from the 
CocoonComponentManager through a static method, we might change their
signature and remove the need to pass the object model to them.

	Chris.

Mime
View raw message