Coverage Report - org.kuali.rice.kim.bo.role.impl.KimPermissionTemplateImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
KimPermissionTemplateImpl
0%
0/33
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007-2008 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.role.impl;
 17  
 
 18  
 import java.util.LinkedHashMap;
 19  
 
 20  
 import javax.persistence.Column;
 21  
 import javax.persistence.Entity;
 22  
 import javax.persistence.Id;
 23  
 import javax.persistence.Table;
 24  
 
 25  
 import org.kuali.rice.kim.bo.role.KimPermissionTemplate;
 26  
 import org.kuali.rice.kim.bo.role.dto.KimPermissionTemplateInfo;
 27  
 import org.kuali.rice.kim.bo.types.dto.KimTypeInfo;
 28  
 import org.kuali.rice.kim.service.KIMServiceLocator;
 29  
 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
 30  
 
 31  
 /**
 32  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 33  
  */
 34  
 @Entity
 35  
 @Table(name="KRIM_PERM_TMPL_T")
 36  0
 public class KimPermissionTemplateImpl extends PersistableBusinessObjectBase implements KimPermissionTemplate {
 37  
 
 38  
         private static final long serialVersionUID = 1L;
 39  
         
 40  
         @Id
 41  
         @Column(name="PERM_TMPL_ID")
 42  
         protected String permissionTemplateId;
 43  
         @Column(name="NMSPC_CD")
 44  
         protected String namespaceCode;
 45  
         @Column(name="NM")
 46  
         protected String name;
 47  
         @Column(name="KIM_TYP_ID")
 48  
         protected String kimTypeId;
 49  
         @Column(name="DESC_TXT", length=400)
 50  
         protected String description;
 51  
         @Column(name="ACTV_IND")
 52  
         protected boolean active;
 53  
 
 54  
         public String getKimTypeId() {
 55  0
                 return kimTypeId;
 56  
         }
 57  
 
 58  
         /**
 59  
          * @see org.kuali.rice.kns.bo.Inactivateable#isActive()
 60  
          */
 61  
         public boolean isActive() {
 62  0
                 return active;
 63  
         }
 64  
 
 65  
         /**
 66  
          * @see org.kuali.rice.kns.bo.Inactivateable#setActive(boolean)
 67  
          */
 68  
         public void setActive(boolean active) {
 69  0
                 this.active = active;
 70  0
         }
 71  
 
 72  
         public KimTypeInfo getKimType() {
 73  0
                 return KIMServiceLocator.getTypeInfoService().getKimType(kimTypeId);
 74  
         }
 75  
 
 76  
         /**
 77  
          * @see org.kuali.rice.kim.bo.role.KimPermission#getDescription()
 78  
          */
 79  
         public String getDescription() {
 80  0
                 return description;
 81  
         }
 82  
 
 83  
         /**
 84  
          * @see org.kuali.rice.kim.bo.role.KimPermission#getPermissionId()
 85  
          */
 86  
         public String getPermissionTemplateId() {
 87  0
                 return permissionTemplateId;
 88  
         }
 89  
 
 90  
         /**
 91  
          * @see org.kuali.rice.kim.bo.role.KimPermission#getName()
 92  
          */
 93  
         public String getName() {
 94  0
                 return name;
 95  
         }
 96  
 
 97  
         public void setKimTypeId(String kimTypeId) {
 98  0
                 this.kimTypeId = kimTypeId;
 99  0
         }
 100  
 
 101  
         public void setDescription(String description) {
 102  0
                 this.description = description;
 103  0
         }
 104  
 
 105  
         public void setName(String name) {
 106  0
                 this.name = name;
 107  0
         }
 108  
 
 109  
         /**
 110  
          * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
 111  
          */
 112  
         @SuppressWarnings("unchecked")
 113  
         @Override
 114  
         protected LinkedHashMap toStringMapper() {
 115  0
                 LinkedHashMap m = new LinkedHashMap();
 116  0
                 m.put( "permissionTemplateId", permissionTemplateId );
 117  0
                 m.put( "name", name );
 118  0
                 m.put( "kimTypeId", kimTypeId );
 119  0
                 return m;
 120  
         }
 121  
 
 122  
         public String getNamespaceCode() {
 123  0
                 return this.namespaceCode;
 124  
         }
 125  
 
 126  
         public void setNamespaceCode(String namespaceCode) {
 127  0
                 this.namespaceCode = namespaceCode;
 128  0
         }
 129  
 
 130  
         public void setPermissionTemplateId(String permissionTemplateId) {
 131  0
                 this.permissionTemplateId = permissionTemplateId;
 132  0
         }
 133  
         
 134  
         public KimPermissionTemplateInfo toSimpleInfo() {
 135  0
                 KimPermissionTemplateInfo dto = new KimPermissionTemplateInfo();
 136  
                 
 137  0
                 dto.setPermissionTemplateId( getPermissionTemplateId() );
 138  0
                 dto.setName( getName() );
 139  0
                 dto.setNamespaceCode( getNamespaceCode() );
 140  0
                 dto.setDescription( getDescription() );
 141  0
                 dto.setKimTypeId( getKimTypeId() );
 142  0
                 dto.setActive( isActive() );
 143  
                 
 144  0
                 return dto;
 145  
         }
 146  
         
 147  
 }