Coverage Report - org.kuali.rice.kim.bo.ui.KimDocumentRoleResponsibility
 
Classes in this File Line Coverage Branch Coverage Complexity
KimDocumentRoleResponsibility
0%
0/28
0%
0/8
1.385
 
 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  
 import java.util.List;
 20  
 
 21  
 import javax.persistence.Column;
 22  
 import javax.persistence.Entity;
 23  
 import javax.persistence.Id;
 24  
 import javax.persistence.Table;
 25  
 
 26  
 import org.kuali.rice.kim.bo.role.impl.KimResponsibilityImpl;
 27  
 import org.kuali.rice.kim.service.KIMServiceLocator;
 28  
 import org.kuali.rice.kim.service.impl.ResponsibilityServiceImpl;
 29  
 import org.kuali.rice.kns.util.TypedArrayList;
 30  
 
 31  
 /**
 32  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 33  
  */
 34  
 @Entity
 35  
 @Table(name="KRIM_PND_ROLE_RSP_T")
 36  0
 public class KimDocumentRoleResponsibility extends KimDocumentBoBase {
 37  
         
 38  
         private static final long serialVersionUID = -4465768714850961538L;
 39  
         @Id
 40  
         @Column(name="ROLE_RSP_ID")
 41  
         protected String roleResponsibilityId;
 42  
         @Column(name="ROLE_ID")
 43  
         protected String roleId;
 44  
         @Column(name="RSP_ID")
 45  
         protected String responsibilityId;
 46  
         
 47  
         protected KimResponsibilityImpl kimResponsibility;
 48  
         
 49  0
         protected List<KimDocumentRoleResponsibilityAction> roleRspActions = new TypedArrayList(KimDocumentRoleResponsibilityAction.class);
 50  
         
 51  
         public String getRoleId() {
 52  0
                 return roleId;
 53  
         }
 54  
 
 55  
         public void setRoleId(String roleId) {
 56  0
                 this.roleId = roleId;
 57  0
         }
 58  
 
 59  
         /**
 60  
          * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
 61  
          */
 62  
         @SuppressWarnings("unchecked")
 63  
         @Override
 64  
         protected LinkedHashMap toStringMapper() {
 65  0
                 LinkedHashMap m = new LinkedHashMap();
 66  0
                 m.put( "roleResponsibilityId", roleResponsibilityId );
 67  0
                 m.put( "roleId", roleId );
 68  0
                 m.put( "responsibilityId", responsibilityId );
 69  0
                 return m;
 70  
         }
 71  
 
 72  
         public void setRoleResponsibilityId(String roleResponsibilityId) {
 73  0
                 this.roleResponsibilityId = roleResponsibilityId;
 74  0
         }
 75  
 
 76  
         /**
 77  
          * @return the roleResponsibilityId
 78  
          */
 79  
         public String getRoleResponsibilityId() {
 80  0
                 return this.roleResponsibilityId;
 81  
         }
 82  
 
 83  
         /**
 84  
          * @return the kimResponsibility
 85  
          */
 86  
         public KimResponsibilityImpl getKimResponsibility() {
 87  0
                 if ( kimResponsibility == null && responsibilityId != null ) {
 88  
                         //TODO: this needs to be changed to use the KimResponsibilityInfo object
 89  
                         // but the changes are involved in the UiDocumentService based on the copyProperties method used
 90  
                         // to move the data to/from the document/real objects
 91  0
                         kimResponsibility = ((ResponsibilityServiceImpl)KIMServiceLocator.getResponsibilityService()).getResponsibilityImpl(getResponsibilityId());
 92  
                 }
 93  0
                 return this.kimResponsibility;
 94  
         }
 95  
 
 96  
         /**
 97  
          * @param responsibilityId the responsibilityId to set
 98  
          */
 99  
         public void setResponsibilityId(String responsibilityId) {
 100  0
                 this.responsibilityId = responsibilityId;
 101  0
         }
 102  
 
 103  
         /**
 104  
          * @param kimResponsibility the kimResponsibility to set
 105  
          */
 106  
         public void setKimResponsibility(KimResponsibilityImpl kimResponsibility) {
 107  0
                 this.kimResponsibility = kimResponsibility;
 108  0
         }
 109  
 
 110  
         /**
 111  
          * @return the responsibilityId
 112  
          */
 113  
         public String getResponsibilityId() {
 114  0
                 return this.responsibilityId;
 115  
         }
 116  
 
 117  
         /**
 118  
          * @return the roleRspActions
 119  
          */
 120  
         public KimDocumentRoleResponsibilityAction getRoleRspAction() {
 121  0
                 if(this.roleRspActions!=null && this.roleRspActions.size()>0)
 122  0
                         return this.roleRspActions.get(0);
 123  0
                 return null;
 124  
         }
 125  
 
 126  
         /**
 127  
          * @return the roleRspActions
 128  
          */
 129  
         public List<KimDocumentRoleResponsibilityAction> getRoleRspActions() {
 130  0
                 return this.roleRspActions;
 131  
         }
 132  
 
 133  
         /**
 134  
          * @param roleRspActions the roleRspActions to set
 135  
          */
 136  
         public void setRoleRspActions(
 137  
                         List<KimDocumentRoleResponsibilityAction> roleRspActions) {
 138  0
                 this.roleRspActions = roleRspActions;
 139  0
         }
 140  
 
 141  
         @Override
 142  
         public boolean isActive() {
 143  0
                 return this.active;
 144  
         }
 145  
 
 146  
 }