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-2007 The Kuali Foundation
 3  
  *
 4  
  *
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  *
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.kew.actionitem;
 18  
 
 19  
 import org.kuali.rice.kew.actionlist.DisplayParameters;
 20  
 import org.kuali.rice.kew.exception.WorkflowException;
 21  
 import org.kuali.rice.kew.preferences.Preferences;
 22  
 import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
 23  
 import org.kuali.rice.kew.service.KEWServiceLocator;
 24  
 import org.kuali.rice.kew.util.KEWConstants;
 25  
 import org.kuali.rice.kim.api.group.Group;
 26  
 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
 27  
 import org.kuali.rice.kim.bo.Person;
 28  
 
 29  
 import javax.persistence.MappedSuperclass;
 30  
 import javax.persistence.Transient;
 31  
 
 32  
 /**
 33  
  * Alternate model object for action list fetches that do not automatically use
 34  
  * ojb collections.  This is here to make action list faster.
 35  
  *
 36  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 37  
  *
 38  
  */
 39  
 @MappedSuperclass
 40  0
 public class ActionItemActionListExtension extends ActionItem {
 41  
 
 42  
     private static final long serialVersionUID = -8801104028828059623L;
 43  
 
 44  0
     @Transient
 45  
     private Person delegatorPerson = null;
 46  0
     @Transient
 47  
     private String delegatorName = "";
 48  
     @Transient
 49  
     private DisplayParameters displayParameters;
 50  0
     @Transient
 51  
     private boolean isInitialized = false;
 52  0
     @Transient
 53  
     private Group delegatorGroup = null;
 54  0
     @Transient
 55  
     private Group group = null;
 56  
     @Transient
 57  
     private DocumentRouteHeaderValue routeHeader;
 58  
 
 59  
     public Person getDelegatorPerson() {
 60  0
         return delegatorPerson;
 61  
     }
 62  
     
 63  
     public String getDelegatorName() {
 64  0
         return delegatorName;
 65  
     }
 66  
 
 67  
     public void initialize(Preferences preferences) throws WorkflowException {
 68  0
             if (isInitialized) {
 69  0
                     return;
 70  
             }
 71  0
         if (getGroupId() != null) {
 72  0
             group = super.getGroup();
 73  
         }
 74  0
         if (getDelegatorWorkflowId() != null) {
 75  0
                 delegatorPerson = KimApiServiceLocator.getPersonService().getPerson(getDelegatorWorkflowId());
 76  0
             if (delegatorPerson != null) {
 77  0
                 delegatorName = delegatorPerson.getName();
 78  
             }
 79  
         }
 80  
 
 81  0
         if (getDelegatorGroupId() != null) {
 82  0
                 delegatorGroup = KimApiServiceLocator.getIdentityManagementService().getGroup(getDelegatorGroupId());
 83  0
                 if (delegatorGroup !=null)
 84  0
                         delegatorName = delegatorGroup.getName();
 85  
         }
 86  0
         if (KEWConstants.PREFERENCES_YES_VAL.equals(preferences.getShowDateApproved())) {
 87  0
                 setLastApprovedDate(KEWServiceLocator.getActionTakenService().getLastApprovedDate(getDocumentId()));
 88  
         }
 89  0
         isInitialized = true;
 90  0
     }
 91  
 
 92  
     public boolean isInitialized() {
 93  0
             return isInitialized;
 94  
     }
 95  
 
 96  
         public DisplayParameters getDisplayParameters() {
 97  0
                 return displayParameters;
 98  
         }
 99  
 
 100  
         public void setDisplayParameters(DisplayParameters displayParameters) {
 101  0
                 this.displayParameters = displayParameters;
 102  0
         }
 103  
 
 104  
         /**
 105  
          * @return the group
 106  
          */
 107  
         public Group getGroup() {
 108  0
                 return this.group;
 109  
         }
 110  
 
 111  
         /**
 112  
          * @param group the group to set
 113  
          */
 114  
         public void setGroup(Group group) {
 115  0
                 this.group = group;
 116  0
         }
 117  
 
 118  
         /**
 119  
          * @return the delegatorGroup
 120  
          */
 121  
         public Group getDelegatorGroup() {
 122  0
                 return this.delegatorGroup;
 123  
         }
 124  
 
 125  
         /**
 126  
          * @param delegatorGroup the delegatorGroup to set
 127  
          */
 128  
         public void setDelegatorGroup(Group delegatorGroup) {
 129  0
                 this.delegatorGroup = delegatorGroup;
 130  0
         }
 131  
 
 132  
         public DocumentRouteHeaderValue getRouteHeader() {
 133  0
                 return this.routeHeader;
 134  
         }
 135  
 
 136  
         public void setRouteHeader(DocumentRouteHeaderValue routeHeader) {
 137  0
                 this.routeHeader = routeHeader;
 138  0
         }
 139  
 
 140  
 }
 141