001: /*
002: * Copyright 2005-2006 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package edu.iu.uis.eden.routetemplate;
018:
019: import java.util.ArrayList;
020: import java.util.List;
021:
022: import org.apache.commons.lang.builder.ToStringBuilder;
023:
024: import edu.iu.uis.eden.WorkflowPersistable;
025:
026: /**
027: * Model bean defining a rule attribute. Includes the classname of the attribute
028: * class, as well as it's name and other information.
029: *
030: * @author rkirkend
031: * @author jhopf
032: */
033: public class RuleAttribute implements WorkflowPersistable {
034:
035: private static final long serialVersionUID = 1027673603158346349L;
036: private Long ruleAttributeId;
037: private String name;
038: private String label;
039: private String type;
040: private String className;
041: private String description;
042: private String xmlConfigData;
043: private Integer lockVerNbr;
044: private String messageEntity;
045:
046: private List ruleTemplateAttributes;
047: private List validValues;
048:
049: // required to be lookupable
050: private String returnUrl;
051:
052: public RuleAttribute() {
053: ruleTemplateAttributes = new ArrayList();
054: validValues = new ArrayList();
055: }
056:
057: public List getValidValues() {
058: return validValues;
059: }
060:
061: public void setValidValues(List ruleAttributeValidValues) {
062: this .validValues = ruleAttributeValidValues;
063: }
064:
065: public List getRuleTemplateAttributes() {
066: return ruleTemplateAttributes;
067: }
068:
069: public void setRuleTemplateAttributes(List ruleTemplateAttributes) {
070: this .ruleTemplateAttributes = ruleTemplateAttributes;
071: }
072:
073: public String getDescription() {
074: return description;
075: }
076:
077: public void setDescription(String description) {
078: this .description = description;
079: }
080:
081: public String getLabel() {
082: return label;
083: }
084:
085: public void setLabel(String label) {
086: this .label = label;
087: }
088:
089: public Integer getLockVerNbr() {
090: return lockVerNbr;
091: }
092:
093: public void setLockVerNbr(Integer lockVerNbr) {
094: this .lockVerNbr = lockVerNbr;
095: }
096:
097: public String getName() {
098: return name;
099: }
100:
101: public void setName(String name) {
102: this .name = name;
103: }
104:
105: public Long getRuleAttributeId() {
106: return ruleAttributeId;
107: }
108:
109: public void setRuleAttributeId(Long ruleAttributeId) {
110: this .ruleAttributeId = ruleAttributeId;
111: }
112:
113: public String getType() {
114: return type;
115: }
116:
117: public void setType(String type) {
118: this .type = type;
119: }
120:
121: public Object copy(boolean preserveKeys) {
122: RuleAttribute ruleAttributeClone = new RuleAttribute();
123: if (className != null) {
124: ruleAttributeClone.setClassName(new String(className));
125: }
126: if (description != null) {
127: ruleAttributeClone.setDescription(new String(description));
128: }
129: if (label != null) {
130: ruleAttributeClone.setLabel(new String(label));
131: }
132: if (name != null) {
133: ruleAttributeClone.setName(new String(name));
134: }
135: if (preserveKeys && ruleAttributeId != null) {
136: ruleAttributeClone.setRuleAttributeId(new Long(
137: ruleAttributeId.longValue()));
138: }
139: if (type != null) {
140: ruleAttributeClone.setType(new String(type));
141: }
142: return ruleAttributeClone;
143: }
144:
145: /**
146: * @return Returns the className.
147: */
148: public String getClassName() {
149: return className;
150: }
151:
152: /**
153: * @param className The className to set.
154: */
155: public void setClassName(String className) {
156: this .className = className;
157: }
158:
159: public String getRuleAttributeActionsUrl() {
160: return "<a href=\"RuleAttributeReport.do?ruleAttributeId="
161: + ruleAttributeId + "\" >report</a>";
162: }
163:
164: public String getReturnUrl() {
165: return returnUrl;
166: }
167:
168: public void setReturnUrl(String returnUrl) {
169: this .returnUrl = returnUrl;
170: }
171:
172: public String getXmlConfigData() {
173: return xmlConfigData;
174: }
175:
176: public void setXmlConfigData(String xmlConfigData) {
177: this .xmlConfigData = xmlConfigData;
178: }
179:
180: public String getMessageEntity() {
181: return messageEntity;
182: }
183:
184: public void setMessageEntity(String messageEntity) {
185: this .messageEntity = messageEntity;
186: }
187:
188: public String toString() {
189: return new ToStringBuilder(this ).append("name", name).append(
190: "ruleAttributeId", ruleAttributeId).append("className",
191: className).append("description", description).append(
192: "label", label).append("messageEntity", messageEntity)
193: .append("lockVerNbr").toString();
194: }
195:
196: }
|