View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kew.web;
17  
18  import java.io.Serializable;
19  import java.util.Map;
20  
21  import org.kuali.rice.kew.api.util.CodeTranslator;
22  import org.kuali.rice.krad.util.ObjectUtils;
23  
24  /**
25   * A bean for the web-tier when represents the recipient of an Ad Hoc request.
26   *
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   */
29  public class AppSpecificRouteRecipient implements Serializable {
30  
31  	private static final long serialVersionUID = 6587140192756322878L;
32  
33  	private static Map actionRequestCds;
34      protected String type;
35      protected String actionRequested;
36      protected String id;  //can be networkId or groupId (although, currently, it's being treated as principal name or group name)
37      protected String namespaceCode; // Can be a group namespace code or a person name
38      protected String actionRequestId; // The action request ID of the AdHoc route action that was sent for this app specific recipient, if any.
39  
40      public String getActionRequested() {
41          return actionRequested;
42      }
43      public void setActionRequested(String actionRequested) {
44          this.actionRequested = actionRequested;
45      }
46      public String getId() {
47          return id;
48      }
49      public void setId(String id) {
50          this.id = id;
51      }
52      public String getType() {
53          return type;
54      }
55      public void setType(String type) {
56          this.type = type;
57      }
58      
59      public String getNamespaceCode() {
60      	return namespaceCode;
61      }
62      public void setNamespaceCode(String namespaceCode) {
63      	this.namespaceCode = namespaceCode;
64      }
65  
66      public String getActionRequestId() {
67      	return actionRequestId;
68      }
69  
70      public void setActionRequestId(String actionRequestId) {
71      	this.actionRequestId = actionRequestId;
72      }
73  
74      public String getActionRequestedValue(){
75          if (ObjectUtils.isNull(actionRequestCds)) {
76              actionRequestCds = CodeTranslator.arLabels;
77          } else {
78              actionRequestCds.clear();
79              actionRequestCds.putAll(CodeTranslator.arLabels);
80          }
81          if(getActionRequested() != null && !getActionRequested().trim().equals("")){
82              return (String) actionRequestCds.get(getActionRequested());
83          }
84          return null;
85      }
86  
87  }