001/* 002 * Copyright 2007 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 */ 016package org.kuali.ole.sys.web.struts; 017 018import java.util.List; 019 020import org.apache.struts.upload.FormFile; 021import org.kuali.ole.sys.OLEConstants; 022import org.kuali.ole.sys.businessobject.BatchUpload; 023import org.kuali.rice.core.api.util.KeyValue; 024import org.kuali.rice.coreservice.framework.CoreFrameworkServiceLocator; 025import org.kuali.rice.kns.web.struts.form.KualiForm; 026 027/** 028 * Struts action form for the batch upload screen. 029 */ 030public class KualiBatchInputFileForm extends KualiForm { 031 private FormFile uploadFile; 032 private BatchUpload batchUpload; 033 private List<KeyValue> userFiles; 034 private String url; 035 036 //getterURL pull system parameter used method get parameter.evaluator 037 038 039 private String titleKey; 040 041 /** 042 * Constructs a KualiBatchInputFileForm.java. 043 */ 044 public KualiBatchInputFileForm() { 045 super(); 046 this.batchUpload = new BatchUpload(); 047 } 048 049 /** 050 * Gets the batchUpload attribute. 051 */ 052 public BatchUpload getBatchUpload() { 053 return batchUpload; 054 } 055 056 /** 057 * Sets the batchUpload attribute value. 058 */ 059 public void setBatchUpload(BatchUpload batchUpload) { 060 this.batchUpload = batchUpload; 061 } 062 063 /** 064 * Gets the uploadFile attribute. 065 */ 066 public FormFile getUploadFile() { 067 return uploadFile; 068 } 069 070 /** 071 * Sets the uploadFile attribute value. 072 */ 073 public void setUploadFile(FormFile uploadFile) { 074 this.uploadFile = uploadFile; 075 } 076 077 /** 078 * Gets the userFiles attribute. 079 */ 080 public List<KeyValue> getUserFiles() { 081 return userFiles; 082 } 083 084 /** 085 * Sets the userFiles attribute value. 086 */ 087 public void setUserFiles(List<KeyValue> userFiles) { 088 this.userFiles = userFiles; 089 } 090 091 /** 092 * Gets the titleKey attribute. 093 */ 094 public String getTitleKey() { 095 return titleKey; 096 } 097 098 /** 099 * Sets the titleKey attribute value. 100 */ 101 public void setTitleKey(String titleKey) { 102 this.titleKey = titleKey; 103 } 104 105 /** 106 * Gets the url attribute. 107 * @return Returns the url. 108 */ 109 public String getUrl() { 110 return url; 111 } 112 113 /** 114 * Sets the url attribute value. 115 * @param url The url to set. 116 */ 117 public void setUrl(String url) { 118 this.url = url; 119 } 120 121 @Override 122 protected void customInitMaxUploadSizes() { 123 addMaxUploadSize (CoreFrameworkServiceLocator.getParameterService().getParameterValueAsString(OLEConstants.CoreModuleNamespaces.OLE, "Batch", "MAX_FILE_SIZE_UPLOAD")); 124 } 125 126}