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 org.kuali.workflow.workgroup;
018:
019: import java.util.ArrayList;
020: import java.util.List;
021:
022: import org.kuali.workflow.attribute.Extension;
023: import org.kuali.workflow.attribute.ExtensionData;
024:
025: import edu.iu.uis.eden.BaseWorkflowPersistable;
026: import edu.iu.uis.eden.workgroup.BaseWorkgroup;
027: import edu.iu.uis.eden.workgroup.Workgroup;
028:
029: /**
030: * An extension of a {@link Workgroup}. Provides attribute-specific data
031: * extensions to the workgroup for a particular {@link WorkgroupType}. Contains
032: * a List of {@link ExtensionData}s.
033: *
034: * @see Workgroup
035: * @see WorkgroupType
036: * @see ExtensionData
037: *
038: * @author ewestfal
039: */
040: public class BaseWorkgroupExtension extends BaseWorkflowPersistable
041: implements Extension {
042:
043: private static final long serialVersionUID = -305147691188181612L;
044:
045: private Long workgroupExtensionId;
046: private Integer lockVerNbr;
047:
048: private BaseWorkgroup workgroup;
049: private WorkgroupTypeAttribute workgroupTypeAttribute;
050:
051: private List<ExtensionData> data = new ArrayList<ExtensionData>();
052:
053: public String getAttributeName() {
054: return workgroupTypeAttribute.getAttribute().getName();
055: }
056:
057: public List<ExtensionData> getData() {
058: return data;
059: }
060:
061: public String getDataValue(String key) {
062: for (ExtensionData data : getData()) {
063: if (data.getKey().equals(key)) {
064: return data.getValue();
065: }
066: }
067: return null;
068: }
069:
070: public Integer getLockVerNbr() {
071: return lockVerNbr;
072: }
073:
074: public void setLockVerNbr(Integer lockVerNbr) {
075: this .lockVerNbr = lockVerNbr;
076: }
077:
078: public WorkgroupTypeAttribute getWorkgroupTypeAttribute() {
079: return workgroupTypeAttribute;
080: }
081:
082: public void setWorkgroupTypeAttribute(
083: WorkgroupTypeAttribute ruleTemplateAttribute) {
084: this .workgroupTypeAttribute = ruleTemplateAttribute;
085: }
086:
087: public BaseWorkgroup getWorkgroup() {
088: return workgroup;
089: }
090:
091: public void setWorkgroup(BaseWorkgroup workgroup) {
092: this .workgroup = workgroup;
093: }
094:
095: public Long getWorkgroupExtensionId() {
096: return workgroupExtensionId;
097: }
098:
099: public void setWorkgroupExtensionId(Long workgroupExtensionId) {
100: this.workgroupExtensionId = workgroupExtensionId;
101: }
102:
103: }
|