001/**
002 * Copyright 2005-2017 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.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/ecl2.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 */
016package org.kuali.rice.kew.web;
017
018import java.io.Serializable;
019import java.util.Map;
020
021import org.kuali.rice.kew.api.util.CodeTranslator;
022import org.kuali.rice.krad.util.ObjectUtils;
023
024/**
025 * A bean for the web-tier when represents the recipient of an Ad Hoc request.
026 *
027 * @author Kuali Rice Team (rice.collab@kuali.org)
028 */
029public class AppSpecificRouteRecipient implements Serializable {
030
031        private static final long serialVersionUID = 6587140192756322878L;
032
033        private static Map actionRequestCds;
034    protected String type;
035    protected String actionRequested;
036    protected String id;  //can be networkId or groupId (although, currently, it's being treated as principal name or group name)
037    protected String namespaceCode; // Can be a group namespace code or a person name
038    protected String actionRequestId; // The action request ID of the AdHoc route action that was sent for this app specific recipient, if any.
039
040    public String getActionRequested() {
041        return actionRequested;
042    }
043    public void setActionRequested(String actionRequested) {
044        this.actionRequested = actionRequested;
045    }
046    public String getId() {
047        return id;
048    }
049    public void setId(String id) {
050        this.id = id;
051    }
052    public String getType() {
053        return type;
054    }
055    public void setType(String type) {
056        this.type = type;
057    }
058    
059    public String getNamespaceCode() {
060        return namespaceCode;
061    }
062    public void setNamespaceCode(String namespaceCode) {
063        this.namespaceCode = namespaceCode;
064    }
065
066    public String getActionRequestId() {
067        return actionRequestId;
068    }
069
070    public void setActionRequestId(String actionRequestId) {
071        this.actionRequestId = actionRequestId;
072    }
073
074    public String getActionRequestedValue(){
075        if (ObjectUtils.isNull(actionRequestCds)) {
076            actionRequestCds = CodeTranslator.arLabels;
077        } else {
078            actionRequestCds.clear();
079            actionRequestCds.putAll(CodeTranslator.arLabels);
080        }
081        if(getActionRequested() != null && !getActionRequested().trim().equals("")){
082            return (String) actionRequestCds.get(getActionRequested());
083        }
084        return null;
085    }
086
087}