KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ofbiz > shark > audit > CreateProcessEventAudit


1 /*
2  * $Id: CreateProcessEventAudit.java 5462 2005-08-05 18:35:48Z jonesde $
3  *
4  * Copyright (c) 2004 The Open For Business Project - www.ofbiz.org
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
21  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  */

25 package org.ofbiz.shark.audit;
26
27 import org.ofbiz.base.util.Debug;
28 import org.ofbiz.base.util.UtilMisc;
29 import org.ofbiz.entity.GenericDelegator;
30 import org.ofbiz.entity.GenericEntityException;
31 import org.ofbiz.entity.GenericValue;
32
33 import org.enhydra.shark.api.internal.eventaudit.CreateProcessEventAuditPersistenceInterface;
34
35 /**
36  * Persistance Object
37  *
38  * @author <a HREF="mailto:jaz@ofbiz.org">Andy Zeneski</a>
39  * @version $Rev: 5462 $
40  * @since 3.1
41  */

42 public class CreateProcessEventAudit extends EventAudit implements CreateProcessEventAuditPersistenceInterface {
43
44     public static final String JavaDoc module = AssignmentEventAudit.class.getName();
45     protected GenericValue createProcessEventAudit = null;
46     private boolean newValue = false;
47
48     public CreateProcessEventAudit(EntityAuditMgr mgr, GenericDelegator delegator, String JavaDoc eventAuditId) {
49         super(mgr, delegator, eventAuditId);
50         if (this.delegator != null) {
51             try {
52                 this.createProcessEventAudit = delegator.findByPrimaryKey("WfCreateProcessEventAudit", UtilMisc.toMap("eventAuditId", eventAuditId));
53             } catch (GenericEntityException e) {
54                 Debug.logError(e, module);
55             }
56         } else {
57             Debug.logError("Invalid delegator object passed", module);
58         }
59     }
60
61     public CreateProcessEventAudit(EntityAuditMgr mgr, GenericDelegator delegator) {
62         super(mgr, delegator);
63         this.newValue = true;
64         this.createProcessEventAudit = delegator.makeValue("WfCreateProcessEventAudit", UtilMisc.toMap("eventAuditId", this.eventAuditId));
65     }
66
67     public CreateProcessEventAudit(EntityAuditMgr mgr, GenericValue createProcessEventAudit) {
68         super(mgr, createProcessEventAudit.getDelegator(), createProcessEventAudit.getString("eventAuditId"));
69         this.createProcessEventAudit = createProcessEventAudit;
70     }
71
72     public void setPActivityId(String JavaDoc paId) {
73         createProcessEventAudit.set("pActivityId", paId);
74     }
75
76     public String JavaDoc getPActivityId() {
77         return createProcessEventAudit.getString("pActivityId");
78     }
79
80     public void setPProcessId(String JavaDoc ppId) {
81         createProcessEventAudit.set("pProcessId", ppId);
82     }
83
84     public String JavaDoc getPProcessId() {
85         return createProcessEventAudit.getString("pProcessId");
86     }
87
88     public void setPProcessName(String JavaDoc ppn) {
89         createProcessEventAudit.set("pProcessName", ppn);
90     }
91
92     public String JavaDoc getPProcessName() {
93         return createProcessEventAudit.getString("pProcessName");
94     }
95
96     public void setPProcessDefinitionName(String JavaDoc ppdn) {
97         createProcessEventAudit.set("pProcessDefName", ppdn);
98     }
99
100     public String JavaDoc getPProcessDefinitionName() {
101         return createProcessEventAudit.getString("pProcessDefName");
102     }
103
104     public void setPProcessDefinitionVersion(String JavaDoc ppdv) {
105         createProcessEventAudit.set("pProcessDefVer", ppdv);
106     }
107
108     public String JavaDoc getPProcessDefinitionVersion() {
109         return createProcessEventAudit.getString("pProcessDefVer");
110     }
111
112     public void setPActivityDefinitionId(String JavaDoc padId) {
113         createProcessEventAudit.set("pActivityDefId", padId);
114     }
115
116     public String JavaDoc getPActivityDefinitionId() {
117         return createProcessEventAudit.getString("pActivityDefId");
118     }
119
120     public void setPActivitySetDefinitionId(String JavaDoc s) {
121         // TODO: Implement Me!
122
}
123
124     public String JavaDoc getPActivitySetDefinitionId() {
125         return null; // TODO: Implement Me!
126
}
127
128     public void setPProcessDefinitionId(String JavaDoc ppdId) {
129         createProcessEventAudit.set("pProcessDefId", ppdId);
130     }
131
132     public String JavaDoc getPProcessDefinitionId() {
133         return createProcessEventAudit.getString("pProcessDefId");
134     }
135
136     public void setPPackageId(String JavaDoc ppkgId) {
137         createProcessEventAudit.set("pPackageId", ppkgId);
138     }
139
140     public String JavaDoc getPPackageId() {
141         return createProcessEventAudit.getString("pPackageId");
142     }
143
144     public void store() throws GenericEntityException {
145         super.store();
146         if (newValue) {
147             newValue = false;
148             delegator.createOrStore(createProcessEventAudit);
149         } else {
150             delegator.store(createProcessEventAudit);
151         }
152     }
153
154     public void reload() throws GenericEntityException {
155         super.reload();
156         if (!newValue) {
157             createProcessEventAudit.refresh();
158         }
159     }
160
161     public void remove() throws GenericEntityException {
162         super.remove();
163         if (!newValue) {
164             delegator.removeValue(createProcessEventAudit);
165         }
166     }
167 }
168
Popular Tags