001: /*
002: * Copyright 2005-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.core.bo;
017:
018: import java.util.LinkedHashMap;
019: import java.util.Map;
020:
021: import org.apache.commons.lang.StringUtils;
022:
023: import edu.iu.uis.eden.EdenConstants;
024: import edu.iu.uis.eden.util.CodeTranslator;
025:
026: /**
027: * TODO we should not be referencing eden constants from this class and wedding ourselves to that workflow application Ad Hoc Route
028: * Recipient Business Object
029: */
030: public abstract class AdHocRouteRecipient extends
031: PersistableBusinessObjectBase {
032:
033: private static final long serialVersionUID = -6499610180752232494L;
034: private static Map actionRequestCds = CodeTranslator.arLabels;
035: public static final Integer PERSON_TYPE = new Integer(0);
036: public static final Integer WORKGROUP_TYPE = new Integer(1);
037:
038: protected Integer type;
039: protected String actionRequested;
040: protected String id; // can be networkId or workgroupname
041: protected String name;
042: protected String documentNumber;
043:
044: public AdHocRouteRecipient() {
045: // set some defaults that can be overridden
046: this .actionRequested = EdenConstants.ACTION_REQUEST_APPROVE_REQ;
047: this .versionNumber = new Long(1);
048: }
049:
050: public String getActionRequested() {
051: return actionRequested;
052: }
053:
054: public void setActionRequested(String actionRequested) {
055: this .actionRequested = actionRequested;
056: }
057:
058: public String getId() {
059: return id;
060: }
061:
062: public void setId(String id) {
063: this .id = id;
064: }
065:
066: public abstract String getName();
067:
068: public void setName(String name) {
069: // do nothing, assume names come from subclasses
070: }
071:
072: public Integer getType() {
073: return type;
074: }
075:
076: public void setType(Integer type) {
077: this .type = type;
078: }
079:
080: public void setdocumentNumber(String documentNumber) {
081: this .documentNumber = documentNumber;
082: }
083:
084: public String getdocumentNumber() {
085: return documentNumber;
086: }
087:
088: public String getActionRequestedValue() {
089: String actionRequestedValue = null;
090: if (StringUtils.isNotBlank(getActionRequested())) {
091: actionRequestedValue = (String) actionRequestCds
092: .get(getActionRequested());
093: }
094: return actionRequestedValue;
095: }
096:
097: /**
098: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
099: */
100: protected LinkedHashMap toStringMapper() {
101: LinkedHashMap m = new LinkedHashMap();
102:
103: m.put("type", getType());
104: m.put("actionRequested", getActionRequested());
105: m.put("id", getId());
106:
107: return m;
108: }
109: }
|