1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.bo; |
17 | |
|
18 | |
import java.util.LinkedHashMap; |
19 | |
import java.util.Map; |
20 | |
|
21 | |
import javax.persistence.Column; |
22 | |
import javax.persistence.Id; |
23 | |
import javax.persistence.MappedSuperclass; |
24 | |
import javax.persistence.Transient; |
25 | |
|
26 | |
import org.apache.commons.lang.StringUtils; |
27 | |
import org.kuali.rice.kew.util.CodeTranslator; |
28 | |
import org.kuali.rice.kew.util.KEWConstants; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
@MappedSuperclass |
36 | |
public abstract class AdHocRouteRecipient extends PersistableBusinessObjectBase { |
37 | |
|
38 | |
private static final long serialVersionUID = -6499610180752232494L; |
39 | 0 | private static Map actionRequestCds = CodeTranslator.arLabels; |
40 | 0 | public static final Integer PERSON_TYPE = new Integer(0); |
41 | 0 | public static final Integer WORKGROUP_TYPE = new Integer(1); |
42 | |
|
43 | |
@Id |
44 | |
@Column(name="RECIP_TYP_CD") |
45 | |
protected Integer type; |
46 | |
@Id |
47 | |
@Column(name="ACTN_RQST_CD") |
48 | |
protected String actionRequested; |
49 | |
@Id |
50 | |
@Column(name="ACTN_RQST_RECIP_ID") |
51 | |
protected String id; |
52 | |
@Transient |
53 | |
protected String name; |
54 | |
@Column(name="DOC_HDR_ID") |
55 | |
protected String documentNumber; |
56 | |
|
57 | 0 | public AdHocRouteRecipient() { |
58 | |
|
59 | 0 | this.actionRequested = KEWConstants.ACTION_REQUEST_APPROVE_REQ; |
60 | 0 | this.versionNumber = new Long(1); |
61 | 0 | } |
62 | |
|
63 | |
public String getActionRequested() { |
64 | 0 | return actionRequested; |
65 | |
} |
66 | |
|
67 | |
public void setActionRequested(String actionRequested) { |
68 | 0 | this.actionRequested = actionRequested; |
69 | 0 | } |
70 | |
|
71 | |
public String getId() { |
72 | 0 | return id; |
73 | |
} |
74 | |
|
75 | |
public void setId(String id) { |
76 | 0 | this.id = id; |
77 | 0 | } |
78 | |
|
79 | |
public abstract String getName(); |
80 | |
|
81 | |
public void setName( String name ) { |
82 | |
|
83 | 0 | } |
84 | |
|
85 | |
public Integer getType() { |
86 | 0 | return type; |
87 | |
} |
88 | |
|
89 | |
public void setType(Integer type) { |
90 | 0 | this.type = type; |
91 | 0 | } |
92 | |
|
93 | |
public void setdocumentNumber (String documentNumber){ |
94 | 0 | this.documentNumber = documentNumber; |
95 | 0 | } |
96 | |
|
97 | |
public String getdocumentNumber (){ |
98 | 0 | return documentNumber; |
99 | |
} |
100 | |
|
101 | |
public String getActionRequestedValue() { |
102 | 0 | String actionRequestedValue = null; |
103 | 0 | if (StringUtils.isNotBlank(getActionRequested())) { |
104 | 0 | actionRequestedValue = (String) actionRequestCds.get(getActionRequested()); |
105 | |
} |
106 | 0 | return actionRequestedValue; |
107 | |
} |
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
protected LinkedHashMap toStringMapper() { |
113 | 0 | LinkedHashMap m = new LinkedHashMap(); |
114 | |
|
115 | 0 | m.put("type", getType()); |
116 | 0 | m.put("actionRequested", getActionRequested()); |
117 | 0 | m.put("id", getId()); |
118 | |
|
119 | 0 | return m; |
120 | |
} |
121 | |
} |