cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject [c2] multi-add database action
Date Wed, 16 May 2001 21:11:02 GMT
someone (martin?) had posted a question regarding modifying berin's
database add action to add multiple rows to a table. i have a similar need
now. i want to add not just multiple rows to a table, i want to add
multiple rows to multiple tables from one form. after some pondering, i
was thinking a scheme like this might be good. the form descriptor would
be expanded to allow multiple tables, and the param attribute values could
have wildcards in them:

<map>
  <table name="product_table">
    <keys>
      <key param="id" dbcol="id" type="int" mode="manual"/>
    </keys>
    <values>
      <value param="name" dbcol="name" type="string"/>
    </values>
  </table>
  <table name="product_meta_element_table">
    <keys>
      <key param="id" dbcol="product_id" type="int" mode="manual"/>
      <key param="product_meta_element_name_*" dbcol="name" type="string"/>
    </keys>
    <values>
      <value param="product_meta_element_value_*" dbcol="value" type="string"/>
    </values>
  </table>
</map>

for each request parameter that fit the wildcard pattern (e.g.
product_meta_element_name_1), if all other wildcarded parameters also had
a similarly named request parameter (product_meta_element_value_1), a row
would be inserted into the table.

any comments? berin, do your database actions handle multi-column primary
keys properly right now?

- donald


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


Mime
View raw message