View Javadoc

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