1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.web.struts;
17
18 import java.util.Date;
19 import java.util.List;
20
21 import javax.servlet.http.HttpServletRequest;
22
23 import org.apache.struts.action.ActionMapping;
24 import org.apache.struts.upload.FormFile;
25 import org.kuali.ole.module.purap.document.RequisitionDocument;
26 import org.kuali.ole.select.businessobject.OleLoadFailureRecords;
27 import org.kuali.ole.select.businessobject.OleLoadSumRecords;
28 import org.kuali.ole.select.document.AcquisitionBatchInputFileDocument;
29 import org.kuali.ole.sys.businessobject.AcquisitionBatchUpload;
30 import org.kuali.rice.krad.util.ObjectUtils;
31 import org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase;
32 import org.kuali.rice.kns.web.ui.HeaderField;
33 import org.kuali.rice.kew.api.WorkflowDocument;
34
35
36
37
38 public class AcquisitionBatchInputFileForm extends KualiTransactionalDocumentFormBase {
39 private FormFile uploadFile;
40 private AcquisitionBatchUpload acquisitionBatchUpload;
41
42
43 private OleLoadSumRecords oleLoadSumRecords;
44 private List<OleLoadFailureRecords> oleLoadFailureRecordsList;
45 private String fileName;
46 private String titleKey;
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 public AcquisitionBatchUpload getAcquisitionBatchUpload() {
62 return acquisitionBatchUpload;
63 }
64
65
66
67
68 public void setAcquisitionBatchUpload(AcquisitionBatchUpload batchUpload) {
69 this.acquisitionBatchUpload = batchUpload;
70 }
71
72
73
74
75 public FormFile getUploadFile() {
76 return uploadFile;
77 }
78
79
80
81
82 public void setUploadFile(FormFile uploadFile) {
83 this.uploadFile = uploadFile;
84 }
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103 public String getTitleKey() {
104 return titleKey;
105 }
106
107
108
109
110 public void setTitleKey(String titleKey) {
111 this.titleKey = titleKey;
112 }
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130 public OleLoadSumRecords getOleLoadSumRecords() {
131 return oleLoadSumRecords;
132 }
133
134 public void setOleLoadSumRecords(OleLoadSumRecords oleLoadSumRecords) {
135 this.oleLoadSumRecords = oleLoadSumRecords;
136 }
137
138 public List<OleLoadFailureRecords> getOleLoadFailureRecordsList() {
139 return oleLoadFailureRecordsList;
140 }
141
142 public void setOleLoadFailureRecordsList(List<OleLoadFailureRecords> oleLoadFailureRecordsList) {
143 this.oleLoadFailureRecordsList = oleLoadFailureRecordsList;
144 }
145 public String getFileName() {
146 return fileName;
147 }
148
149 public void setFileName(String fileName) {
150 this.fileName = fileName;
151 }
152
153 @Override
154 public String getRefreshCaller(){
155 return "refreshCaller";
156 }
157
158 @Override
159 public void reset(ActionMapping mapping, HttpServletRequest request) {
160 super.reset(mapping, request);
161 }
162
163 public AcquisitionBatchInputFileForm(){
164 super();
165 this.acquisitionBatchUpload = new AcquisitionBatchUpload();
166 setDocTypeName("OLE_ACQBTHUPLOAD");
167 setDocument(new AcquisitionBatchInputFileDocument());
168 }
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183 public void populateHeaderFields(WorkflowDocument workflowDocument) {
184 super.populateHeaderFields(workflowDocument);
185 if (ObjectUtils.isNotNull(this.oleLoadSumRecords)) {
186 String displayValue=getDocInfo().get(3).getDisplayValue();
187 getDocInfo().remove(3);
188 getDocInfo().add(new HeaderField("DataDictionary.OleLoadSumRecords.attributes.loadCreatedDate", displayValue));
189 getDocInfo().add(new HeaderField("DataDictionary.OleLoadSumRecords.attributes.acqLoadSumId", this.oleLoadSumRecords.getAcqLoadSumId().toString()));
190
191 }
192
193 }
194
195 }