Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DocumentRouteHeaderValueActionListExtension |
|
| 1.3333333333333333;1.333 |
1 | /** | |
2 | * Copyright 2005-2011 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.routeheader; | |
17 | ||
18 | import org.kuali.rice.kim.api.identity.Person; | |
19 | import org.kuali.rice.kim.api.identity.principal.PrincipalContract; | |
20 | import org.kuali.rice.kim.api.services.KimApiServiceLocator; | |
21 | ||
22 | import javax.persistence.MappedSuperclass; | |
23 | import javax.persistence.Transient; | |
24 | ||
25 | ||
26 | /** | |
27 | * An extension of {@link DocumentRouteHeaderValue} which is mapped to OJB to help | |
28 | * with optimization of the loading of a user's Action List. | |
29 | * | |
30 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
31 | */ | |
32 | //@Entity | |
33 | //@Table(name="KREW_DOC_HDR_T") | |
34 | @MappedSuperclass | |
35 | 0 | public class DocumentRouteHeaderValueActionListExtension extends DocumentRouteHeaderValue { |
36 | ||
37 | private static final long serialVersionUID = 8458532812557846684L; | |
38 | ||
39 | 0 | @Transient |
40 | private PrincipalContract actionListInitiatorPrincipal = null; | |
41 | ||
42 | public PrincipalContract getActionListInitiatorPrincipal() { | |
43 | 0 | return actionListInitiatorPrincipal; |
44 | } | |
45 | ||
46 | public void setActionListInitiatorPrincipal(PrincipalContract actionListInitiatorPrincipal) { | |
47 | 0 | this.actionListInitiatorPrincipal = actionListInitiatorPrincipal; |
48 | 0 | } |
49 | ||
50 | /** | |
51 | * Gets the initiator name, masked appropriately if restricted. | |
52 | */ | |
53 | public String getInitiatorName() { | |
54 | 0 | String initiatorName = null; |
55 | 0 | Person initiator = KimApiServiceLocator.getPersonService().getPerson(getActionListInitiatorPrincipal().getPrincipalId()); |
56 | 0 | if (initiator != null) { |
57 | 0 | initiatorName = initiator.getName(); |
58 | } | |
59 | 0 | return initiatorName; |
60 | } | |
61 | ||
62 | } | |
63 |