1 /*
2 * Copyright 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.ole.module.purap.document;
17
18 import org.kuali.ole.module.purap.businessobject.PurchaseOrderQuoteLanguage;
19 import org.kuali.ole.sys.context.SpringContext;
20 import org.kuali.ole.sys.document.FinancialSystemMaintainable;
21 import org.kuali.rice.core.api.datetime.DateTimeService;
22 import org.kuali.rice.kns.document.MaintenanceDocument;
23
24 import java.util.Map;
25
26 /*
27 * A special implementation of Maintainable specifically for PurchaseOrderQuoteLanguage
28 * maintenance page to override the behavior when the PurchaseOrderQuoteLanguage
29 * maintenance document is copied.
30 */
31 public class PurchaseOrderQuoteLanguageMaintainableImpl extends FinancialSystemMaintainable {
32
33 /**
34 * Overrides the method in KualiMaintainableImpl to invoke the
35 * initializePoQuoteLanguage to set the create date to the current date.
36 *
37 * @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#processAfterCopy()
38 */
39 @Override
40 public void processAfterCopy(MaintenanceDocument document, Map<String, String[]> parameters) {
41 intializePoQuoteLangauge();
42 super.processAfterCopy(document, parameters);
43 }
44
45 /**
46 * Sets the create date of the PurchaseOrderQuoteLanguage document to the
47 * current date.
48 */
49 private void intializePoQuoteLangauge() {
50 // set create date
51 PurchaseOrderQuoteLanguage poql = (PurchaseOrderQuoteLanguage) super.getBusinessObject();
52 poql.setPurchaseOrderQuoteLanguageCreateDate(SpringContext.getBean(DateTimeService.class).getCurrentSqlDate());
53 }
54 }