001package org.kuali.ole.deliver.bo;
002
003import org.apache.commons.lang.StringUtils;
004import org.kuali.ole.deliver.calendar.bo.OleCalendarGroup;
005import org.kuali.rice.krad.bo.PersistableBusinessObject;
006import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
007
008import java.util.ArrayList;
009import java.util.Collection;
010import java.util.List;
011
012/**
013 * OleCirculationDesk is business object class for Circulation Desk Maintenance Document
014 */
015public class OleCirculationDesk extends PersistableBusinessObjectBase {
016
017    private String circulationDeskId;
018    private String circulationDeskCode;
019    private String circulationDeskPublicName;
020    private String circulationDeskStaffName;
021    private boolean pickUpLocation;
022    private boolean asrPickupLocation;
023    private boolean active;
024    private String onHoldDays;
025    private String requestExpirationDays;
026    private String shelvingLagTime;
027    private List<OleCirculationDeskLocation> oleCirculationDeskLocations = new ArrayList<OleCirculationDeskLocation>();
028    private List<OleCirculationDeskLocation> oleCirculationDeskLocationList = new ArrayList<OleCirculationDeskLocation>();
029    private List<OleCirculationDeskLocation> olePickupCirculationDeskLocations = new ArrayList<OleCirculationDeskLocation>();
030    private List<OleCirculationDeskLocation> deleteoleCirculationDeskLocations = new ArrayList<OleCirculationDeskLocation>();
031    private List<OleCirculationDeskLocation> deleteOlePickupCirculationDeskLocations = new ArrayList<OleCirculationDeskLocation>();
032    private String locationId;
033    private boolean printSlip;
034    private String errorMessage;
035    private OleCalendarGroup oleCalendarGroup;
036    private String calendarGroupId;
037    private String holdFormat;
038    private boolean holdQueue;
039    private boolean staffed;
040    private String replyToEmail;
041    private boolean renewLostItem;
042    private String showItemOnHold;
043    private String defaultRequestTypeId;
044    private String defaultRequestTypeCode;
045    private OleDeliverRequestType defaultRequestType;
046    private String defaultPickupLocationId;
047    private String defaultPickupLocationCode;
048    private OleCirculationDesk defaultPickupLocation;
049
050    public String getErrorMessage() {
051        return errorMessage;
052    }
053
054    public void setErrorMessage(String errorMessage) {
055        this.errorMessage = errorMessage;
056    }
057
058    public boolean isPrintSlip() {
059        return printSlip;
060    }
061
062    public void setPrintSlip(boolean printSlip) {
063        this.printSlip = printSlip;
064    }
065
066    public String getLocationId() {
067        return locationId;
068    }
069
070    public void setLocationId(String locationId) {
071        this.locationId = locationId;
072    }
073
074    /**
075     * Gets the circulationDeskId attribute.
076     *
077     * @return Returns the circulationDeskId
078     */
079    public String getCirculationDeskId() {
080        return circulationDeskId;
081    }
082
083    /**
084     * Sets the circulationDeskId attribute value.
085     *
086     * @param circulationDeskId The accessMethodId to set.
087     */
088    public void setCirculationDeskId(String circulationDeskId) {
089        this.circulationDeskId = circulationDeskId;
090    }
091
092    /**
093     * Gets the circulationDeskCode attribute.
094     *
095     * @return Returns the circulationDeskCode
096     */
097    public String getCirculationDeskCode() {
098        return circulationDeskCode;
099    }
100
101    /**
102     * Sets the circulationDeskCode attribute value.
103     *
104     * @param circulationDeskCode The circulationDeskCode to set.
105     */
106    public void setCirculationDeskCode(String circulationDeskCode) {
107        this.circulationDeskCode = circulationDeskCode;
108    }
109
110    /**
111     * Gets the circulationDeskPublicName attribute.
112     *
113     * @return Returns the circulationDeskPublicName
114     */
115    public String getCirculationDeskPublicName() {
116        return circulationDeskPublicName;
117    }
118
119    /**
120     * Sets the circulationDeskPublicName attribute value.
121     *
122     * @param circulationDeskPublicName The circulationDeskPublicName to set.
123     */
124    public void setCirculationDeskPublicName(String circulationDeskPublicName) {
125        this.circulationDeskPublicName = circulationDeskPublicName;
126    }
127
128    /**
129     * Gets the circulationDeskStaffName attribute.
130     *
131     * @return Returns the circulationDeskStaffName
132     */
133    public String getCirculationDeskStaffName() {
134        return circulationDeskStaffName;
135    }
136
137    /**
138     * Sets the circulationDeskStaffName attribute value.
139     *
140     * @param circulationDeskStaffName The circulationDeskStaffName to set.
141     */
142    public void setCirculationDeskStaffName(String circulationDeskStaffName) {
143        this.circulationDeskStaffName = circulationDeskStaffName;
144    }
145
146    /**
147     * Gets the active attribute.
148     *
149     * @return Returns the active
150     */
151    public boolean isActive() {
152        return active;
153    }
154
155    /**
156     * Sets the active attribute value.
157     *
158     * @param active The active to set.
159     */
160    public void setActive(boolean active) {
161        this.active = active;
162    }
163
164    /**
165     * Gets the locationId attribute.
166     *
167     * @return Returns the locationId
168     */
169
170    public boolean isPickUpLocation() {
171        return pickUpLocation;
172    }
173
174    public void setPickUpLocation(boolean pickUpLocation) {
175        this.pickUpLocation = pickUpLocation;
176    }
177
178    public String getOnHoldDays() {
179        if(onHoldDays!=null && onHoldDays.equalsIgnoreCase("")){
180            return null;
181        }else{
182            return onHoldDays;
183        }
184    }
185
186    public void setOnHoldDays(String onHoldDays) {
187        this.onHoldDays = onHoldDays;
188    }
189
190    public List<OleCirculationDeskLocation> getOleCirculationDeskLocations() {
191        return oleCirculationDeskLocations;
192    }
193
194    public void setOleCirculationDeskLocations(List<OleCirculationDeskLocation> oleCirculationDeskLocations) {
195        this.oleCirculationDeskLocations = oleCirculationDeskLocations;
196    }
197
198    public String getShelvingLagTime() {
199        return shelvingLagTime;
200    }
201
202    public int getShelvingLagTimeInt() {
203        return Integer.valueOf(shelvingLagTime);
204    }
205
206    public void setShelvingLagTime(String shelvingLagTime) {
207        this.shelvingLagTime = shelvingLagTime;
208    }
209
210    public OleCalendarGroup getOleCalendarGroup() {
211        return oleCalendarGroup;
212    }
213
214    public void setOleCalendarGroup(OleCalendarGroup oleCalendarGroup) {
215        this.oleCalendarGroup = oleCalendarGroup;
216    }
217
218    public String getCalendarGroupId() {
219        return calendarGroupId;
220    }
221
222    public void setCalendarGroupId(String calendarGroupId) {
223        this.calendarGroupId = calendarGroupId;
224    }
225
226    public List<OleCirculationDeskLocation> getDeleteoleCirculationDeskLocations() {
227        return deleteoleCirculationDeskLocations;
228    }
229
230    public void setDeleteoleCirculationDeskLocations(List<OleCirculationDeskLocation> deleteoleCirculationDeskLocations) {
231        this.deleteoleCirculationDeskLocations = deleteoleCirculationDeskLocations;
232    }
233
234    public boolean isAsrPickupLocation() {
235        return asrPickupLocation;
236    }
237
238    public void setAsrPickupLocation(boolean asrPickupLocation) {
239        this.asrPickupLocation = asrPickupLocation;
240    }
241
242    public String getHoldFormat() {
243        return holdFormat;
244    }
245
246    public void setHoldFormat(String holdFormat) {
247        this.holdFormat = holdFormat;
248    }
249
250    public boolean isHoldQueue() {
251        return holdQueue;
252    }
253
254    public void setHoldQueue(boolean holdQueue) {
255        this.holdQueue = holdQueue;
256    }
257
258    public String getReplyToEmail() {
259        return replyToEmail;
260    }
261
262    public void setReplyToEmail(String replyToEmail) {
263        this.replyToEmail = replyToEmail;
264    }
265
266    public List<OleCirculationDeskLocation> getOlePickupCirculationDeskLocations() {
267        return olePickupCirculationDeskLocations;
268    }
269
270    public void setOlePickupCirculationDeskLocations(List<OleCirculationDeskLocation> olePickupCirculationDeskLocations) {
271        this.olePickupCirculationDeskLocations = olePickupCirculationDeskLocations;
272    }
273
274    public List<OleCirculationDeskLocation> getDeleteOlePickupCirculationDeskLocations() {
275        return deleteOlePickupCirculationDeskLocations;
276    }
277
278    public void setDeleteOlePickupCirculationDeskLocations(List<OleCirculationDeskLocation> deleteOlePickupCirculationDeskLocations) {
279        this.deleteOlePickupCirculationDeskLocations = deleteOlePickupCirculationDeskLocations;
280    }
281
282    public List<OleCirculationDeskLocation> getOleCirculationDeskLocationList() {
283        return oleCirculationDeskLocationList;
284    }
285
286    public void setOleCirculationDeskLocationList(List<OleCirculationDeskLocation> oleCirculationDeskLocationList) {
287        this.oleCirculationDeskLocationList = oleCirculationDeskLocationList;
288    }
289
290    @Override
291    public List<Collection<PersistableBusinessObject>> buildListOfDeletionAwareLists() {
292        List<Collection<PersistableBusinessObject>> collectionList = new ArrayList<>();
293        collectionList.add((Collection)getOleCirculationDeskLocations());
294        collectionList.add((Collection)getDeleteOlePickupCirculationDeskLocations());
295        return collectionList;
296    }
297
298    public String getRequestExpirationDays() {
299        return StringUtils.isBlank(requestExpirationDays)?"0":requestExpirationDays;
300    }
301
302    public void setRequestExpirationDays(String requestExpirationDays) {
303        this.requestExpirationDays = requestExpirationDays;
304    }   
305
306    public boolean isStaffed() {
307        return staffed;
308    }
309
310    public void setStaffed(boolean staffed) {
311        this.staffed = staffed;
312    }
313
314    public boolean isRenewLostItem() {
315        return renewLostItem;
316    }
317
318    public void setRenewLostItem(boolean renewLostItem) {
319        this.renewLostItem = renewLostItem;
320    }
321
322    public String getShowItemOnHold() {
323        return showItemOnHold;
324    }
325
326    public void setShowItemOnHold(String showItemOnHold) {
327        this.showItemOnHold = showItemOnHold;
328    }
329
330    public String getDefaultRequestTypeId() {
331        return defaultRequestTypeId;
332    }
333
334    public void setDefaultRequestTypeId(String defaultRequestTypeId) {
335        this.defaultRequestTypeId = defaultRequestTypeId;
336    }
337
338    public String getDefaultRequestTypeCode() {
339        if(defaultRequestType!=null && defaultRequestType.getRequestTypeCode()!=null){
340            defaultRequestTypeCode = defaultRequestType.getRequestTypeCode();
341        }
342        return defaultRequestTypeCode;
343    }
344
345    public void setDefaultRequestTypeCode(String defaultRequestTypeCode) {
346        this.defaultRequestTypeCode = defaultRequestTypeCode;
347    }
348
349    public OleDeliverRequestType getDefaultRequestType() {
350        return defaultRequestType;
351    }
352
353    public void setDefaultRequestType(OleDeliverRequestType defaultRequestType) {
354        this.defaultRequestType = defaultRequestType;
355    }
356
357    public String getDefaultPickupLocationId() {
358        return defaultPickupLocationId;
359    }
360
361    public void setDefaultPickupLocationId(String defaultPickupLocationId) {
362        this.defaultPickupLocationId = defaultPickupLocationId;
363    }
364
365    public String getDefaultPickupLocationCode() {
366        if (defaultPickupLocation != null && defaultPickupLocation.getCirculationDeskCode() != null) {
367            defaultPickupLocationCode = defaultPickupLocation.getCirculationDeskCode();
368        }
369        return defaultPickupLocationCode;
370    }
371
372    public void setDefaultPickupLocationCode(String defaultPickupLocationCode) {
373        this.defaultPickupLocationCode = defaultPickupLocationCode;
374    }
375
376    public OleCirculationDesk getDefaultPickupLocation() {
377        return defaultPickupLocation;
378    }
379
380    public void setDefaultPickupLocation(OleCirculationDesk defaultPickupLocation) {
381        this.defaultPickupLocation = defaultPickupLocation;
382    }
383}