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