Coverage Report - org.kuali.rice.kew.actionitem.ActionItemActionListExtension
 
Classes in this File Line Coverage Branch Coverage Complexity
ActionItemActionListExtension
0%
0/34
0%
0/14
1.8
 
 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 javax.persistence.MappedSuperclass;
 20  
 import javax.persistence.Transient;
 21  
 
 22  
 import org.kuali.rice.kew.actionlist.DisplayParameters;
 23  
 import org.kuali.rice.kew.exception.WorkflowException;
 24  
 import org.kuali.rice.kew.preferences.Preferences;
 25  
 import org.kuali.rice.kew.service.KEWServiceLocator;
 26  
 import org.kuali.rice.kew.util.KEWConstants;
 27  
 import org.kuali.rice.kim.bo.Group;
 28  
 import org.kuali.rice.kim.bo.Person;
 29  
 import org.kuali.rice.kim.service.KIMServiceLocator;
 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  
 
 56  
     @Transient
 57  
     public Person getDelegatorPerson() {
 58  0
         return delegatorPerson;
 59  
     }
 60  
     
 61  
     @Transient
 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 (getDelegatorWorkflowId() != null) {
 74  0
                 delegatorPerson = KIMServiceLocator.getPersonService().getPerson(getDelegatorWorkflowId());
 75  0
             if (delegatorPerson != null) {
 76  0
                 delegatorName = delegatorPerson.getName();
 77  
             }
 78  
         }
 79  
 
 80  0
         if (getDelegatorGroupId() != null) {
 81  0
                 delegatorGroup = KIMServiceLocator.getIdentityManagementService().getGroup(getDelegatorGroupId());
 82  0
                 if (delegatorGroup !=null)
 83  0
                         delegatorName = delegatorGroup.getGroupName();
 84  
         }
 85  0
         if (KEWConstants.PREFERENCES_YES_VAL.equals(preferences.getShowDateApproved())) {
 86  0
                 setLastApprovedDate(KEWServiceLocator.getActionTakenService().getLastApprovedDate(getRouteHeaderId()));
 87  
         }
 88  0
         isInitialized = true;
 89  0
     }
 90  
 
 91  
     @Transient
 92  
     public boolean isInitialized() {
 93  0
             return isInitialized;
 94  
     }
 95  
 
 96  
     @Transient
 97  
         public DisplayParameters getDisplayParameters() {
 98  0
                 return displayParameters;
 99  
         }
 100  
 
 101  
         public void setDisplayParameters(DisplayParameters displayParameters) {
 102  0
                 this.displayParameters = displayParameters;
 103  0
         }
 104  
 
 105  
         /**
 106  
          * @return the group
 107  
          */
 108  
         @Transient
 109  
         public Group getGroup() {
 110  0
                 return this.group;
 111  
         }
 112  
 
 113  
         /**
 114  
          * @param group the group to set
 115  
          */
 116  
         public void setGroup(Group group) {
 117  0
                 this.group = group;
 118  0
         }
 119  
 
 120  
         /**
 121  
          * @return the delegatorGroup
 122  
          */
 123  
         @Transient
 124  
         public Group getDelegatorGroup() {
 125  0
                 return this.delegatorGroup;
 126  
         }
 127  
 
 128  
         /**
 129  
          * @param delegatorGroup the delegatorGroup to set
 130  
          */
 131  
         public void setDelegatorGroup(Group delegatorGroup) {
 132  0
                 this.delegatorGroup = delegatorGroup;
 133  0
         }
 134  
 
 135  
 }
 136