/*
 * Copyright 2008 The Kuali Foundation.
 * 
 * Licensed under the Educational Community License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.opensource.org/licenses/ecl1.php
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.kfs.module.bc.batch;

import java.util.Date;

import org.kuali.kfs.module.bc.batch.service.GLBudgetLoadService;
import org.kuali.kfs.sys.batch.AbstractStep;
import org.kuali.kfs.sys.context.SpringContext;


public class BudgetConstructionGeneralLedgerLoadBatchStep extends AbstractStep {

    public boolean execute(String jobName, Date jobRunDate) throws InterruptedException {
      // @@TODO: the budget should load in the current fiscal year.
      // however, for testing purposes we will hard-wire it in, since we aren't running in a normal environment yet.
      GLBudgetLoadService generalLedgerBudgetLoadService = SpringContext.getBean(GLBudgetLoadService.class); 
      // normally, this would be called with no parameter, and would automatically load the fiscal year following the fiscal year of the run date. 
      generalLedgerBudgetLoadService.loadPendingBudgetConstructionGeneralLedger(2009);
        return true;
    }

}

@@ -836,16 +836,74 @@
 ontext;%0A
+import org.kuali.kfs.module.bc.util.BudgetParameterFinder;
 %0A%0Apublic
@@ -978,16 +978,74 @@
 Step %7B%0A%0A
+    private GLBudgetLoadService glBudgetLoadService;%0A    %0A
     publ
@@ -1139,192 +1139,237 @@
  // 
-@@TODO: the budget should
+normally, this would be called with no parameter, and would automatically
  load 
-in 
 the 
-current fiscal year.%0A      // however, for testing purposes we will hard-wire it in, since we aren't running in a normal environment yet.
+fiscal year following the fiscal year of the run date. but, this version uses a parameter to load the fiscal year following a base year. 
 %0A      
-GL
+gl
 Budg
@@ -1381,18 +1381,47 @@
 dService
- g
+.loadPendingBudgetConstructionG
 eneralLe
@@ -1428,332 +1428,222 @@
 dger
+(
 Budget
-LoadService = SpringContext.getBean(GLBudgetLoadService.class
+ParameterFinder.getBaseFiscalYear()+1
 );
- 
 %0A      
-// normally, this would be called with no parameter, and would automatically load the fiscal year following the fiscal year of the run date. %0A      generalLedgerBudgetLoadService.loadPendingBudgetConstructionGeneralLedger(2009);%0A        return tru
+  return true;%0A    %7D%0A%0A    public void setGLBudgetLoadService(GLBudgetLoadService glBudgetLoadService)%0A    %7B%0A        this.glBudgetLoadService = glBudgetLoadServic
 e;%0A 
@@ -1647,11 +1647,10 @@
 ;%0A    %7D%0A
-%0A
 %7D%0A

change to wire services instead of using SpringContext added parameter to call