cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Schwarz" <saschw...@hotmail.com>
Subject Re: Database actions - how to implement conditions?
Date Fri, 31 Oct 2003 18:51:52 GMT
Jan
How about using a DatabaseSelectAction first? If you condition is met then 
don't do the delete.
pseudo-pipeline:

<map:match pattern="conditionaldelete">
<map:act type="select">
  <map:parameter name="table-set" value="select-primary-in-use"/>
  <map:generate src="cant_delete_primary_key_in_use.xml"/>
  <map:serialize type="html"/>
</map:act>
<map:act type="delete">
<!-- your current delete stuff goes here -->
</map:act>
</map:match>

Unless maybe I'm not understanding your question(?)
HTH
Steve



>From: Jan Wielgus <list40@o2.pl>
>Reply-To: users@cocoon.apache.org
>To: users@cocoon.apache.org
>Subject: Database actions - how to implement conditions?
>Date: Fri, 31 Oct 2003 17:23:17 +0100
>
>Hello,
>
>I'm using DatabaseDeleteAction to delete rows from a table. But
>before the row is deleted I would like to check it for a condition
>(in this special case if the primary key of that row is not anymore
>referenced in other tables - if it would be, than it can't be
>deleted). How can I put this "checking" before the actual
>"delete"-action will be executed?
>I'm using a form for choosing the item to be deleted:
>
><xsl:template match="kpage">
>   	<center>
>   		<h3>Dokumenten-Kategorien</h3>
>   	</center>
>     <form action="main.xsp" method="post">
>       <table class="list" align="center">
>         <xsl:apply-templates select="kategorie" />
>       <input type="hidden" name="id" value="{bid}" />
>       <input type="hidden" name="cocoon-action" value="Delete" />
>      <tr><td class="list" colspan="2"><input type="submit"
>value="Loeschen" /></td></tr>
>     </table>
>     </form>
>   </xsl:template>
>   <xsl:template match="kategorie">
>     <tr>
>       <td class="list" width="300">
>         <xsl:value-of select="name" />
>       </td>
>       <td class="list">
>         <input type="radio" name="katid"
>         value="{normalize-space(id)}" />
>       </td>
>     </tr>
>   </xsl:template>
>
>Regards
>
>Jan
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>

_________________________________________________________________
Enjoy MSN 8 patented spam control and more with MSN 8 Dial-up Internet 
Service.  Try it FREE for one month!   http://join.msn.com/?page=dept/dialup


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


Mime
View raw message