On 28.Oct.2002 -- 02:07 PM, Rui Leal wrote:
> Hi ALL!
> 
> I've been working and testing cocoon for about 3 weeks ... after some simple
> examples i started some more complex stuff ..
> 
> Right now i´m trying to understand the proper way to work with modular
> actions ..
> 
> so imagine this ...
> 
> One table, SIGLAS, is the main information table, it consists of 5 columns
> ID, SIGLA, DOM_REF, DESC_REF, QUEM_REF. There are also 3 tables,
> SIGLAS_DOMINIOS, SIGLAS_DESCRICOES, SIGLAS_QUEM, with the following columns
> ID, NAME. The columns DOM_REF, DESC_REF, QUEM_REF hold a foreign key to the
> 3 tables mentioned before (to the column ID of course).
> 

[...]

> <map:action-sets>
>     <map:action-set name="addSigla">
>         <map:act type="req-params">
>                 <map:parameter name="parameters" value="add-sigla
> SIGLAS_DOMINIOS.NOME"/>
>                 <map:act type="siglaAdd">
>                     <map:parameter name="table-set" value="all-dominios"/>
>                 </map:act>
>         </map:act>
> 
>         <map:act type="req-params">
>             <map:parameter name="parameters" value="add-sigla
> SIGLAS_DESCRICOES.DESCRICAO"/>
>             <map:act type="siglaAdd">
>                 <map:parameter name="table-set" value="all-descricoes"/>
>             </map:act>
>          </map:act>
> 
>     <map:act type="req-params">
>         <map:parameter name="parameters" value="add-sigla
> SIGLAS_QUEM.NOME"/>
>         <map:act type="siglaAdd">
>             <map:parameter name="table-set" value="all-quem"/>
>         </map:act>
>     </map:act>
> 
>     <map:act type="siglaAdd">
>         <map:parameter name="table-set" value="add-siglas"/>
>     </map:act>
> 
>     </map:action-set>
> </map:action-sets>

There has been a problem using nested actions in an action-set in 2.1
and most likely treeprocessor in 2.0.x.

> So my BIG problem is how to do this?

That means, your code does not work as expected? What does it do, then?

> Must i declare a table-set for each operation combination ? (like DOM as
> foreign key but DESC has not, and so on ..)

This or a cocoon-action-* parameter for every combination. Personally,
I'd prefer not to use an action-set but code the selection logic
myself. You sure want to do form-validation (XMLForms or other), don't
you. That or the RequestParameterExistsAction would come in handy
here. I see that you already use the latter.

> If i use a mode like "attrib", i'm using it for all the foreign keys .. i

You don't have to. You can change the mode-name for every attribute
and every mode-type. The mode-type can be specified through the
table-set. In addition there's the "all" mode-type that would be used
regardless of the requested mode-type (if the requested type wasn't
found before).

> want to get the ID by a request attribute only on from the tables i inserted
> before. The ones i selected (not added) are just on the request parameter !

CVS 2.1 has a ChainMetaModule that allows to specify a preference list
of InputModules. The first one returning a value != null is used. I'm
currently working on something in that area. Once that is finished,
2.0.4-CVS will get updated. In the mean time, it should be safe to
copy it together with the AbstractMetaModule from 2.1 to 2.0.4,
rebuild, and add it to cocoon.xconf if you need it fast.

> How can i do this in ONE request ?

see above.

> Is there any "ConvertAllRequestParametersToRequestAttributes" action ?

I believe so. If not, it's no big deal writing it yourself. The
ChainMetaModule from 2.1 is another solution.

> I've come to the conclusion it is faster to write some logic on a couple of
> XSP's than to use the actions this way.

If you don't mind to mix concerns, that is. The problem with your
scenario is that you want everything to happen in one invocation of
the actions.

HTH
        Chris.
-- 
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

Reply via email to