1 package org.kuali.ole.deliver.controller.checkin;
2
3 import org.kuali.ole.deliver.bo.OleLoanDocument;
4 import org.kuali.ole.deliver.controller.checkin.CheckinBaseController;
5 import org.kuali.ole.deliver.drools.CheckedInItem;
6 import org.kuali.ole.deliver.drools.DroolsExchange;
7 import org.kuali.ole.deliver.form.CheckinForm;
8 import org.kuali.ole.deliver.form.OLEForm;
9 import org.kuali.ole.docstore.engine.service.storage.rdbms.pojo.ItemRecord;
10
11 import java.util.Date;
12
13
14
15
16 public class CheckInAPIController extends CheckinBaseController {
17
18 @Override
19 protected void setDataElements(OLEForm oleForm, ItemRecord itemRecord, OleLoanDocument loanDocument) {
20 DroolsExchange droolsExchange = oleForm.getDroolsExchange();
21 droolsExchange.addToContext("itemRecord", itemRecord);
22 droolsExchange.addToContext("oleLoanDocument", loanDocument);
23 if (loanDocument != null) {
24 droolsExchange.addToContext("olePatronDocument", loanDocument.getOlePatron());
25 }
26 }
27
28 @Override
29 public CheckinForm getCheckinForm(OLEForm oleForm) {
30 return null;
31 }
32
33 @Override
34 public String getItemBarcode(OLEForm oleForm) {
35 return (String) oleForm.getDroolsExchange().getContext().get("itemBarcode");
36 }
37
38 @Override
39 public String getSelectedCirculationDesk(OLEForm oleForm) {
40 return (String) oleForm.getDroolsExchange().getContext().get("selectedCirculationDesk");
41 }
42
43 @Override
44 public Date getCustomDueDateMap(OLEForm oleForm) {
45 return new Date();
46 }
47
48 @Override
49 public String getCustomDueDateTime(OLEForm oleForm) {
50 return null;
51 }
52
53 @Override
54 public void setCheckedInItem(CheckedInItem checkedInItem, OLEForm oleForm) {
55
56 }
57
58 @Override
59 public CheckedInItem getCheckedInItem(OLEForm oleForm) {
60 CheckedInItem checkedInItem = (CheckedInItem) oleForm.getDroolsExchange().getFromContext("checkedInItem");
61 if (null == checkedInItem) {
62 return new CheckedInItem();
63 }
64 return checkedInItem;
65 }
66
67 @Override
68 public void addCheckedInItemToCheckedInItemList(CheckedInItem checkedInItem, OLEForm oleForm) {
69 oleForm.getDroolsExchange().addToContext("checkedInItem", checkedInItem);
70 }
71
72 @Override
73 public boolean isRecordNoteForDamagedItem(OLEForm oleForm) {
74 return false;
75 }
76
77 @Override
78 public boolean isRecordNoteForClaimsReturn(OLEForm oleForm) {
79 return false;
80 }
81
82 @Override
83 public boolean isRecordNoteForMissingPiece(OLEForm oleForm) {
84 return false;
85 }
86
87 @Override
88 public String getMissingPieceMatchCheck(OLEForm oleForm) {
89 return null;
90 }
91
92 @Override
93 public void setNoOfPieces(OLEForm oleForm, String numberOfPieces) {
94
95 }
96
97 @Override
98 public OleLoanDocument getOleLoanDocument(OLEForm oleForm) {
99 return (OleLoanDocument) oleForm.getDroolsExchange().getFromContext("oleLoanDocument");
100 }
101
102 @Override
103 public DroolsExchange getDroolsExchange(OLEForm oleForm) {
104 return oleForm.getDroolsExchange();
105 }
106
107 @Override
108 public String getOperatorId(OLEForm oleForm) {
109 return (String) oleForm.getDroolsExchange().getContext().get("operatorId");
110 }
111 }