01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.cg.web.struts.form;
17:
18: import java.util.Date;
19:
20: import org.kuali.core.web.format.DateFormatter;
21: import org.kuali.core.web.struts.form.KualiTransactionalDocumentFormBase;
22: import org.kuali.kfs.context.SpringContext;
23: import org.kuali.module.cg.bo.Close;
24: import org.kuali.module.cg.service.CloseService;
25:
26: public class CloseForm extends KualiTransactionalDocumentFormBase {
27:
28: public CloseForm() {
29: super ();
30: setDocument(new Close());
31: setFormatterType("document.userInitiatedCloseDate",
32: DateFormatter.class);
33: setFormatterType("document.closeOnOrBeforeDate",
34: DateFormatter.class);
35: }
36:
37: public Close getMostRecentClose() {
38: return SpringContext.getBean(CloseService.class)
39: .getMostRecentClose();
40: }
41:
42: public Close getCloseDocument() {
43: return (Close) getDocument();
44: }
45:
46: public void setClose(Close document) {
47: setDocument(document);
48: }
49:
50: public Date getUserInitiatedCloseDate() {
51: return getCloseDocument().getUserInitiatedCloseDate();
52: }
53:
54: public void setUserInitiatedCloseDate(Date date) {
55: getCloseDocument().setUserInitiatedCloseDate(
56: new java.sql.Date(date.getTime()));
57: }
58:
59: public Date getCloseOnOrBeforeDate() {
60: return getCloseDocument().getCloseOnOrBeforeDate();
61: }
62:
63: public void setCloseOnOrBeforeDate(Date date) {
64: getCloseDocument().setCloseOnOrBeforeDate(
65: new java.sql.Date(date.getTime()));
66: }
67:
68: }
|