KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > entities > mydesktop > WorkflowActionVO


1 /* ===============================================================================
2 *
3 * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4 *
5 * ===============================================================================
6 *
7 * Copyright (C) Mattias Bogeblad
8 *
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License version 2, as published by the
11 * Free Software Foundation. See the file LICENSE.html for more information.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19 * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20 *
21 * ===============================================================================
22 * $Id: WorkflowActionVO.java,v 1.8 2006/03/06 17:20:32 mattias Exp $
23 */

24
25 package org.infoglue.cms.entities.mydesktop;
26
27 import java.util.Map JavaDoc;
28
29 import org.infoglue.cms.entities.kernel.BaseEntityVO;
30 import org.infoglue.cms.util.ConstraintExceptionBuffer;
31
32 /**
33  * This is the general action description object. Can be used by any workflow engine hopefully.
34  *
35  * @author Mattias Bogeblad
36  */

37
38 public class WorkflowActionVO implements BaseEntityVO
39 {
40     private static final long serialVersionUID = 1L;
41
42     private Integer JavaDoc id;
43     private Long JavaDoc workflowId;
44     private WorkflowStepVO step;
45     private String JavaDoc name;
46     private String JavaDoc view;
47     private boolean autoExecute;
48     private Map JavaDoc metaAttributes;
49
50     public WorkflowActionVO() {}
51
52     public WorkflowActionVO(Integer JavaDoc id)
53     {
54         setId(id);
55     }
56
57     public WorkflowActionVO(Integer JavaDoc id, Long JavaDoc workflowId, String JavaDoc name)
58     {
59         this(id);
60         setWorkflowId(workflowId);
61         setName(name);
62     }
63
64     public Integer JavaDoc getId()
65     {
66         return this.id;
67     }
68
69     public void setId(Integer JavaDoc id)
70     {
71         this.id = id;
72     }
73
74     public int getIdAsPrimitive()
75     {
76         return (id == null) ? 0 : id.intValue();
77     }
78
79     public Long JavaDoc getWorkflowId()
80     {
81         return workflowId;
82     }
83
84     public void setWorkflowId(Long JavaDoc workflowId)
85     {
86         this.workflowId = workflowId;
87     }
88
89     public WorkflowStepVO getStep()
90     {
91         return step;
92     }
93
94     public void setStep(WorkflowStepVO step)
95     {
96         this.step = step;
97     }
98
99     /**
100      * Convenience method that returns the name of the associated step.
101      * @return the name of the step that this action is part of.
102      */

103     public String JavaDoc getStepName()
104     {
105         return (step == null) ? null : step.getName();
106     }
107
108     /**
109      * Convenience method that returns the owner of the associated step.
110      * @return the owner of the step that this action is part of.
111      */

112     public String JavaDoc getStepOwner()
113     {
114         return (step == null) ? null : step.getOwner();
115     }
116
117     public String JavaDoc getName()
118     {
119         return name;
120     }
121
122     public void setName(String JavaDoc name)
123     {
124         this.name = name;
125     }
126
127     public String JavaDoc getView()
128     {
129         return view;
130     }
131
132     public void setView(String JavaDoc view)
133     {
134         this.view = view;
135     }
136
137     public boolean isAutoExecute()
138     {
139         return autoExecute;
140     }
141
142     public void setAutoExecute(boolean autoExecute)
143     {
144         this.autoExecute = autoExecute;
145     }
146
147     public Map JavaDoc getMetaAttributes()
148     {
149         return metaAttributes;
150     }
151
152     public void setMetaAttributes(Map JavaDoc metaAttributes)
153     {
154         this.metaAttributes = metaAttributes;
155     }
156
157     public ConstraintExceptionBuffer validate()
158     {
159         return new ConstraintExceptionBuffer();
160     }
161
162     public boolean hasView()
163     {
164         return view != null && view.length() > 0;
165     }
166
167     public String JavaDoc toString()
168     {
169         return new StringBuffer JavaDoc(getClass().getName())
170                 .append(" id=").append(id)
171                 .append(" name=").append(name)
172                 .append(" step=").append(getStepName())
173                 .append(" view=").append(view)
174                 .append(" workflowId=").append(workflowId).toString();
175     }
176 }
177
Popular Tags