View Javadoc

1   /**
2    * Copyright 2004-2012 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.hr.time.calendar;
17  
18  import java.util.Map;
19  
20  import org.apache.log4j.Logger;
21  import org.kuali.hr.core.cache.CacheUtils;
22  import org.kuali.rice.kns.document.MaintenanceDocument;
23  import org.kuali.rice.kns.maintenance.KualiMaintainableImpl;
24  
25  /**
26   * Leverage this class to implement hooks when maintenance is done on a
27   * Calendar.
28   * 
29   * @author djunk
30   * 
31   */
32  public class CalendarMaintainableImpl extends KualiMaintainableImpl {
33  
34  	/**
35       * 
36       */
37  	private static final long serialVersionUID = 1L;
38  	private static final Logger LOG = Logger.getLogger(CalendarMaintainableImpl.class);
39  
40  	@Override
41  	public void addNewLineToCollection(String collectionName) {
42  		super.addNewLineToCollection(collectionName);
43  	}
44  
45  	@Override
46  	public Map<String, String> populateNewCollectionLines(Map<String, String> fieldValues, MaintenanceDocument maintenanceDocument, String methodToCall) {
47  		return super.populateNewCollectionLines(fieldValues, maintenanceDocument, methodToCall);
48  	}
49  
50  	@SuppressWarnings("unchecked")
51  	@Override
52  	public void processAfterAddLine(String colName, Class colClass) {
53  		super.processAfterAddLine(colName, colClass);
54  	}
55  
56  	@Override
57  	public void saveBusinessObject() {
58  		super.saveBusinessObject();
59  		Calendar calendar = (Calendar) this.getBusinessObject();
60  		LOG.info("Saved pay calendar: " + calendar.getHrCalendarId());
61          CacheUtils.flushCache(Calendar.CACHE_NAME);
62          CacheUtils.flushCache(CalendarEntries.CACHE_NAME);
63  	}
64  
65  }