001: package org.tigris.scarab.util.xmlissues;
002:
003: /* ================================================================
004: * Copyright (c) 2000-2002 CollabNet. All rights reserved.
005: *
006: * Redistribution and use in source and binary forms, with or without
007: * modification, are permitted provided that the following conditions are
008: * met:
009: *
010: * 1. Redistributions of source code must retain the above copyright
011: * notice, this list of conditions and the following disclaimer.
012: *
013: * 2. Redistributions in binary form must reproduce the above copyright
014: * notice, this list of conditions and the following disclaimer in the
015: * documentation and/or other materials provided with the distribution.
016: *
017: * 3. The end-user documentation included with the redistribution, if
018: * any, must include the following acknowlegement: "This product includes
019: * software developed by Collab.Net <http://www.Collab.Net/>."
020: * Alternately, this acknowlegement may appear in the software itself, if
021: * and wherever such third-party acknowlegements normally appear.
022: *
023: * 4. The hosted project names must not be used to endorse or promote
024: * products derived from this software without prior written
025: * permission. For written permission, please contact info@collab.net.
026: *
027: * 5. Products derived from this software may not use the "Tigris" or
028: * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without
029: * prior written permission of Collab.Net.
030: *
031: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
032: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
033: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
034: * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
035: * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
036: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
037: * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
038: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
039: * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
040: * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
041: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
042: *
043: * ====================================================================
044: *
045: * This software consists of voluntary contributions made by many
046: * individuals on behalf of Collab.Net.
047: */
048:
049: public class XmlActivity implements java.io.Serializable {
050: private String id = null;
051: private String attribute = null;
052: private String oldNumericValue = null;
053: private String newNumericValue = null;
054: private String oldUser = null;
055: private String newUser = null;
056: private String oldOption = null;
057: private String newOption = null;
058: private String oldValue = null;
059: private String newValue = null;
060: private Dependency dependency = null;
061: private String description = null;
062: private EndDate endDate = null;
063: private XmlAttachment attachment = null;
064: private String type = null;
065:
066: private boolean isNewActivity = true;
067:
068: public XmlActivity() {
069: }
070:
071: public boolean isNewActivity() {
072: return isNewActivity;
073: }
074:
075: public boolean isRemoveUserActivity() {
076: return (getNewUser() == null && getOldUser() != null);
077: }
078:
079: public boolean isAddDependency() {
080: return (getDependency() != null && getOldValue() == null && getNewValue() != null);
081: }
082:
083: public boolean isDeleteDependency() {
084: return (getDependency() != null && getOldValue() != null && getNewValue() == null);
085: }
086:
087: public boolean isUpdateDependency() {
088: return (getDependency() != null && getOldValue() != null && getNewValue() != null);
089: }
090:
091: public String getId() {
092: return id;
093: }
094:
095: public void setId(String id) {
096: this .id = id;
097: }
098:
099: public void setAttribute(String attribute) {
100: this .attribute = attribute;
101: }
102:
103: public String getAttribute() {
104: return this .attribute;
105: }
106:
107: public void setOldNumericValue(String oldNumericValue) {
108: this .oldNumericValue = oldNumericValue;
109: isNewActivity = false;
110: }
111:
112: public String getOldNumericValue() {
113: return this .oldNumericValue;
114: }
115:
116: public void setNewNumericValue(String newNumericValue) {
117: this .newNumericValue = newNumericValue;
118: }
119:
120: public String getNewNumericValue() {
121: return this .newNumericValue;
122: }
123:
124: public void setOldUser(String oldUser) {
125: this .oldUser = oldUser;
126: isNewActivity = false;
127: }
128:
129: public String getOldUser() {
130: return this .oldUser;
131: }
132:
133: public void setNewUser(String newUser) {
134: this .newUser = newUser;
135: }
136:
137: public String getNewUser() {
138: return this .newUser;
139: }
140:
141: public void setOldOption(String oldOption) {
142: this .oldOption = oldOption;
143: isNewActivity = false;
144: }
145:
146: public String getOldOption() {
147: return this .oldOption;
148: }
149:
150: public void setNewOption(String newOption) {
151: this .newOption = newOption;
152: }
153:
154: public String getNewOption() {
155: return this .newOption;
156: }
157:
158: public void setOldValue(String oldValue) {
159: this .oldValue = oldValue;
160: isNewActivity = false;
161: }
162:
163: public String getOldValue() {
164: return this .oldValue;
165: }
166:
167: public void setNewValue(String newValue) {
168: this .newValue = newValue;
169: }
170:
171: public String getNewValue() {
172: return this .newValue;
173: }
174:
175: public Dependency getDependency() {
176: return dependency;
177: }
178:
179: public void setDependency(Dependency name) {
180: this .dependency = name;
181: isNewActivity = true;
182: }
183:
184: public void setDescription(String description) {
185: this .description = description;
186: }
187:
188: public String getDescription() {
189: return this .description;
190: }
191:
192: public EndDate getEndDate() {
193: return endDate;
194: }
195:
196: public void setEndDate(EndDate endDate) {
197: this .endDate = endDate;
198: }
199:
200: public void setAttachment(XmlAttachment attachment) {
201: this .attachment = attachment;
202: }
203:
204: public XmlAttachment getAttachment() {
205: return this .attachment;
206: }
207:
208: public void setType(String type) {
209: this .type = type;
210: }
211:
212: public String getActivityType() {
213: return this .type;
214: }
215:
216: public String toString() {
217: return ("Activity Id: " + id);
218: }
219: }
|