View Javadoc
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.cg.web.struts;
17  
18  import java.util.Date;
19  
20  import org.kuali.ole.module.cg.document.ProposalAwardCloseDocument;
21  import org.kuali.ole.module.cg.service.CloseService;
22  import org.kuali.ole.sys.context.SpringContext;
23  import org.kuali.ole.sys.document.web.struts.FinancialSystemTransactionalDocumentFormBase;
24  import org.kuali.rice.core.web.format.DateFormatter;
25  
26  public class CloseForm extends FinancialSystemTransactionalDocumentFormBase {
27  
28      public CloseForm() {
29          super();
30          setFormatterType("document.userInitiatedCloseDate", DateFormatter.class);
31          setFormatterType("document.closeOnOrBeforeDate", DateFormatter.class);
32      }
33  
34      @Override
35      protected String getDefaultDocumentTypeName() {
36          return "OLE_CLOS";
37      }
38      
39      public ProposalAwardCloseDocument getMostRecentClose() {
40          return SpringContext.getBean(CloseService.class).getMostRecentClose();
41      }
42  
43      public ProposalAwardCloseDocument getCloseDocument() {
44          return (ProposalAwardCloseDocument) getDocument();
45      }
46  
47      public void setClose(ProposalAwardCloseDocument document) {
48          setDocument(document);
49      }
50  
51      public Date getUserInitiatedCloseDate() {
52          return getCloseDocument().getUserInitiatedCloseDate();
53      }
54  
55      public void setUserInitiatedCloseDate(Date date) {
56          getCloseDocument().setUserInitiatedCloseDate(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(new java.sql.Date(date.getTime()));
65      }
66  
67  }