01: /*
02: *
03: * Copyright (c) 2004 SourceTap - www.sourcetap.com
04: *
05: * The contents of this file are subject to the SourceTap Public License
06: * ("License"); You may not use this file except in compliance with the
07: * License. You may obtain a copy of the License at http://www.sourcetap.com/license.htm
08: * Software distributed under the License is distributed on an "AS IS" basis,
09: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
10: * the specific language governing rights and limitations under the License.
11: *
12: * The above copyright notice and this permission notice shall be included
13: * in all copies or substantial portions of the Software.
14: *
15: */
16:
17: package com.sourcetap.sfa.security;
18:
19: import org.ofbiz.entity.GenericDelegator;
20: import org.ofbiz.entity.GenericValue;
21:
22: import com.sourcetap.sfa.event.GenericEventProcessor;
23: import com.sourcetap.sfa.util.UserInfo;
24:
25: /**
26: * DOCUMENT ME!
27: *
28: */
29: public class TeamEventProcessor extends GenericEventProcessor {
30: public static final String module = TeamEventProcessor.class
31: .getName();
32:
33: /**
34: * DOCUMENT ME!
35: *
36: * @param userInfo
37: * @param delegator
38: * @param originatingEntityName
39: * @param entityGV
40: *
41: * @return
42: */
43: public int deleteAllRelated(UserInfo userInfo,
44: GenericDelegator delegator, String originatingEntityName,
45: GenericValue entityGV) {
46:
47: int status = STATUS_CONTINUE;
48:
49: // Delete related teams.
50: status = deleteOneRelated(userInfo, delegator, entityGV, "",
51: "TeamMember", originatingEntityName,
52: new GenericEventProcessor());
53:
54: if (status != STATUS_CONTINUE) {
55: return status;
56: }
57:
58: // Delete related party.
59: status = deleteOneRelated(userInfo, delegator, entityGV, "",
60: "Party", originatingEntityName,
61: new GenericEventProcessor());
62:
63: if (status != STATUS_CONTINUE) {
64: return status;
65: }
66:
67: return STATUS_CONTINUE;
68: }
69: }
|