Author: hansbak Date: Tue Oct 3 06:56:51 2006 New Revision: 452500 URL: http://svn.apache.org/viewvc?view=rev&rev=452500 Log: add an optional parameter to the deleteComminucationEvent to optionally delete dependent content, dataresource and imageDataResource. This for emails comimg in not detected by the spamfilter and which have attachements you want to get rid of
Modified: incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml incubator/ofbiz/trunk/applications/party/servicedef/services.xml Modified: incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?view=diff&rev=452500&r1=452499&r2=452500 ============================================================================== --- incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml (original) +++ incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml Tue Oct 3 06:56:51 2006 @@ -82,6 +82,31 @@ <check-errors/> <entity-one entity-name="CommunicationEvent" value-name="event"/> + <!-- remove related links to content --> + <get-related value-name="event" relation-name="CommEventContentAssoc" list-name="contentAssocs"/> + <if-not-empty field-name="contentAssocs"> + <iterate entry-name="contentAssoc" list-name="contentAssocs"> + <remove-value value-name="contentAssoc"/> + <!-- delete content and dataresource too if requested --> + <if-compare field-name="parameters.delContentDataResource" value="Y" operator="equals"> + <get-related value-name="contentAssoc" relation-name="FromContent" list-name="contents"/> + <if-not-empty field-name="contents"> + <iterate entry-name="content" list-name="contents"> + <remove-value value-name="content"/> + <get-related-one value-name="content" relation-name="DataResource" to-value-name="dataResource"/> + <if-not-empty field-name="dataResource"> + <get-related-one value-name="dataResource" relation-name="ImageDataResource" to-value-name="imageDataResource"/> + <if-not-empty field-name="imageDataResource"> + <remove-value value-name="imageDataResource"/> + </if-not-empty> + <remove-value value-name="dataResource"/> + </if-not-empty> + </iterate> + </if-not-empty> + </if-compare> + </iterate> + </if-not-empty> + <!-- delete the event itself --> <remove-value value-name="event"/> </simple-method> <!-- since these ancillary operations on communication event cause them to be updated, Modified: incubator/ofbiz/trunk/applications/party/servicedef/services.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/party/servicedef/services.xml?view=diff&rev=452500&r1=452499&r2=452500 ============================================================================== --- incubator/ofbiz/trunk/applications/party/servicedef/services.xml (original) +++ incubator/ofbiz/trunk/applications/party/servicedef/services.xml Tue Oct 3 06:56:51 2006 @@ -593,6 +593,7 @@ location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="deleteCommunicationEvent" auth="true"> <description>Delete a Communication Event</description> <auto-attributes entity-name="CommunicationEvent" include="pk" mode="IN" optional="false"/> + <attribute name="delContentDataResource" type="String" mode="IN" optional="true"/> </service> <service name="createCommunicationEventPurpose" engine="simple" location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="createCommunicationEventPurpose" auth="true">