Coverage Report - org.kuali.rice.krad.bo.AdHocRouteRecipient
 
Classes in this File Line Coverage Branch Coverage Complexity
AdHocRouteRecipient
0%
0/24
0%
0/2
1.083
 
 1  
 /*
 2  
  * Copyright 2005-2007 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.krad.bo;
 17  
 
 18  
 import org.apache.commons.lang.StringUtils;
 19  
 import org.kuali.rice.kew.util.CodeTranslator;
 20  
 import org.kuali.rice.kew.util.KEWConstants;
 21  
 
 22  
 import javax.persistence.Column;
 23  
 import javax.persistence.Id;
 24  
 import javax.persistence.MappedSuperclass;
 25  
 import javax.persistence.Transient;
 26  
 import java.util.Map;
 27  
 
 28  
 
 29  
 /**
 30  
  * TODO we should not be referencing kew constants from this class and wedding ourselves to that workflow application Ad Hoc Route
 31  
  * Recipient Business Object
 32  
  */
 33  
 @MappedSuperclass
 34  
 public abstract class AdHocRouteRecipient extends PersistableBusinessObjectBase {
 35  
 
 36  
     private static final long serialVersionUID = -6499610180752232494L;
 37  0
     private static Map actionRequestCds = CodeTranslator.arLabels;
 38  0
     public static final Integer PERSON_TYPE = new Integer(0);
 39  0
     public static final Integer WORKGROUP_TYPE = new Integer(1);
 40  
 
 41  
     @Id
 42  
         @Column(name="RECIP_TYP_CD")
 43  
         protected Integer type;
 44  
     @Id
 45  
         @Column(name="ACTN_RQST_CD")
 46  
         protected String actionRequested;
 47  
     @Id
 48  
         @Column(name="ACTN_RQST_RECIP_ID")
 49  
         protected String id; // can be networkId or group id
 50  
     @Transient
 51  
     protected String name;
 52  
     @Column(name="DOC_HDR_ID")
 53  
         protected String documentNumber;
 54  
 
 55  0
     public AdHocRouteRecipient() {
 56  
         // set some defaults that can be overridden
 57  0
         this.actionRequested = KEWConstants.ACTION_REQUEST_APPROVE_REQ;
 58  0
         this.versionNumber = new Long(1);
 59  0
     }
 60  
 
 61  
     public String getActionRequested() {
 62  0
         return actionRequested;
 63  
     }
 64  
 
 65  
     public void setActionRequested(String actionRequested) {
 66  0
         this.actionRequested = actionRequested;
 67  0
     }
 68  
 
 69  
     public String getId() {
 70  0
         return id;
 71  
     }
 72  
 
 73  
     public void setId(String id) {
 74  0
         this.id = id;
 75  0
     }
 76  
 
 77  
     public abstract String getName();
 78  
 
 79  
     public void setName( String name ) {
 80  
         // do nothing, assume names come from subclasses
 81  0
     }
 82  
 
 83  
     public Integer getType() {
 84  0
         return type;
 85  
     }
 86  
 
 87  
     public void setType(Integer type) {
 88  0
         this.type = type;
 89  0
     }
 90  
 
 91  
     public void setdocumentNumber (String documentNumber){
 92  0
         this.documentNumber = documentNumber;
 93  0
     }
 94  
 
 95  
     public String getdocumentNumber (){
 96  0
         return documentNumber;
 97  
     }
 98  
 
 99  
     public String getActionRequestedValue() {
 100  0
         String actionRequestedValue = null;
 101  0
         if (StringUtils.isNotBlank(getActionRequested())) {
 102  0
             actionRequestedValue = (String) actionRequestCds.get(getActionRequested());
 103  
         }
 104  0
         return actionRequestedValue;
 105  
     }
 106  
 }