Coverage Report - edu.sampleu.travel.service.FiscalOfficerInfoMaintainableImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
FiscalOfficerInfoMaintainableImpl
0%
0/11
0%
0/6
1.75
 
 1  
 /**
 2  
  * Copyright 2005-2011 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 edu.sampleu.travel.service;
 17  
 
 18  
 import java.util.Map;
 19  
 
 20  
 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
 21  
 import org.kuali.rice.krad.document.MaintenanceDocument;
 22  
 import org.kuali.rice.krad.maintenance.MaintainableImpl;
 23  
 import org.kuali.rice.krad.util.KRADConstants;
 24  
 
 25  
 import edu.sampleu.travel.dto.FiscalOfficerInfo;
 26  
 
 27  
 /**
 28  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 29  
  */
 30  0
 public class FiscalOfficerInfoMaintainableImpl extends MaintainableImpl {
 31  
     
 32  
     private transient FiscalOfficerService fiscalOfficerService;
 33  
 
 34  
     
 35  
     @Override
 36  
     public void saveDataObject() {
 37  0
         if(getMaintenanceAction().equals(KRADConstants.MAINTENANCE_NEW_ACTION) ||
 38  
                 getMaintenanceAction().equals(KRADConstants.MAINTENANCE_COPY_ACTION)) {
 39  0
             getFiscalOfficerService().createFiscalOfficer((FiscalOfficerInfo)getDataObject());
 40  
         }
 41  
         else {
 42  0
             getFiscalOfficerService().updateFiscalOfficer((FiscalOfficerInfo)getDataObject());
 43  
         }
 44  0
     }
 45  
 
 46  
     @Override
 47  
     public Object retrieveObjectForEditOrCopy(MaintenanceDocument document, Map<String, String> dataObjectKeys) {
 48  0
         return getFiscalOfficerService().retrieveFiscalOfficer(new Long(dataObjectKeys.get("id")));
 49  
     }
 50  
 
 51  
     protected FiscalOfficerService getFiscalOfficerService() {
 52  0
         if(fiscalOfficerService == null) {
 53  0
             fiscalOfficerService = GlobalResourceLoader.getService("fiscalOfficerService");
 54  
         }
 55  0
         return this.fiscalOfficerService;
 56  
     }
 57  
 
 58  
     public void setFiscalOfficerService(FiscalOfficerService fiscalOfficerService) {
 59  0
         this.fiscalOfficerService = fiscalOfficerService;
 60  0
     }
 61  
 
 62  
 }