001 /* 002 * Copyright 2011 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.kfs.module.cam.document.web.struts; 017 018 import javax.servlet.http.HttpServletRequest; 019 020 import org.apache.struts.action.ActionMapping; 021 import org.kuali.kfs.module.cam.document.AssetTransferDocument; 022 import org.kuali.kfs.sys.context.SpringContext; 023 import org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentFormBase; 024 import org.kuali.rice.kns.service.BusinessObjectDictionaryService; 025 import org.kuali.rice.kns.service.DataDictionaryService; 026 027 public class AssetTransferForm extends FinancialSystemTransactionalDocumentFormBase { 028 protected boolean loanNoteAdded; 029 030 public AssetTransferForm() { 031 super(); 032 } 033 034 @Override 035 protected String getDefaultDocumentTypeName() { 036 return "AT"; 037 } 038 039 public AssetTransferDocument getAssetTransferDocument() { 040 return (AssetTransferDocument) getDocument(); 041 } 042 043 @Override 044 public void populate(HttpServletRequest request) { 045 super.populate(request); 046 DataDictionaryService dataDictionaryService = SpringContext.getBean(DataDictionaryService.class); 047 SpringContext.getBean(BusinessObjectDictionaryService.class).performForceUppercase(getAssetTransferDocument()); 048 } 049 050 @Override 051 public void reset(ActionMapping mapping, HttpServletRequest request) { 052 super.reset(mapping, request); 053 getAssetTransferDocument().setInterdepartmentalSalesIndicator(false); 054 } 055 056 public boolean isLoanNoteAdded() { 057 return loanNoteAdded; 058 } 059 060 public void setLoanNoteAdded(boolean loanNoteAdded) { 061 this.loanNoteAdded = loanNoteAdded; 062 } 063 064 }