001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/matrix/api/src/java/org/theospi/portfolio/workflow/model/WorkflowItem.java $
003: * $Id: WorkflowItem.java 10835 2006-06-17 03:25:03Z lance@indiana.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.theospi.portfolio.workflow.model;
021:
022: import org.sakaiproject.metaobj.shared.model.Id;
023: import org.sakaiproject.metaobj.shared.model.IdentifiableObject;
024:
025: public class WorkflowItem extends IdentifiableObject {
026:
027: public final static int NOTIFICATION_WORKFLOW = 0;
028: public final static int STATUS_CHANGE_WORKFLOW = 1;
029: public final static int CONTENT_LOCKING_WORKFLOW = 2;
030:
031: public final static String CONTENT_LOCKING_LOCK = "LOCK";
032: public final static String CONTENT_LOCKING_UNLOCK = "UNLOCK";
033:
034: private int actionType;
035: private Id actionObjectId;
036: private String actionValue;
037: private Workflow workflow;
038:
039: public WorkflowItem() {
040: ;
041: }
042:
043: public WorkflowItem(int actionType, Id actionObjectId,
044: String actionValue) {
045: this .actionType = actionType;
046: this .actionObjectId = actionObjectId;
047: this .actionValue = actionValue;
048: }
049:
050: /**
051: * @return Returns the action.
052: */
053: public int getActionType() {
054: return actionType;
055: }
056:
057: /**
058: * @param action The action to set.
059: */
060: public void setActionType(int actionType) {
061: this .actionType = actionType;
062: }
063:
064: /**
065: * @return Returns the actionObjectId.
066: */
067: public Id getActionObjectId() {
068: return actionObjectId;
069: }
070:
071: /**
072: * @param actionObjectId The actionObjectId to set.
073: */
074: public void setActionObjectId(Id actionObjectId) {
075: this .actionObjectId = actionObjectId;
076: }
077:
078: /**
079: * @return Returns the actionValue.
080: */
081: public String getActionValue() {
082: return actionValue;
083: }
084:
085: /**
086: * @param actionValue The actionValue to set.
087: */
088: public void setActionValue(String actionValue) {
089: this .actionValue = actionValue;
090: }
091:
092: /**
093: * @return Returns the workflow.
094: */
095: public Workflow getWorkflow() {
096: return workflow;
097: }
098:
099: /**
100: * @param workflow The workflow to set.
101: */
102: public void setWorkflow(Workflow workflow) {
103: this .workflow = workflow;
104: }
105:
106: public boolean equals(Object in) {
107: // TODO Auto-generated method stub
108: //return super.equals(in);
109:
110: if (this == in)
111: return true;
112: if (in == null && this == null)
113: return true;
114: if (in == null && this != null)
115: return false;
116: if (this == null && in != null)
117: return false;
118: if (this .getId() == null && ((WorkflowItem) in).getId() != null)
119: return false;
120: if (this .getId() != null && ((WorkflowItem) in).getId() == null)
121: return false;
122: if (this .getId() == null
123: && ((WorkflowItem) in).getId() == null
124: && !this .getWorkflow().equals(
125: ((WorkflowItem) in).getWorkflow()))
126: return false;
127: if (!this .getActionObjectId().equals(
128: ((WorkflowItem) in).getActionObjectId()))
129: return false;
130: if (this .getActionType() != ((WorkflowItem) in).getActionType())
131: return false;
132: if (!this .getActionValue().equals(
133: ((WorkflowItem) in).getActionValue()))
134: return false;
135: return this .getId().equals(((WorkflowItem) in).getId());
136:
137: }
138:
139: }
|