cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrzej Jan Taramina" <andr...@chaeron.com>
Subject Re: Serializing to a request attribute & Database Actions questions....
Date Fri, 17 Oct 2003 14:56:54 GMT
Steve

> I'm just getting this to work myself... Have you taken a look at the
> modular db samples in 2.1? You'll have to pick your way through the sample;
> there is a lot going on there. 

Yup...I have looked at that in detail, and have my first Database Add action 
almost working.

> Also this doc shows a one liner about doing what you describe:
> 
> http://cocoon.apache.org/2.1/userdocs/actions/database-actions.html
> 
> Specifically:
>    <table name="user_groups">
>       <keys>
>          <key name="uid" type="int">
>             <mode name="request" type="request">
>                <parameter>user_groups.uid</parameter>
>             </mode>
>             <mode name="attribute" type="attrib">
> <parameter>org.apache.cocoon.components.modules.output.OutputModule:user.uid[0
> ]</parameter>
>             </mode>
>          </key>
>          <key name="gid" type="int" set="master">
>             <mode name="request" type="all">
>                <parameter>user_groups.gid</parameter>
>             </mode>
>          </key>
>       </keys>
>    </table>

What confuses me a bit still is how the modes actually work. It seems that 
you can specify multiple modes and then select them, which will in turn cause 
the input/output data to be read/written to different places.

In the example above, I'm not sure what the <parameter> tag is doing.  Is it 
writing a request attribute with the name 
"org.apache.cocoon.components.modules.output.OutputModule:user.uid[0" and a 
value of that key column?

> An important thing to know is that the mode name corresponds to the input
> module name in the cocoon.xconf file. So with the latest 2.1 code you'd want
> to substitute <mode name="request-attr" above. The mode type can be set to
> "all" to make it work in all cases. What the above does is allow the request
> to contain the attribute user.uid (the modules always return a list - so if
> there is always one field you need index 0) to database field uid in table
> user_groups.

Which mode are you suggesting doing the substitute on, the "request" or the 
"attribute" one?  And what do the type designators do?

> Unfortunately, that's about all I can help with...

Every little bit helps!  Thanks!


Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com


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


Mime
View raw message