View Javadoc
1   package org.kuali.ole.deliver.form;
2   
3   import org.apache.commons.collections.CollectionUtils;
4   import org.kuali.ole.deliver.bo.OleLoanDocument;
5   import org.kuali.ole.deliver.bo.OleLoanFastAdd;
6   import org.kuali.ole.deliver.bo.OlePatronDocument;
7   import org.kuali.ole.deliver.drools.DroolsExchange;
8   import org.kuali.ole.deliver.util.ErrorMessage;
9   import org.kuali.ole.docstore.engine.service.storage.rdbms.pojo.ItemRecord;
10  import org.kuali.rice.krad.web.form.UifFormBase;
11  
12  import java.util.ArrayList;
13  import java.util.Date;
14  import java.util.Iterator;
15  import java.util.List;
16  
17  /**
18   * Created by pvsubrah on 6/18/15.
19   */
20  public class CircForm extends OLEForm {
21      /*
22      Need loggedInUser is the principalId used for checking for permissions etc.
23      overridingPrincipalName is the operator who has overriding privs. Needed for the loan.
24       */
25      private String loggedInUser = null;
26      private String overridingPrincipalName;
27  
28      /*
29      selectedCirculationDesk selected circ desk.
30      previouslySelectedCirculationDesk is to maintain the state
31      in case we need to revert back to the previously selected desk.
32       */
33      private String selectedCirculationDesk;
34      private String previouslySelectedCirculationDesk;
35  
36      private ErrorMessage errorMessage = new ErrorMessage();
37  
38      private boolean proxyCheckDone;
39      private boolean itemValidationDone;
40      private boolean itemOverride;
41      private boolean requestExistOrLoanedCheck;
42  
43      /*
44      patronBarcode: Current Borrower
45       */
46      private String patronBarcode;
47      private OlePatronDocument patronDocument;
48  
49  
50      private String itemBarcode;
51      private ItemRecord itemRecord;
52  
53      private boolean proceedWithCheckout;
54      private boolean showExistingLoan;
55  
56      private boolean autoCheckout;
57  
58  
59      private OleLoanFastAdd oleLoanFastAdd;
60  
61      private Date customDueDateMap;
62      private String customDueDateTime;
63      private String customDueDateTimeMessage;
64  
65      private List<OleLoanDocument> loanDocumentListForCurrentSession;
66      private List<OleLoanDocument> existingLoanList;
67      private List<OleLoanDocument> loanDocumentsForAlterDueDate;
68      private List<OleLoanDocument> loanDocumentsForRenew;
69  
70      private String claimsReturnNote;
71  
72      private boolean claimsReturnFlag;
73  
74      private String damagedItemNote;
75  
76      private boolean damagedItemFlag;
77  
78      private String missingPieceNote;
79  
80      private String numberOfPiece;
81  
82      private String missingPieceCount;
83  
84      private boolean missingPieceFlag;
85  
86      private String pageNumber;
87  
88      private String pageSize;
89  
90      private String maxSessionTime;
91  
92  
93      private Date customDueDateMapForRenew;
94      private String customDueDateTimeForRenew;
95      private String customDueDateTimeMessageForRenew;
96  
97      private boolean recordNoteForClaimsReturn;
98      private boolean recordNoteForDamagedItem;
99      private boolean recordNoteForMissingPiece;
100     private String urlBase;
101     private String viewBillUrl;
102     private String createBillUrl;
103 
104     public String getPageSize() {
105         return pageSize;
106     }
107 
108     public void setPageSize(String pageSize) {
109         this.pageSize = pageSize;
110     }
111 
112     public String getPageNumber() {
113         return pageNumber;
114     }
115 
116     public void setPageNumber(String pageNumber) {
117         this.pageNumber = pageNumber;
118     }
119 
120     public String getLoggedInUser() {
121         return loggedInUser;
122     }
123 
124     public void setLoggedInUser(String loggedInUser) {
125         this.loggedInUser = loggedInUser;
126     }
127 
128     public String getSelectedCirculationDesk() {
129         return selectedCirculationDesk;
130     }
131 
132     public void setSelectedCirculationDesk(String selectedCirculationDesk) {
133         this.selectedCirculationDesk = selectedCirculationDesk;
134     }
135 
136     public String getPreviouslySelectedCirculationDesk() {
137         return previouslySelectedCirculationDesk;
138     }
139 
140     public void setPreviouslySelectedCirculationDesk(String previouslySelectedCirculationDesk) {
141         this.previouslySelectedCirculationDesk = previouslySelectedCirculationDesk;
142     }
143 
144     public void reset() {
145         this.itemBarcode = null;
146         this.itemRecord = null;
147         this.showExistingLoan = false;
148         this.proxyCheckDone = false;
149         this.itemValidationDone = false;
150         this.itemOverride = false;
151         if (null != getExistingLoanList()) {
152             this.getExistingLoanList().clear();
153         }
154         if (null != getLoanDocumentListForCurrentSession()) {
155             this.getLoanDocumentListForCurrentSession().clear();
156         }
157         this.patronDocument = new OlePatronDocument();
158         this.proceedWithCheckout = false;
159         this.claimsReturnNote = null;
160         this.damagedItemNote = null;
161         this.missingPieceNote = null;
162         this.missingPieceCount = null;
163         this.numberOfPiece=null;
164     }
165 
166     public void resetForAutoCheckout() {
167         this.itemRecord = null;
168         this.showExistingLoan = false;
169         this.proxyCheckDone = false;
170         this.itemValidationDone = false;
171         this.itemOverride = false;
172         if (null != getExistingLoanList()) {
173             this.getExistingLoanList().clear();
174         }
175         if (null != getLoanDocumentListForCurrentSession()) {
176             this.getLoanDocumentListForCurrentSession().clear();
177         }
178         this.patronDocument = new OlePatronDocument();
179         this.proceedWithCheckout = false;
180         this.claimsReturnNote = null;
181         this.damagedItemNote = null;
182         this.missingPieceNote = null;
183         this.missingPieceCount = null;
184         this.numberOfPiece=null;
185     }
186 
187     public void resetAll() {
188         this.previouslySelectedCirculationDesk = this.selectedCirculationDesk;
189         this.patronBarcode = null;
190         this.itemBarcode = null;
191         this.itemRecord = null;
192         this.showExistingLoan = false;
193         this.proxyCheckDone = false;
194         this.itemValidationDone = false;
195         this.itemOverride = false;
196         if (null != getExistingLoanList()) {
197             this.getExistingLoanList().clear();
198         }
199         if (null != getLoanDocumentListForCurrentSession()) {
200             this.getLoanDocumentListForCurrentSession().clear();
201         }
202         this.patronDocument = new OlePatronDocument();
203         this.proceedWithCheckout = false;
204         this.claimsReturnNote = null;
205         this.damagedItemNote = null;
206         this.missingPieceNote = null;
207         this.missingPieceCount = null;
208         this.numberOfPiece=null;
209     }
210 
211     public OlePatronDocument getPatronDocument() {
212         return patronDocument;
213     }
214 
215     public void setPatronDocument(OlePatronDocument patronDocument) {
216         this.patronDocument = patronDocument;
217         if (null != patronDocument) {
218             this.patronBarcode = patronDocument.getBarcode();
219         }
220     }
221 
222     public String getPatronBarcode() {
223         return patronBarcode;
224     }
225 
226     public void setPatronBarcode(String patronBarcode) {
227         this.patronBarcode = patronBarcode;
228     }
229 
230     public ErrorMessage getErrorMessage() {
231         return errorMessage;
232     }
233 
234     public void setErrorMessage(ErrorMessage errorMessage) {
235         this.errorMessage = errorMessage;
236     }
237 
238     public String getOverridingPrincipalName() {
239         return overridingPrincipalName;
240     }
241 
242     public void setOverridingPrincipalName(String overridingPrincipalName) {
243         this.overridingPrincipalName = overridingPrincipalName;
244     }
245 
246     public boolean isProceedWithCheckout() {
247         return proceedWithCheckout;
248     }
249 
250     public void setProceedWithCheckout(boolean proceedWithCheckout) {
251         this.proceedWithCheckout = proceedWithCheckout;
252     }
253 
254     public boolean isProxyCheckDone() {
255         return proxyCheckDone;
256     }
257 
258     public boolean isItemValidationDone() {
259         return itemValidationDone;
260     }
261 
262     public void setItemValidationDone(boolean itemValidationDone) {
263         this.itemValidationDone = itemValidationDone;
264     }
265 
266     public void setProxyCheckDone(boolean proxyCheckDone) {
267         this.proxyCheckDone = proxyCheckDone;
268     }
269 
270     public String getItemBarcode() {
271         return itemBarcode;
272     }
273 
274     public void setItemBarcode(String itemBarcode) {
275         this.itemBarcode = itemBarcode;
276     }
277 
278     public boolean isShowExistingLoan() {
279         return showExistingLoan;
280     }
281 
282     public void setShowExistingLoan(boolean showExistingLoan) {
283         this.showExistingLoan = showExistingLoan;
284     }
285 
286     public List<OleLoanDocument> getLoanDocumentListForCurrentSession() {
287         if (null == loanDocumentListForCurrentSession) {
288             loanDocumentListForCurrentSession = new ArrayList<>();
289         }
290         return loanDocumentListForCurrentSession;
291     }
292 
293     public void setLoanDocumentListForCurrentSession(List<OleLoanDocument> loanDocumentListForCurrentSession) {
294         this.loanDocumentListForCurrentSession = loanDocumentListForCurrentSession;
295     }
296 
297     public void setItemRecord(ItemRecord itemRecord) {
298         this.itemRecord = itemRecord;
299     }
300 
301     public ItemRecord getItemRecord() {
302         return itemRecord;
303     }
304 
305     public String getCustomDueDateTimeMessage() {
306         return customDueDateTimeMessage;
307     }
308 
309     public void setCustomDueDateTimeMessage(String customDueDateTimeMessage) {
310         this.customDueDateTimeMessage = customDueDateTimeMessage;
311     }
312 
313     public Date getCustomDueDateMap() {
314         return customDueDateMap;
315     }
316 
317     public void setCustomDueDateMap(Date customDueDateMap) {
318         this.customDueDateMap = customDueDateMap;
319     }
320 
321     public String getCustomDueDateTime() {
322         return customDueDateTime;
323     }
324 
325     public void setCustomDueDateTime(String customDueDateTime) {
326         this.customDueDateTime = customDueDateTime;
327     }
328 
329     public void setExistingLoanList(List<OleLoanDocument> existingLoanList) {
330         this.existingLoanList = existingLoanList;
331     }
332 
333     public List<OleLoanDocument> getExistingLoanList() {
334         return existingLoanList;
335     }
336 
337     public OleLoanFastAdd getOleLoanFastAdd() {
338         return oleLoanFastAdd;
339     }
340 
341     public void setOleLoanFastAdd(OleLoanFastAdd oleLoanFastAdd) {
342         this.oleLoanFastAdd = oleLoanFastAdd;
343     }
344 
345     public boolean isItemOverride() {
346         return itemOverride;
347     }
348 
349     public void setItemOverride(boolean itemOverride) {
350         this.itemOverride = itemOverride;
351     }
352 
353     public boolean isAutoCheckout() {
354         return autoCheckout;
355     }
356 
357     public void setAutoCheckout(boolean autoCheckout) {
358         this.autoCheckout = autoCheckout;
359     }
360 
361     public String getClaimsReturnNote() {
362         return claimsReturnNote;
363     }
364 
365     public void setClaimsReturnNote(String claimsReturnNote) {
366         this.claimsReturnNote = claimsReturnNote;
367     }
368 
369     public List<OleLoanDocument> getLoanDocumentsForAlterDueDate() {
370         return loanDocumentsForAlterDueDate;
371     }
372 
373     public void setLoanDocumentsForAlterDueDate(List<OleLoanDocument> loanDocumentsForAlterDueDate) {
374         this.loanDocumentsForAlterDueDate = loanDocumentsForAlterDueDate;
375     }
376 
377     public String getDamagedItemNote() {
378         return damagedItemNote;
379     }
380 
381     public void setDamagedItemNote(String damagedItemNote) {
382         this.damagedItemNote = damagedItemNote;
383     }
384 
385     public String getMissingPieceNote() {
386         return missingPieceNote;
387     }
388 
389     public void setMissingPieceNote(String missingPieceNote) {
390         this.missingPieceNote = missingPieceNote;
391     }
392 
393     public String getNumberOfPiece() {
394         return numberOfPiece;
395     }
396 
397     public void setNumberOfPiece(String numberOfPiece) {
398         this.numberOfPiece = numberOfPiece;
399     }
400 
401     public String getMissingPieceCount() {
402         return missingPieceCount;
403     }
404 
405     public void setMissingPieceCount(String missingPieceCount) {
406         this.missingPieceCount = missingPieceCount;
407     }
408 
409     public List<OleLoanDocument> getLoanDocumentsForRenew() {
410         return loanDocumentsForRenew;
411     }
412 
413     public void setLoanDocumentsForRenew(List<OleLoanDocument> loanDocumentsForRenew) {
414         this.loanDocumentsForRenew = loanDocumentsForRenew;
415     }
416 
417     public Date getCustomDueDateMapForRenew() {
418         return customDueDateMapForRenew;
419     }
420 
421     public void setCustomDueDateMapForRenew(Date customDueDateMapForRenew) {
422         this.customDueDateMapForRenew = customDueDateMapForRenew;
423     }
424 
425     public String getCustomDueDateTimeForRenew() {
426         return customDueDateTimeForRenew;
427     }
428 
429     public void setCustomDueDateTimeForRenew(String customDueDateTimeForRenew) {
430         this.customDueDateTimeForRenew = customDueDateTimeForRenew;
431     }
432 
433     public String getCustomDueDateTimeMessageForRenew() {
434         return customDueDateTimeMessageForRenew;
435     }
436 
437     public void setCustomDueDateTimeMessageForRenew(String customDueDateTimeMessageForRenew) {
438         this.customDueDateTimeMessageForRenew = customDueDateTimeMessageForRenew;
439     }
440 
441     public boolean isClaimsReturnFlag() {
442         return claimsReturnFlag;
443     }
444 
445     public void setClaimsReturnFlag(boolean claimsReturnFlag) {
446         this.claimsReturnFlag = claimsReturnFlag;
447     }
448 
449     public boolean isMissingPieceFlag() {
450         return missingPieceFlag;
451     }
452 
453     public void setMissingPieceFlag(boolean missingPieceFlag) {
454         this.missingPieceFlag = missingPieceFlag;
455     }
456 
457     public boolean isDamagedItemFlag() {
458         return damagedItemFlag;
459     }
460 
461     public void setDamagedItemFlag(boolean damagedItemFlag) {
462         this.damagedItemFlag = damagedItemFlag;
463     }
464 
465     public boolean isRecordNoteForClaimsReturn() {
466         return recordNoteForClaimsReturn;
467     }
468 
469     public void setRecordNoteForClaimsReturn(boolean recordNoteForClaimsReturn) {
470         this.recordNoteForClaimsReturn = recordNoteForClaimsReturn;
471     }
472 
473     public boolean isRecordNoteForDamagedItem() {
474         return recordNoteForDamagedItem;
475     }
476 
477     public void setRecordNoteForDamagedItem(boolean recordNoteForDamagedItem) {
478         this.recordNoteForDamagedItem = recordNoteForDamagedItem;
479     }
480 
481     public boolean isRecordNoteForMissingPiece() {
482         return recordNoteForMissingPiece;
483     }
484 
485     public void setRecordNoteForMissingPiece(boolean recordNoteForMissingPiece) {
486         this.recordNoteForMissingPiece = recordNoteForMissingPiece;
487     }
488 
489     public boolean isRequestExistOrLoanedCheck() {
490         return requestExistOrLoanedCheck;
491     }
492 
493     public void setRequestExistOrLoanedCheck(boolean requestExistOrLoanedCheck) {
494         this.requestExistOrLoanedCheck = requestExistOrLoanedCheck;
495     }
496 
497     public String getMaxSessionTime() {
498         return maxSessionTime;
499     }
500 
501     public void setMaxSessionTime(String maxSessionTime) {
502         this.maxSessionTime = maxSessionTime;
503     }
504 
505     public String getUrlBase() {
506         return urlBase;
507     }
508 
509     public void setUrlBase(String urlBase) {
510         this.urlBase = urlBase;
511     }
512 
513     public String getViewBillUrl() {
514         return viewBillUrl;
515     }
516 
517     public void setViewBillUrl(String viewBillUrl) {
518         this.viewBillUrl = viewBillUrl;
519     }
520 
521     public String getCreateBillUrl() {
522         return createBillUrl;
523     }
524 
525     public void setCreateBillUrl(String createBillUrl) {
526         this.createBillUrl = createBillUrl;
527     }
528 }