Coverage Report - org.kuali.rice.kew.actionitem.ActionItemActionListExtension
 
Classes in this File Line Coverage Branch Coverage Complexity
ActionItemActionListExtension
0%
0/37
0%
0/14
1.667
 
 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.actionitem;
 17  
 
 18  
 import org.kuali.rice.kew.api.actionlist.DisplayParameters;
 19  
 import org.kuali.rice.kew.api.exception.WorkflowException;
 20  
 import org.kuali.rice.kew.api.preferences.Preferences;
 21  
 import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
 22  
 import org.kuali.rice.kew.service.KEWServiceLocator;
 23  
 import org.kuali.rice.kew.api.KewApiConstants;
 24  
 import org.kuali.rice.kim.api.group.Group;
 25  
 import org.kuali.rice.kim.api.identity.Person;
 26  
 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
 27  
 
 28  
 import javax.persistence.MappedSuperclass;
 29  
 import javax.persistence.Transient;
 30  
 
 31  
 /**
 32  
  * Alternate model object for action list fetches that do not automatically use
 33  
  * ojb collections.  This is here to make action list faster.
 34  
  *
 35  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 36  
  *
 37  
  */
 38  
 @MappedSuperclass
 39  0
 public class ActionItemActionListExtension extends ActionItem {
 40  
 
 41  
     private static final long serialVersionUID = -8801104028828059623L;
 42  
 
 43  0
     @Transient
 44  
     private Person delegatorPerson = null;
 45  0
     @Transient
 46  
     private String delegatorName = "";
 47  
     @Transient
 48  
     private DisplayParameters displayParameters;
 49  0
     @Transient
 50  
     private boolean isInitialized = false;
 51  0
     @Transient
 52  
     private Group delegatorGroup = null;
 53  0
     @Transient
 54  
     private Group group = null;
 55  
     @Transient
 56  
     private DocumentRouteHeaderValue routeHeader;
 57  
 
 58  
     public Person getDelegatorPerson() {
 59  0
         return delegatorPerson;
 60  
     }
 61  
     
 62  
     public String getDelegatorName() {
 63  0
         return delegatorName;
 64  
     }
 65  
 
 66  
     public void initialize(Preferences preferences) throws WorkflowException {
 67  0
             if (isInitialized) {
 68  0
                     return;
 69  
             }
 70  0
         if (getGroupId() != null) {
 71  0
             group = super.getGroup();
 72  
         }
 73  0
         if (getDelegatorPrincipalId() != null) {
 74  0
                 delegatorPerson = KimApiServiceLocator.getPersonService().getPerson(getDelegatorPrincipalId());
 75  0
             if (delegatorPerson != null) {
 76  0
                 delegatorName = delegatorPerson.getName();
 77  
             }
 78  
         }
 79  
 
 80  0
         if (getDelegatorGroupId() != null) {
 81  0
                 delegatorGroup = KimApiServiceLocator.getGroupService().getGroup(getDelegatorGroupId());
 82  0
                 if (delegatorGroup !=null)
 83  0
                         delegatorName = delegatorGroup.getName();
 84  
         }
 85  0
         if (KewApiConstants.PREFERENCES_YES_VAL.equals(preferences.getShowDateApproved())) {
 86  0
                 setLastApprovedDate(KEWServiceLocator.getActionTakenService().getLastApprovedDate(getDocumentId()));
 87  
         }
 88  0
         isInitialized = true;
 89  0
     }
 90  
 
 91  
     public boolean isInitialized() {
 92  0
             return isInitialized;
 93  
     }
 94  
 
 95  
         public DisplayParameters getDisplayParameters() {
 96  0
                 return displayParameters;
 97  
         }
 98  
 
 99  
         public void setDisplayParameters(DisplayParameters displayParameters) {
 100  0
                 this.displayParameters = displayParameters;
 101  0
         }
 102  
 
 103  
         /**
 104  
          * @return the group
 105  
          */
 106  
         public Group getGroup() {
 107  0
                 return this.group;
 108  
         }
 109  
 
 110  
         /**
 111  
          * @param group the group to set
 112  
          */
 113  
         public void setGroup(Group group) {
 114  0
                 this.group = group;
 115  0
         }
 116  
 
 117  
         /**
 118  
          * @return the delegatorGroup
 119  
          */
 120  
         public Group getDelegatorGroup() {
 121  0
                 return this.delegatorGroup;
 122  
         }
 123  
 
 124  
         /**
 125  
          * @param delegatorGroup the delegatorGroup to set
 126  
          */
 127  
         public void setDelegatorGroup(Group delegatorGroup) {
 128  0
                 this.delegatorGroup = delegatorGroup;
 129  0
         }
 130  
 
 131  
         public DocumentRouteHeaderValue getRouteHeader() {
 132  0
                 return this.routeHeader;
 133  
         }
 134  
 
 135  
         public void setRouteHeader(DocumentRouteHeaderValue routeHeader) {
 136  0
                 this.routeHeader = routeHeader;
 137  0
         }
 138  
 
 139  
 }
 140