Coverage Report - org.kuali.rice.kim.bo.ui.KimDocumentRoleResponsibilityAction
 
Classes in this File Line Coverage Branch Coverage Complexity
KimDocumentRoleResponsibilityAction
0%
0/44
0%
0/8
1.286
 
 1  
 /*
 2  
  * Copyright 2007-2009 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.kim.bo.ui;
 17  
 
 18  
 import java.util.LinkedHashMap;
 19  
 
 20  
 import org.kuali.rice.kew.util.CodeTranslator;
 21  
 import org.kuali.rice.kim.bo.role.impl.KimResponsibilityImpl;
 22  
 import org.kuali.rice.kim.bo.role.impl.RoleResponsibilityImpl;
 23  
 import org.kuali.rice.kim.service.KIMServiceLocator;
 24  
 import org.kuali.rice.kim.service.impl.ResponsibilityServiceImpl;
 25  
 import org.kuali.rice.kns.util.ObjectUtils;
 26  
 
 27  
 /**
 28  
  * This is a description of what this class does - shyu don't forget to fill this in. 
 29  
  * 
 30  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 31  
  *
 32  
  */
 33  0
 public class KimDocumentRoleResponsibilityAction extends KimDocumentBoBase {
 34  
         private static final long serialVersionUID = 696663543888096105L;
 35  
         protected String roleResponsibilityActionId;
 36  
         protected String roleResponsibilityId;
 37  
         protected String roleMemberId;
 38  
         protected String actionTypeCode;
 39  
         protected String actionPolicyCode;
 40  
         protected Integer priorityNumber;
 41  
         protected boolean forceAction;
 42  
         protected KimResponsibilityImpl kimResponsibility;
 43  
         protected RoleResponsibilityImpl roleResponsibility;
 44  
         
 45  
         /*{
 46  
                 roleResponsibility = new RoleResponsibilityImpl();
 47  
                 roleResponsibility.setKimResponsibility(new KimResponsibilityImpl());
 48  
                 roleResponsibility.getKimResponsibility().setTemplate(new KimResponsibilityTemplateImpl());
 49  
         }*/
 50  
         
 51  
         /**
 52  
          * @return the kimResponsibility
 53  
          */
 54  
         public KimResponsibilityImpl getKimResponsibility() {
 55  
                 try {
 56  0
                         if ( ObjectUtils.isNull( kimResponsibility ) && ObjectUtils.isNotNull( getRoleResponsibility() ) ) {
 57  
                                 //TODO: this needs to be changed to use the KimResponsibilityInfo object
 58  
                                 // but the changes are involved in the UiDocumentService based on the copyProperties method used
 59  
                                 // to move the data to/from the document/real objects
 60  0
                                 kimResponsibility = ((ResponsibilityServiceImpl)KIMServiceLocator.getResponsibilityService()).getResponsibilityImpl(getRoleResponsibility().getResponsibilityId());
 61  
                         }
 62  0
                 } catch( RuntimeException ex ) {
 63  0
                         ex.printStackTrace();
 64  0
                         throw ex;
 65  0
                 }
 66  0
                 return kimResponsibility;
 67  
         }
 68  
         /**
 69  
          * @param kimResponsibility the kimResponsibility to set
 70  
          */
 71  
         public void setKimResponsibility(KimResponsibilityImpl kimResponsibility) {
 72  0
                 this.kimResponsibility = kimResponsibility;
 73  0
         }
 74  
         public String getRoleResponsibilityActionId() {
 75  0
                 return this.roleResponsibilityActionId;
 76  
         }
 77  
         public void setRoleResponsibilityActionId(String roleResponsibilityResolutionId) {
 78  0
                 this.roleResponsibilityActionId = roleResponsibilityResolutionId;
 79  0
         }
 80  
         public String getRoleResponsibilityId() {
 81  0
                 return this.roleResponsibilityId;
 82  
         }
 83  
         public void setRoleResponsibilityId(String roleResponsibilityId) {
 84  0
                 this.roleResponsibilityId = roleResponsibilityId;
 85  0
         }
 86  
         public String getActionTypeCode() {
 87  0
                 return this.actionTypeCode;
 88  
         }
 89  
         public void setActionTypeCode(String actionTypeCode) {
 90  0
                 this.actionTypeCode = actionTypeCode;
 91  0
         }
 92  
         public Integer getPriorityNumber() {
 93  0
                 return this.priorityNumber;
 94  
         }
 95  
         public void setPriorityNumber(Integer priorityNumber) {
 96  0
                 this.priorityNumber = priorityNumber;
 97  0
         }
 98  
         
 99  
         /**
 100  
          * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
 101  
          */
 102  
         @SuppressWarnings("unchecked")
 103  
         @Override
 104  
         protected LinkedHashMap toStringMapper() {
 105  0
                 LinkedHashMap lhm = new LinkedHashMap();
 106  0
                 lhm.put( "roleResponsibilityActionId", roleResponsibilityActionId );
 107  0
                 lhm.put( "roleResponsibilityId", roleResponsibilityId );
 108  0
                 lhm.put( "roleMemberId", roleMemberId );
 109  0
                 lhm.put( "actionTypeCode", actionTypeCode );
 110  0
                 return lhm;
 111  
         }
 112  
         public String getActionPolicyCode() {
 113  0
                 return this.actionPolicyCode;
 114  
         }
 115  
         public void setActionPolicyCode(String actionPolicyCode) {
 116  0
                 this.actionPolicyCode = actionPolicyCode;
 117  0
         }
 118  
         public String getRoleMemberId() {
 119  0
                 return this.roleMemberId;
 120  
         }
 121  
         public void setRoleMemberId(String roleMemberId) {
 122  0
                 this.roleMemberId = roleMemberId;
 123  0
         }
 124  
         
 125  
         /**
 126  
          * 
 127  
          * This method fore readonlyalterdisplay
 128  
          * 
 129  
          * @return
 130  
          */
 131  
         public String getActionPolicyDescription() {
 132  0
                 return (String)CodeTranslator.approvePolicyLabels.get(this.actionPolicyCode);
 133  
         }
 134  
 
 135  
         /**
 136  
          * 
 137  
          * This method fore readonlyalterdisplay
 138  
          * 
 139  
          * @return
 140  
          */
 141  
         public String getActionTypeDescription() {
 142  0
                 return (String)CodeTranslator.arLabels.get(this.actionTypeCode);
 143  
         }
 144  
         /**
 145  
          * @return the roleResponsibility
 146  
          */
 147  
         public RoleResponsibilityImpl getRoleResponsibility() {
 148  0
                 if ( ObjectUtils.isNull( roleResponsibility ) && roleResponsibilityId != null ) {
 149  
                         //TODO: this needs to be changed to use the KimResponsibilityInfo object
 150  
                         // but the changes are involved in the UiDocumentService based on the copyProperties method used
 151  
                         // to move the data to/from the document/real objects
 152  0
                         roleResponsibility = ((ResponsibilityServiceImpl)KIMServiceLocator.getResponsibilityService()).getRoleResponsibilityImpl(getRoleResponsibilityId());
 153  
                 }
 154  0
                 return roleResponsibility;
 155  
         }
 156  
         /**
 157  
          * @param roleResponsibility the roleResponsibility to set
 158  
          */
 159  
         public void setRoleResponsibility(RoleResponsibilityImpl roleResponsibility) {
 160  0
                 this.roleResponsibility = roleResponsibility;
 161  0
         }
 162  
 
 163  
         /**
 164  
          * @return the forceAction
 165  
          */
 166  
         public boolean isForceAction() {
 167  0
                 return this.forceAction;
 168  
         }
 169  
         /**
 170  
          * @param forceAction the forceAction to set
 171  
          */
 172  
         public void setForceAction(boolean forceAction) {
 173  0
                 this.forceAction = forceAction;
 174  0
         }
 175  
 
 176  
 }