View Javadoc
1   package org.kuali.ole.deliver.bo;
2   
3   import org.apache.commons.collections.CollectionUtils;
4   import org.apache.commons.lang3.StringUtils;
5   import org.kuali.ole.deliver.OleLoanDocumentsFromSolrBuilder;
6   import org.kuali.ole.deliver.api.*;
7   import org.kuali.ole.deliver.processor.LoanProcessor;
8   import org.kuali.ole.sys.context.SpringContext;
9   import org.kuali.rice.kim.api.KimConstants;
10  import org.kuali.rice.kim.api.identity.IdentityService;
11  import org.kuali.rice.kim.api.identity.address.EntityAddress;
12  import org.kuali.rice.kim.api.identity.email.EntityEmail;
13  import org.kuali.rice.kim.api.identity.employment.EntityEmployment;
14  import org.kuali.rice.kim.api.identity.phone.EntityPhone;
15  import org.kuali.rice.kim.api.services.KimApiServiceLocator;
16  import org.kuali.rice.kim.impl.identity.address.EntityAddressBo;
17  import org.kuali.rice.kim.impl.identity.affiliation.EntityAffiliationBo;
18  import org.kuali.rice.kim.impl.identity.affiliation.EntityAffiliationTypeBo;
19  import org.kuali.rice.kim.impl.identity.email.EntityEmailBo;
20  import org.kuali.rice.kim.impl.identity.employment.EntityEmploymentBo;
21  import org.kuali.rice.kim.impl.identity.entity.EntityBo;
22  import org.kuali.rice.kim.impl.identity.name.EntityNameBo;
23  import org.kuali.rice.kim.impl.identity.phone.EntityPhoneBo;
24  import org.kuali.rice.kim.impl.identity.type.EntityTypeContactInfoBo;
25  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
26  import org.kuali.rice.krad.service.KRADServiceLocator;
27  
28  import java.util.*;
29  
30  /**
31   * OlePatronDocument provides OlePatronDocument information through getter and setter.
32   */
33  public class OlePatronDocument extends PersistableBusinessObjectBase implements OlePatronContract {
34  
35      private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OlePatronDocument.class);
36  
37      private String olePatronId;
38      private String barcode;
39      private String borrowerType;
40      private String affiliationType;
41      private boolean activeIndicator;
42      private boolean generalBlock;
43      private String generalBlockNotes;
44      private boolean pagingPrivilege;
45      private boolean courtesyNotice;
46      private boolean deliveryPrivilege;
47      private boolean realPatronCheck;
48      private boolean selfCheckOut = false;
49      private Date expirationDate;
50      private Date activationDate;
51      private String firstName;
52      private String middleName;
53      private String lastName;
54      private String emailAddress;
55      private String phoneNumber;
56      private String borrowerTypeName;
57      private String processMessage;
58      private String source;
59      private String statisticalCategory;
60      private String oleSourceName;
61      private String oleStatisticalCategoryName;
62      private boolean patronBillFlag;
63      private String proxyPatronId;
64      private byte[] patronPhotograph;
65      private boolean loanFlag;
66      private boolean tempCircHistoryFlag;
67      private boolean requestFlag;
68      private boolean upload = true;
69      private boolean patronHomePage;
70      private boolean pointing;
71      private boolean startingIndexExecuted;
72      private boolean activateBarcode;
73      private boolean deactivateBarcode;
74      private String lostStatus;
75      private String lostDescription;
76      private boolean invalidateBarcode;
77      private boolean reinstateBarcode;
78      private boolean skipBarcodeValidation;
79      private boolean barcodeChanged;
80      private boolean barcodeEditable;
81      private boolean expirationFlag=true;
82      private boolean popupDialog;
83      private String patronMessage;
84      private String uiMessageType;
85      private boolean reinstated;
86      private int numberOfClaimsReturned;
87      private boolean showLoanedRecords;
88      private boolean showRequestedItems;
89      private boolean showTemporaryCirculationHistoryRecords;
90  
91      private HashMap<String,String> errorsAndPermission = new HashMap<>();
92      private String errorMessage;
93      private boolean blockPatron;
94      private String realPatronFirstName;
95  
96      private String realPatronLastName;
97      private int loanCount;
98      private int requestedItemRecordsCount;
99      private int tempCirculationHistoryCount;
100 
101     private transient IdentityService identityService;
102     private boolean deleteImageFlag;
103     public IdentityService getIdentityService() {
104         if (identityService == null) {
105             identityService = KimApiServiceLocator.getIdentityService();
106         }
107         return identityService;
108     }
109 
110     public boolean isPatronHomePage() {
111         return patronHomePage;
112     }
113 
114     public boolean isExpirationFlag() {
115         return expirationFlag;
116     }
117 
118     public void setExpirationFlag(boolean expirationFlag) {
119         this.expirationFlag = expirationFlag;
120     }
121 
122     public void setPatronHomePage(boolean patronHomePage) {
123         this.patronHomePage = patronHomePage;
124     }
125 
126     private List<OleLoanDocument> oleLoanDocuments = new ArrayList<OleLoanDocument>();
127     private List<EntityPhoneBo> phones = new ArrayList<EntityPhoneBo>();
128     private List<EntityPhoneBo> deletedPhones = new ArrayList<EntityPhoneBo>();
129     private List<EntityAddressBo> addresses = new ArrayList<EntityAddressBo>();
130     private List<OleEntityAddressBo> oleEntityAddressBo = new ArrayList<OleEntityAddressBo>();
131     private List<OleEntityAddressBo> deletedOleEntityAddressBo = new ArrayList<OleEntityAddressBo>();
132     private EntityNameBo name = new EntityNameBo();
133     private List<OleAddressBo> oleAddresses = new ArrayList<OleAddressBo>();
134     private List<EntityEmailBo> emails = new ArrayList<EntityEmailBo>();
135     private List<EntityEmailBo> deletedEmails = new ArrayList<EntityEmailBo>();
136     private List<OlePatronNotes> notes = new ArrayList<OlePatronNotes>();
137     private List<OlePatronNotes> deletedNotes = new ArrayList<OlePatronNotes>();
138     private List<OlePatronLostBarcode> lostBarcodes = new ArrayList<OlePatronLostBarcode>();
139     private OleBorrowerType oleBorrowerType;
140     private EntityBo entity = new EntityBo();
141     private OleSourceBo sourceBo;
142     private OleStatisticalCategoryBo statisticalCategoryBo;
143     private List<OlePatronAffiliation> patronAffiliations = new ArrayList<OlePatronAffiliation>();
144     private List<OlePatronAffiliation> deletedPatronAffiliations = new ArrayList<OlePatronAffiliation>();
145     private List<EntityEmploymentBo> employments = new ArrayList<EntityEmploymentBo>();
146     private List<EntityEmploymentBo> deletedEmployments = new ArrayList<EntityEmploymentBo>();
147     private List<OleDeliverRequestBo> oleDeliverRequestBos = new ArrayList<OleDeliverRequestBo>();
148     private List<OleProxyPatronDocument> oleProxyPatronDocuments = new ArrayList<OleProxyPatronDocument>();
149     private List<OleProxyPatronDocument> deletedOleProxyPatronDocuments = new ArrayList<OleProxyPatronDocument>();
150     private List<OleTemporaryCirculationHistory> oleTemporaryCirculationHistoryRecords = new ArrayList<OleTemporaryCirculationHistory>();
151     private List<OlePatronLocalIdentificationBo> olePatronLocalIds = new ArrayList<OlePatronLocalIdentificationBo>();
152     private List<OlePatronLocalIdentificationBo> deletedOlePatronLocalIds = new ArrayList<OlePatronLocalIdentificationBo>();
153     private List<OleProxyPatronDocument> oleProxyPatronDocumentList = new ArrayList<OleProxyPatronDocument>();
154     private List<PatronBillPayment> patronBillPayments = new ArrayList<>();
155     private OLEPatronEntityViewBo olePatronEntityViewBo;
156     private String patronBillFileName;
157     private String viewBillUrl;
158     private String createBillUrl;
159     private String namePrefix;
160     private String nameSuffix;
161 
162     public HashMap<String, String> getErrorsAndPermission() {
163         return errorsAndPermission;
164     }
165 
166     public void setErrorsAndPermission(HashMap<String, String> errorsAndPermission) {
167         this.errorsAndPermission = errorsAndPermission;
168     }
169 
170     public String getErrorMessage() {
171         return errorMessage;
172     }
173 
174     public void setErrorMessage(String errorMessage) {
175         this.errorMessage = errorMessage;
176     }
177 
178     public boolean isBlockPatron() {
179         return blockPatron;
180     }
181 
182     public void setBlockPatron(boolean blockPatron) {
183         this.blockPatron = blockPatron;
184     }
185 
186     public void setBorrowerTypeName(String borrowerTypeName) {
187         this.borrowerTypeName = borrowerTypeName;
188     }
189 
190     private String patronName;
191 
192     private String borrowerTypeCode;
193 
194     public List<PatronBillPayment> getPatronBillPayments() {
195         if (CollectionUtils.isEmpty(patronBillPayments)) {
196             if (StringUtils.isNotEmpty(getOlePatronId())) {
197                 if (StringUtils.isNotEmpty(getOlePatronId())) {
198                     Map<String, String> parameterMap = new HashMap<>();
199                     parameterMap.put("patronId", getOlePatronId());
200                     List<PatronBillPayment> olePatronBillPaymentList = (List<PatronBillPayment>) KRADServiceLocator.getBusinessObjectService().findMatching(PatronBillPayment.class, parameterMap);
201                     if (CollectionUtils.isNotEmpty(olePatronBillPaymentList)) {
202                         patronBillPayments = olePatronBillPaymentList;
203                     }
204                 }
205             }
206         }
207         return patronBillPayments;
208     }
209 
210     public void setPatronBillPayments(List<PatronBillPayment> patronBillPayments) {
211         this.patronBillPayments = patronBillPayments;
212     }
213 
214     public int getNumberOfClaimsReturned() {
215         return numberOfClaimsReturned;
216     }
217 
218     public void setNumberOfClaimsReturned(int numberOfClaimsReturned) {
219         this.numberOfClaimsReturned = numberOfClaimsReturned;
220     }
221 
222     public String getBorrowerTypeCode() {
223         if (oleBorrowerType != null) {
224             return oleBorrowerType.getBorrowerTypeCode();
225         }
226         return borrowerTypeCode;
227     }
228 
229     public void setBorrowerTypeCode(String borrowerTypeCode) {
230         this.borrowerTypeCode = borrowerTypeCode;
231     }
232 
233     public boolean isSelfCheckOut() {
234         return selfCheckOut;
235     }
236 
237     public void setSelfCheckOut(boolean selfCheckOut) {
238         this.selfCheckOut = selfCheckOut;
239     }
240 
241     public String getPatronName() {
242         return patronName;
243     }
244 
245     public void setPatronName(String patronName) {
246         this.patronName = patronName;
247     }
248 
249     public OlePatronDocument() {
250         this.setActivationDate(new Date());
251         this.setDeliveryPrivilege(true);
252         this.setPagingPrivilege(true);
253         this.setCourtesyNotice(true);
254         this.setBarcodeEditable(true);
255     }
256 
257     public boolean isUpload() {
258         return upload;
259     }
260 
261     public void setUpload(boolean upload) {
262         this.upload = upload;
263     }
264 
265     public List<OleTemporaryCirculationHistory> getOleTemporaryCirculationHistoryRecords() {
266         if (CollectionUtils.isEmpty(oleTemporaryCirculationHistoryRecords)) {
267             try {
268                 oleTemporaryCirculationHistoryRecords = new OleLoanDocumentsFromSolrBuilder()
269                         .getPatronTemporaryCirculationHistoryRecords(getOlePatronId());
270             } catch (Exception e) {
271                 oleTemporaryCirculationHistoryRecords = new ArrayList<>();
272 
273                 LOG.error(e.getStackTrace());
274             }
275         }
276         return oleTemporaryCirculationHistoryRecords;
277     }
278 
279     //TODO: refactor this to be getOleTemporaryCirculationHistoryRecords and populate the solr info at the same time
280     //TODO: eliminating the need for 2 methods.
281     public List<OleTemporaryCirculationHistory> getOleTemporaryCirculationHistoryRecordsFromDB() {
282         if (CollectionUtils.isEmpty(oleTemporaryCirculationHistoryRecords)) {
283             if (StringUtils.isNotEmpty(getOlePatronId())) {
284                 if (StringUtils.isNotEmpty(getOlePatronId())) {
285                     Map<String, String> parameterMap = new HashMap<>();
286                     parameterMap.put("olePatronId", getOlePatronId());
287                     List<OleTemporaryCirculationHistory> oleTemporaryCirculationHistoryList = (List<OleTemporaryCirculationHistory>) KRADServiceLocator.getBusinessObjectService().findMatching(OleTemporaryCirculationHistory.class, parameterMap);
288                     if (CollectionUtils.isNotEmpty(oleTemporaryCirculationHistoryList)) {
289                         oleTemporaryCirculationHistoryRecords = oleTemporaryCirculationHistoryList;
290                     }
291                 }
292             }
293 
294         }
295         return oleTemporaryCirculationHistoryRecords;
296     }
297 
298     public void setOleTemporaryCirculationHistoryRecords(List<OleTemporaryCirculationHistory> oleTemporaryCirculationHistoryRecords) {
299         this.oleTemporaryCirculationHistoryRecords = oleTemporaryCirculationHistoryRecords;
300     }
301 
302     public List<OleDeliverRequestBo> getOleDeliverRequestBos() {
303         if (CollectionUtils.isEmpty(oleDeliverRequestBos)) {
304             if (StringUtils.isNotEmpty(getOlePatronId())) {
305                 if (StringUtils.isNotEmpty(getOlePatronId())) {
306                     Map<String, String> parameterMap = new HashMap<>();
307                     parameterMap.put("borrowerId", getOlePatronId());
308                     List<OleDeliverRequestBo> oleDeliverRequestBoList = (List<OleDeliverRequestBo>) KRADServiceLocator.getBusinessObjectService().findMatching(OleDeliverRequestBo.class, parameterMap);
309                     if (CollectionUtils.isNotEmpty(oleDeliverRequestBoList)) {
310                         oleDeliverRequestBos = oleDeliverRequestBoList;
311                     }
312                 }
313             }
314         }
315         return oleDeliverRequestBos;
316     }
317 
318     public void setOleDeliverRequestBos(List<OleDeliverRequestBo> oleDeliverRequestBos) {
319         this.oleDeliverRequestBos = oleDeliverRequestBos;
320     }
321 
322     /**
323      * This method converts the PersistableBusinessObjectBase OlePatronDocument into immutable object OlePatronDefinition
324      *
325      * @param bo
326      * @return OlePatronDefinition
327      */
328     public static OlePatronDefinition to(org.kuali.ole.deliver.bo.OlePatronDocument bo) {
329         if (bo == null) {
330             return null;
331         }
332         return OlePatronDefinition.Builder.create(bo).build();
333     }
334 
335     /**
336      * This method converts the immutable object OlePatronDefinition into PersistableBusinessObjectBase OlePatronDocument
337      *
338      * @param immutable
339      * @return OlePatronDocument
340      */
341     public static org.kuali.ole.deliver.bo.OlePatronDocument from(OlePatronDefinition immutable) {
342         return fromAndUpdate(immutable, null);
343     }
344 
345     /**
346      * This method will set the PersistableBusinessObjectBase OlePatronDocument from immutable object OlePatronDefinition
347      *
348      * @param immutable
349      * @param toUpdate
350      * @return bo(OlePatronDocument)
351      */
352     static org.kuali.ole.deliver.bo.OlePatronDocument fromAndUpdate(OlePatronDefinition immutable, org.kuali.ole.deliver.bo.OlePatronDocument toUpdate) {
353         if (immutable == null) {
354             return null;
355         }
356         org.kuali.ole.deliver.bo.OlePatronDocument bo = toUpdate;
357         if (toUpdate == null) {
358             bo = new org.kuali.ole.deliver.bo.OlePatronDocument();
359         }
360         // bo.activeIndicator = immutable.isActiveIndicator();
361         bo.olePatronId = immutable.getOlePatronId();
362 
363         bo.name = new EntityNameBo();
364 
365         if (immutable.getName() != null) {
366             bo.name = EntityNameBo.from(immutable.getName());
367         }
368 
369         bo.barcode = immutable.getBarcode();
370         bo.borrowerType = immutable.getBorrowerType();
371         bo.courtesyNotice = immutable.isCourtesyNotice();
372         bo.generalBlock = immutable.isGeneralBlock();
373         bo.deliveryPrivilege = immutable.isDeliveryPrivilege();
374         bo.pagingPrivilege = immutable.isPagingPrivilege();
375         bo.expirationDate = immutable.getExpirationDate();
376         bo.activationDate = immutable.getActivationDate();
377         bo.activeIndicator = immutable.isActiveIndicator();
378         bo.generalBlockNotes = immutable.getGeneralBlockNotes();
379         bo.source = immutable.getSource();
380         bo.statisticalCategory = immutable.getStatisticalCategory();
381         /* EntityBo entityBo ;
382 
383         if (null != bo.getEntity()) {
384             entityBo = bo.getEntity();
385             entityBo.setActive(true);
386         } else {
387             entityBo = new EntityBo();
388             entityBo.setActive(true);
389         }*/
390         if (immutable.getEntity() != null) {
391             bo.entity = EntityBo.from(immutable.getEntity());
392         }
393         if (immutable.getOleBorrowerType() != null) {
394             bo.oleBorrowerType = OleBorrowerType.from(immutable.getOleBorrowerType());
395         }
396         if (CollectionUtils.isNotEmpty(immutable.getAddresses())) {
397             for (EntityAddress entityAddr : immutable.getAddresses()) {
398                 bo.addresses.add(EntityAddressBo.from(entityAddr));
399             }
400         }
401         if (CollectionUtils.isNotEmpty(immutable.getEmails())) {
402             for (EntityEmail entityEmail : immutable.getEmails()) {
403                 bo.emails.add(EntityEmailBo.from(entityEmail));
404             }
405         }
406         if (CollectionUtils.isNotEmpty(immutable.getPhones())) {
407             for (EntityPhone entityPhone : immutable.getPhones()) {
408                 bo.phones.add(EntityPhoneBo.from(entityPhone));
409             }
410         }
411 
412         if (CollectionUtils.isNotEmpty(immutable.getNotes())) {
413             for (OlePatronNotesDefinition note : immutable.getNotes()) {
414                 bo.notes.add(OlePatronNotes.from(note));
415             }
416         }
417         if (CollectionUtils.isNotEmpty(immutable.getLostBarcodes())) {
418             for (OlePatronLostBarcodeDefinition lostBarcode : immutable.getLostBarcodes()) {
419                 bo.lostBarcodes.add(OlePatronLostBarcode.from(lostBarcode));
420             }
421         }
422         if (CollectionUtils.isNotEmpty(immutable.getOleEntityAddressBo())) {
423             for (OleEntityAddressDefinition address : immutable.getOleEntityAddressBo()) {
424                 bo.oleEntityAddressBo.add(OleEntityAddressBo.from(address));
425             }
426         }
427 
428         if (CollectionUtils.isNotEmpty(immutable.getPatronAffiliations())) {
429             for (OlePatronAffiliationDefinition affiliation : immutable.getPatronAffiliations()) {
430                 bo.patronAffiliations.add(OlePatronAffiliation.from(affiliation));
431             }
432         }
433         if (CollectionUtils.isNotEmpty(immutable.getOleProxyPatronDocuments())) {
434             for (OleProxyPatronDefinition proxyPatron : immutable.getOleProxyPatronDocuments()) {
435                 bo.oleProxyPatronDocuments.add(OleProxyPatronDocument.from(proxyPatron));
436             }
437         }
438         if (CollectionUtils.isNotEmpty(immutable.getOleAddresses())) {
439             for (OleAddressDefinition oleAddress : immutable.getOleAddresses()) {
440                 bo.oleAddresses.add(OleAddressBo.from(oleAddress));
441             }
442         }
443         if (CollectionUtils.isNotEmpty(immutable.getOlePatronLocalIds())) {
444             for (OlePatronLocalIdentificationDefinition olePatronLocalId : immutable.getOlePatronLocalIds()) {
445                 bo.olePatronLocalIds.add(OlePatronLocalIdentificationBo.from(olePatronLocalId));
446             }
447         }
448 
449         bo.versionNumber = immutable.getVersionNumber();
450         //bo.setObjectId(immutable.getObjectId());
451         EntityBo entityBo = new EntityBo();
452         entityBo.setActive(true);
453 
454         if (null != bo.getEntity()) {
455             entityBo = bo.getEntity();
456             entityBo.setActive(true);
457         }
458         if (CollectionUtils.isNotEmpty(immutable.getPatronAffiliations())) {
459             for (OlePatronAffiliationDefinition affiliation : immutable.getPatronAffiliations()) {
460                 EntityAffiliationBo entityAffiliationBo = new EntityAffiliationBo();
461                 entityAffiliationBo.setId(affiliation.getEntityAffiliationId());
462                 entityAffiliationBo.setAffiliationTypeCode(affiliation.getAffiliationTypeCode());
463                 entityAffiliationBo.setAffiliationType(EntityAffiliationTypeBo.from(affiliation.getAffiliationType()));
464                 entityAffiliationBo.setActive(affiliation.isActive());
465                 entityAffiliationBo.setDefaultValue(affiliation.isDefaultValue());
466                 entityAffiliationBo.setCampusCode(affiliation.getCampusCode());
467                 entityAffiliationBo.setObjectId(affiliation.getObjectId());
468                 entityAffiliationBo.setVersionNumber(affiliation.getVersionNumber());
469                 entityAffiliationBo.setEntityId(affiliation.getEntityId());
470 
471                 entityBo.getAffiliations().add(entityAffiliationBo);
472                 for (EntityEmployment entityEmployment : affiliation.getEmployments()) {
473                     entityBo.getEmploymentInformation().add(EntityEmploymentBo.from(entityEmployment));
474                 }
475 
476                 bo.patronAffiliations.add(OlePatronAffiliation.from(affiliation));
477             }
478         }
479         entityBo.setNames(Arrays.asList(bo.getName()));
480         EntityTypeContactInfoBo entityTypeContactInfoBo = new EntityTypeContactInfoBo();
481         if (bo.getEntity() != null && null != bo.getEntity().getEntityTypeContactInfos() && bo.getEntity().getEntityTypeContactInfos().size() > 0) {
482                 entityTypeContactInfoBo = bo.getEntity().getEntityTypeContactInfos().get(0);
483         }
484         entityTypeContactInfoBo.setAddresses(bo.getAddresses());
485         entityTypeContactInfoBo.setEmailAddresses(bo.getEmails());
486         entityTypeContactInfoBo.setPhoneNumbers(bo.getPhones());
487         entityTypeContactInfoBo.setEntityTypeCode(KimConstants.EntityTypes.PERSON);
488         entityBo.setEntityTypeContactInfos(Arrays.asList(entityTypeContactInfoBo));
489         bo.setEntity(entityBo);
490         return bo;
491     }
492 
493     public boolean isRealPatronCheck() {
494         return realPatronCheck;
495     }
496 
497     public void setRealPatronCheck(boolean realPatronCheck) {
498         this.realPatronCheck = realPatronCheck;
499     }
500 
501     /**
502      * Gets the value of oleLoanDocuments which is a list of OleLoanDocument
503      *
504      * @return oleLoanDocuments(list of type OleLoanDocument)
505      */
506     public List<OleLoanDocument> getOleLoanDocuments() {
507         if (CollectionUtils.isEmpty(oleLoanDocuments)) {
508             oleLoanDocuments = getOleLoanDocumentsFromSolr(getOlePatronId());
509         }
510         return oleLoanDocuments;
511     }
512 
513     //TODO: refactor this to be getOleLoanDocuments and populate the solr info at the same time
514     //TODO: eliminating the need for 2 methods.
515     public List<OleLoanDocument> getOleLoanDocumentsFromDb() {
516         if (StringUtils.isNotEmpty(getOlePatronId())) {
517             if (StringUtils.isNotEmpty(getOlePatronId())) {
518                 Map<String, String> parameterMap = new HashMap<>();
519                 parameterMap.put("patronId", getOlePatronId());
520                 List<OleLoanDocument> oleLoanDocumentList = (List<OleLoanDocument>) KRADServiceLocator.getBusinessObjectService().findMatching(OleLoanDocument.class, parameterMap);
521                 if (CollectionUtils.isNotEmpty(oleLoanDocumentList)) {
522                     oleLoanDocuments = oleLoanDocumentList;
523                 }
524             }
525         }
526         return oleLoanDocuments;
527     }
528 
529     public List<OleLoanDocument> getOleLoanDocumentsFromSolr(String patronId) {
530         List<OleLoanDocument> patronLoanedItemBySolr = new ArrayList<>();
531         try {
532             patronLoanedItemBySolr = new OleLoanDocumentsFromSolrBuilder().getPatronLoanedItemBySolr(patronId, null);
533         } catch (Exception e) {
534             e.printStackTrace();
535         }
536         return patronLoanedItemBySolr;
537 
538     }
539 
540     /**
541      * Sets the value for oleLoanDocuments which is a list of OleLoanDocument
542      *
543      * @param oleLoanDocuments(list of type OleLoanDocument)
544      */
545     public void setOleLoanDocuments(List<OleLoanDocument> oleLoanDocuments) {
546         List<OleLoanDocument> LoanDocumentList = new ArrayList<>();
547         List<OleLoanDocument> indefiniteLoanDocumentList = new ArrayList<>();
548         for (OleLoanDocument loanDoc : oleLoanDocuments) {
549             if (loanDoc.getLoanDueDate() != null && !(loanDoc.getLoanDueDate().toString().isEmpty())) {
550                 LoanDocumentList.add(loanDoc);
551             } else {
552 
553                 indefiniteLoanDocumentList.add(loanDoc);
554             }
555         }
556         Collections.sort(LoanDocumentList, new Comparator<OleLoanDocument>() {
557             public int compare(OleLoanDocument o1, OleLoanDocument o2) {
558                 return o1.getLoanDueDate().compareTo(o2.getLoanDueDate());
559             }
560         });
561         LoanDocumentList.addAll(indefiniteLoanDocumentList);
562         this.oleLoanDocuments = LoanDocumentList;
563     }
564 
565     /**
566      * Gets the value of borrowerTypeName property
567      *
568      * @return borrowerTypeName
569      */
570     public String getBorrowerTypeName() {
571         if (getOleBorrowerType() != null) {
572             return oleBorrowerType.getBorrowerTypeName();
573         }
574         return null;
575     }
576 
577     /**
578      * Gets the value of entity of type EntityBo
579      *
580      * @return entity(EntityBo)
581      */
582     public EntityBo getEntity() {
583         if (getOlePatronId() != null) {
584             EntityBo entityBo = (EntityBo) EntityBo.from( getIdentityService().getEntity(getOlePatronId()));
585             if(entityBo!=null){
586                 return entityBo;
587             }
588 
589             return entity;
590         } else {
591             return entity;
592         }
593     }
594 
595     /**
596      * Sets the value for entity of type EntityBo
597      *
598      * @param entity(EntityBo)
599      */
600     public void setEntity(EntityBo entity) {
601         this.entity = entity;
602     }
603 
604     public String getAffiliationType() {
605         return affiliationType;
606     }
607 
608     public void setAffiliationType(String affiliationType) {
609         this.affiliationType = affiliationType;
610     }
611 
612     /**
613      * Gets the value of notes which is a list of OlePatronNotes
614      *
615      * @return notes(list of type OlePatronNotes)
616      */
617     public List<OlePatronNotes> getNotes() {
618         if (StringUtils.isNotEmpty(getOlePatronId())) {
619             if (StringUtils.isNotEmpty(getOlePatronId())) {
620                 Map<String, String> parameterMap = new HashMap<>();
621                 parameterMap.put("olePatronId", getOlePatronId());
622                 List<OlePatronNotes> olePatronNotesList = (List<OlePatronNotes>) KRADServiceLocator.getBusinessObjectService().findMatching(OlePatronNotes.class, parameterMap);
623                 if (CollectionUtils.isNotEmpty(olePatronNotesList)) {
624                     notes = olePatronNotesList;
625                 }
626             }
627         }
628         return notes;
629     }
630 
631     /**
632      * Sets the value for notes which is a list of OlePatronNotes
633      *
634      * @param notes(list of type OlePatronNotes)
635      */
636     public void setNotes(List<OlePatronNotes> notes) {
637         this.notes = notes;
638     }
639 
640     /**
641      * Gets the value of barcode property
642      *
643      * @return barcode
644      */
645     public String getBarcode() {
646         return barcode;
647     }
648 
649     /**
650      * Sets the value for barcode property
651      *
652      * @param barcode
653      */
654     public void setBarcode(String barcode) {
655         this.barcode = barcode;
656     }
657 
658     /**
659      * Gets the value of borrowerType property
660      *
661      * @return borrowerType
662      */
663     public String getBorrowerType() {
664         return borrowerType;
665     }
666 
667     /**
668      * Sets the value for borrowerType property
669      *
670      * @param borrowerType
671      */
672     public void setBorrowerType(String borrowerType) {
673         this.borrowerType = borrowerType;
674     }
675 
676     /**
677      * Gets the boolean value of activeIndicator property
678      *
679      * @return activeIndicator
680      */
681     public boolean isActiveIndicator() {
682         return activeIndicator;
683     }
684 
685     /**
686      * Sets the boolean value for activeIndicator property
687      *
688      * @param activeIndicator
689      */
690     public void setActiveIndicator(boolean activeIndicator) {
691         this.activeIndicator = activeIndicator;
692     }
693 
694     /**
695      * Gets the value of olePatronId property
696      *
697      * @return olePatronId
698      */
699     public String getOlePatronId() {
700         return olePatronId;
701     }
702 
703     /**
704      * Sets the value for olePatronId property
705      *
706      * @param olePatronId
707      */
708     public void setOlePatronId(String olePatronId) {
709         this.olePatronId = olePatronId;
710     }
711 
712     /**
713      * Gets the boolean value of generalBlock property
714      *
715      * @return generalBlock
716      */
717     public boolean isGeneralBlock() {
718         return generalBlock;
719     }
720 
721     /**
722      * Sets the boolean value for generalBlock property
723      *
724      * @param generalBlock
725      */
726     public void setGeneralBlock(boolean generalBlock) {
727         this.generalBlock = generalBlock;
728     }
729 
730     /**
731      * Gets the boolean value of courtesyNotice property
732      *
733      * @return courtesyNotice
734      */
735     public boolean isCourtesyNotice() {
736         return courtesyNotice;
737     }
738 
739     /**
740      * Sets the boolean value for courtesyNotice property
741      *
742      * @param courtesyNotice
743      */
744     public void setCourtesyNotice(boolean courtesyNotice) {
745         this.courtesyNotice = courtesyNotice;
746     }
747 
748     /**
749      * Gets the boolean value of deliveryPrivilege property
750      *
751      * @return deliveryPrivilege
752      */
753     public boolean isDeliveryPrivilege() {
754         return deliveryPrivilege;
755     }
756 
757     /**
758      * Sets the boolean value for deliveryPrivilege property
759      *
760      * @param deliveryPrivilege
761      */
762     public void setDeliveryPrivilege(boolean deliveryPrivilege) {
763         this.deliveryPrivilege = deliveryPrivilege;
764     }
765 
766     /**
767      * Gets the boolean value of pagingPrivilege property
768      *
769      * @return pagingPrivilege
770      */
771     public boolean isPagingPrivilege() {
772         return pagingPrivilege;
773     }
774 
775     /**
776      * Sets the boolean value for pagingPrivilege property
777      *
778      * @param pagingPrivilege
779      */
780     public void setPagingPrivilege(boolean pagingPrivilege) {
781         this.pagingPrivilege = pagingPrivilege;
782     }
783 
784     /**
785      * Gets the value of expirationDate which is of type Date
786      *
787      * @return expirationDate(Date)
788      */
789     public Date getExpirationDate() {
790         return expirationDate;
791     }
792 
793     /**
794      * Sets the value for expirationDate which is of type Date
795      *
796      * @param expirationDate
797      */
798     public void setExpirationDate(Date expirationDate) {
799         this.expirationDate = expirationDate;
800     }
801 
802     /**
803      * Gets the value of firstName property
804      *
805      * @return firstName
806      */
807     public String getFirstName() {
808         return firstName;
809     }
810 
811     /**
812      * Sets the value for firstName property
813      *
814      * @param firstName
815      */
816     public void setFirstName(String firstName) {
817         this.firstName = firstName;
818     }
819 
820     /**
821      * Gets the value of middleName property
822      *
823      * @return middleName
824      */
825     public String getMiddleName() {
826         return middleName;
827     }
828 
829     /**
830      * Sets the value for middleName property
831      *
832      * @param middleName
833      */
834     public void setMiddleName(String middleName) {
835         this.middleName = middleName;
836     }
837 
838     /**
839      * Gets the value of lastName property
840      *
841      * @return lastName
842      */
843     public String getLastName() {
844         return lastName;
845     }
846 
847     /**
848      * Sets the value for lastName property
849      *
850      * @param lastName
851      */
852     public void setLastName(String lastName) {
853         this.lastName = lastName;
854     }
855 
856     /**
857      * Gets the value of emailAddress property
858      *
859      * @return emailAddress
860      */
861     public String getEmailAddress() {
862         return emailAddress;
863     }
864 
865     /**
866      * Sets the value for emailAddress property
867      *
868      * @param emailAddress
869      */
870     public void setEmailAddress(String emailAddress) {
871         this.emailAddress = emailAddress;
872     }
873 
874     /**
875      * Gets the value of phoneNumber property
876      *
877      * @return phoneNumber
878      */
879     public String getPhoneNumber() {
880         return phoneNumber;
881     }
882 
883     /**
884      * Sets the value for phoneNumber property
885      *
886      * @param phoneNumber
887      */
888     public void setPhoneNumber(String phoneNumber) {
889         this.phoneNumber = phoneNumber;
890     }
891 
892     /**
893      * Gets the value of phones which is a list of EntityPhoneBo
894      *
895      * @return phones(list of type EntityPhoneBo)
896      */
897     public List<EntityPhoneBo> getPhones() {
898         return phones;
899     }
900 
901     /**
902      * Sets the value for phones which is a list of EntityPhoneBo
903      *
904      * @param phones(list of type EntityPhoneBo)
905      */
906     public void setPhones(List<EntityPhoneBo> phones) {
907         this.phones = phones;
908     }
909 
910     /**
911      * Gets the value of addresses which is a list of EntityAddressBo
912      *
913      * @return addresses(list of type EntityAddressBo)
914      */
915     public List<EntityAddressBo> getAddresses() {
916         return addresses;
917     }
918 
919     /**
920      * Sets the value for addresses which is a list of EntityAddressBo
921      *
922      * @param addresses(list of type EntityAddressBo)
923      */
924     public void setAddresses(List<EntityAddressBo> addresses) {
925         this.addresses = addresses;
926     }
927 
928     /**
929      * Gets the value of name which is of type EntityNameBo
930      *
931      * @return name(EntityNameBo)
932      */
933     public EntityNameBo getName() {
934         return name;
935     }
936 
937     /**
938      * Sets the value for name which is of type EntityNameBo
939      *
940      * @param name(EntityNameBo)
941      */
942     public void setName(EntityNameBo name) {
943         this.name = name;
944     }
945 
946     /**
947      * Gets the value of emails which is a list of EntityEmailBo
948      *
949      * @return emails(list of type EntityEmailBo)
950      */
951     public List<EntityEmailBo> getEmails() {
952         return emails;
953     }
954 
955     /**
956      * Sets the value for emails which is a list of EntityEmailBo
957      *
958      * @param emails(list of type EntityEmailBo)
959      */
960     public void setEmails(List<EntityEmailBo> emails) {
961         this.emails = emails;
962     }
963 
964     /**
965      * Gets the value of oleBorrowerType which is of type OleBorrowerType
966      *
967      * @return oleBorrowerType(OleBorrowerType)
968      */
969     public OleBorrowerType getOleBorrowerType() {
970         if (null == oleBorrowerType) {
971             if (StringUtils.isNotEmpty(getBorrowerType())) {
972                 String borrowerTypeId = getBorrowerType();
973                 if (StringUtils.isNotEmpty(borrowerTypeId)) {
974                     Map<String, String> parameterMap = new HashMap<>();
975                     parameterMap.put("borrowerTypeId", borrowerTypeId);
976                     List<OleBorrowerType> oleBorrowerTypeList = (List<OleBorrowerType>) KRADServiceLocator.getBusinessObjectService().findMatching(OleBorrowerType.class, parameterMap);
977                     if (CollectionUtils.isNotEmpty(oleBorrowerTypeList)) {
978                         oleBorrowerType = oleBorrowerTypeList.get(0);
979                     }
980                 }
981             }
982         }
983         return oleBorrowerType;
984     }
985 
986     /**
987      * Sets the value for oleBorrowerType which is of type OleBorrowerType
988      *
989      * @param oleBorrowerType(OleBorrowerType)
990      */
991     public void setOleBorrowerType(OleBorrowerType oleBorrowerType) {
992         this.oleBorrowerType = oleBorrowerType;
993     }
994 
995     /**
996      * Gets the value of processMessage property
997      *
998      * @return processMessage
999      */
1000     public String getProcessMessage() {
1001         return processMessage;
1002     }
1003 
1004     /**
1005      * Sets the value for processMessage property
1006      *
1007      * @param processMessage
1008      */
1009     public void setProcessMessage(String processMessage) {
1010         this.processMessage = processMessage;
1011     }
1012 
1013     protected LinkedHashMap toStringMapper() {
1014         LinkedHashMap toStringMap = new LinkedHashMap();
1015         toStringMap.put("olePatronId", olePatronId);
1016         return toStringMap;
1017     }
1018 
1019     /**
1020      * Gets the value of olePatronId property
1021      *
1022      * @return olePatronId
1023      */
1024     @Override
1025     public String getId() {
1026         return this.getOlePatronId();
1027     }
1028     /* *//**
1029      * Gets the value of olePatronDocuments property
1030      * @return olePatronDocuments
1031      *//*
1032     public List<OlePatronDocument> getOlePatronDocuments() {
1033         return olePatronDocuments;
1034     }
1035     *//**
1036      * Sets the value for olePatronDocuments property
1037      * @param olePatronDocuments
1038      *//*
1039     public void setOlePatronDocuments(List<OlePatronDocument> olePatronDocuments) {
1040         this.olePatronDocuments = olePatronDocuments;
1041     }*/
1042 
1043     /**
1044      * Gets the value of proxyPatronId property
1045      *
1046      * @return proxyPatronId
1047      */
1048     public String getProxyPatronId() {
1049         return proxyPatronId;
1050     }
1051 
1052     /**
1053      * Sets the value for proxyPatronId property
1054      *
1055      * @param proxyPatronId
1056      */
1057     public void setProxyPatronId(String proxyPatronId) {
1058         this.proxyPatronId = proxyPatronId;
1059     }
1060 
1061     /**
1062      * Gets the value of oleProxyPatronDocuments property
1063      *
1064      * @return oleProxyPatronDocuments
1065      */
1066     public List<OleProxyPatronDocument> getOleProxyPatronDocuments() {
1067         if (CollectionUtils.isEmpty(oleProxyPatronDocuments)) {
1068             if (StringUtils.isNotEmpty(getOlePatronId())) {
1069                 if (StringUtils.isNotEmpty(getOlePatronId())) {
1070                     Map<String, String> parameterMap = new HashMap<>();
1071                     parameterMap.put("olePatronId", getOlePatronId());
1072                     List<OleProxyPatronDocument> proxyPatronDocumentLists = (List<OleProxyPatronDocument>) KRADServiceLocator.getBusinessObjectService().findMatching(OleProxyPatronDocument.class, parameterMap);
1073                     if (CollectionUtils.isNotEmpty(proxyPatronDocumentLists)) {
1074                         oleProxyPatronDocuments = proxyPatronDocumentLists;
1075                     }
1076                 }
1077             }
1078         }
1079         return oleProxyPatronDocuments;
1080     }
1081 
1082     /**
1083      * Sets the value for oleProxyPatronDocuments property
1084      *
1085      * @param oleProxyPatronDocuments
1086      */
1087     public void setOleProxyPatronDocuments(List<OleProxyPatronDocument> oleProxyPatronDocuments) {
1088         this.oleProxyPatronDocuments = oleProxyPatronDocuments;
1089     }
1090 
1091     /**
1092      * Gets the value of activationDate property
1093      *
1094      * @return activationDate
1095      */
1096     public Date getActivationDate() {
1097         return activationDate;
1098     }
1099 
1100     /**
1101      * Sets the value for activationDate property
1102      *
1103      * @param activationDate
1104      */
1105     public void setActivationDate(Date activationDate) {
1106         this.activationDate = activationDate;
1107     }
1108 
1109     /**
1110      * Gets the value of generalBlockNotes property
1111      *
1112      * @return generalBlockNotes
1113      */
1114     public String getGeneralBlockNotes() {
1115         return generalBlockNotes;
1116     }
1117 
1118     /**
1119      * Sets the value for generalBlockNotes property
1120      *
1121      * @param generalBlockNotes
1122      */
1123     public void setGeneralBlockNotes(String generalBlockNotes) {
1124         this.generalBlockNotes = generalBlockNotes;
1125     }
1126 
1127     /**
1128      * Gets the value of oleEntityAddressBo property
1129      *
1130      * @return oleEntityAddressBo
1131      */
1132     public List<OleEntityAddressBo> getOleEntityAddressBo() {
1133         return oleEntityAddressBo;
1134     }
1135 
1136     /**
1137      * Sets the value for oleEntityAddressBo property
1138      *
1139      * @param oleEntityAddressBo
1140      */
1141     public void setOleEntityAddressBo(List<OleEntityAddressBo> oleEntityAddressBo) {
1142         this.oleEntityAddressBo = oleEntityAddressBo;
1143     }
1144 
1145     /**
1146      * Gets the value of patronAffiliations property
1147      *
1148      * @return patronAffiliations
1149      */
1150     public List<OlePatronAffiliation> getPatronAffiliations() {
1151         return patronAffiliations;
1152     }
1153 
1154     /**
1155      * Sets the value for patronAffiliations property
1156      *
1157      * @param patronAffiliations
1158      */
1159     public void setPatronAffiliations(List<OlePatronAffiliation> patronAffiliations) {
1160         this.patronAffiliations = patronAffiliations;
1161     }
1162 
1163     /**
1164      * Gets the value of sourceBo property
1165      *
1166      * @return sourceBo
1167      */
1168     public OleSourceBo getSourceBo() {
1169         if (null == sourceBo) {
1170             if (StringUtils.isNotEmpty(getSource())) {
1171                 if (StringUtils.isNotEmpty(getSource())) {
1172                     Map<String, String> parameterMap = new HashMap<>();
1173                     parameterMap.put("oleSourceId", getSource());
1174                     List<OleSourceBo> oleSourceBoList = (List<OleSourceBo>) KRADServiceLocator.getBusinessObjectService().findMatching(OleSourceBo.class, parameterMap);
1175                     if (CollectionUtils.isNotEmpty(oleSourceBoList)) {
1176                         sourceBo = oleSourceBoList.get(0);
1177                     }
1178                 }
1179             }
1180         }
1181         return sourceBo;
1182     }
1183 
1184     /**
1185      * Sets the value for sourceBo property
1186      *
1187      * @param sourceBo
1188      */
1189     public void setSourceBo(OleSourceBo sourceBo) {
1190         this.sourceBo = sourceBo;
1191     }
1192 
1193     /**
1194      * Gets the value of statisticalCategoryBo property
1195      *
1196      * @return statisticalCategoryBo
1197      */
1198     public OleStatisticalCategoryBo getStatisticalCategoryBo() {
1199         if (null == statisticalCategoryBo) {
1200             if (StringUtils.isNotEmpty(getStatisticalCategory())) {
1201                 if (StringUtils.isNotEmpty(getStatisticalCategory())) {
1202                     Map<String, String> parameterMap = new HashMap<>();
1203                     parameterMap.put("oleStatisticalCategoryId", getStatisticalCategory());
1204                     List<OleStatisticalCategoryBo> oleStatisticalCategoryBoList = (List<OleStatisticalCategoryBo>) KRADServiceLocator.getBusinessObjectService().findMatching(OleStatisticalCategoryBo.class, parameterMap);
1205                     if (CollectionUtils.isNotEmpty(oleStatisticalCategoryBoList)) {
1206                         statisticalCategoryBo = oleStatisticalCategoryBoList.get(0);
1207                     }
1208                 }
1209             }
1210         }
1211         return statisticalCategoryBo;
1212     }
1213 
1214     /**
1215      * Sets the value for statisticalCategoryBo property
1216      *
1217      * @param statisticalCategoryBo
1218      */
1219     public void setStatisticalCategoryBo(OleStatisticalCategoryBo statisticalCategoryBo) {
1220         this.statisticalCategoryBo = statisticalCategoryBo;
1221     }
1222 
1223     /**
1224      * Gets the value of employments property
1225      *
1226      * @return employments
1227      */
1228     public List<EntityEmploymentBo> getEmployments() {
1229         return employments;
1230     }
1231 
1232     public void setEmployments(List<EntityEmploymentBo> employments) {
1233         this.employments = employments;
1234     }
1235 
1236     /**
1237      * Gets the value of source property
1238      *
1239      * @return source
1240      */
1241     public String getSource() {
1242         return source;
1243     }
1244 
1245     public void setSource(String source) {
1246         if (source != null && source.equals("")) {
1247             this.source = null;
1248         } else {
1249             this.source = source;
1250         }
1251     }
1252 
1253     /**
1254      * Gets the value of statisticalCategory property
1255      *
1256      * @return statisticalCategory
1257      */
1258     public String getStatisticalCategory() {
1259         return statisticalCategory;
1260     }
1261 
1262     public void setStatisticalCategory(String statisticalCategory) {
1263         if (statisticalCategory != null && statisticalCategory.equals("")) {
1264             this.statisticalCategory = null;
1265         } else {
1266             this.statisticalCategory = statisticalCategory;
1267         }
1268     }
1269 
1270     /**
1271      * Gets the value of sourceName property
1272      *
1273      * @return sourceName
1274      */
1275     public String getOleSourceName() {
1276         if (sourceBo != null) {
1277             return sourceBo.getOleSourceName();
1278         }
1279         return null;
1280     }
1281 
1282     /**
1283      * Gets the value of statisticalCategoryName property
1284      *
1285      * @return statisticalCategoryName
1286      */
1287     public String getOleStatisticalCategoryName() {
1288         if (statisticalCategoryBo != null) {
1289             return statisticalCategoryBo.getOleStatisticalCategoryName();
1290         }
1291         return null;
1292     }
1293 
1294     /**
1295      * Gets the value of patronBillFlag property
1296      *
1297      * @return patronBillFlag
1298      */
1299     public boolean isPatronBillFlag() {
1300         return patronBillFlag;
1301     }
1302 
1303     /**
1304      * Sets the value for patronBillFlag property
1305      *
1306      * @param patronBillFlag
1307      */
1308     public void setPatronBillFlag(boolean patronBillFlag) {
1309         this.patronBillFlag = patronBillFlag;
1310     }
1311 
1312     public List<OlePatronLostBarcode> getLostBarcodes() {
1313         if (CollectionUtils.isEmpty(lostBarcodes)) {
1314             if (StringUtils.isNotEmpty(getOlePatronId())) {
1315                 if (StringUtils.isNotEmpty(getOlePatronId())) {
1316                     Map<String, String> parameterMap = new HashMap<>();
1317                     parameterMap.put("olePatronId", getOlePatronId());
1318                     List<OlePatronLostBarcode> olePatronLostBarcodeList = (List<OlePatronLostBarcode>) KRADServiceLocator.getBusinessObjectService().findMatching(OlePatronLostBarcode.class, parameterMap);
1319                     if (CollectionUtils.isNotEmpty(olePatronLostBarcodeList)) {
1320                         lostBarcodes = olePatronLostBarcodeList;
1321                     }
1322                 }
1323             }
1324         }
1325         return lostBarcodes;
1326     }
1327 
1328     public void setLostBarcodes(List<OlePatronLostBarcode> lostBarcodes) {
1329         this.lostBarcodes = lostBarcodes;
1330     }
1331 
1332     public List<OleAddressBo> getOleAddresses() {
1333         if (CollectionUtils.isEmpty(oleAddresses)) {
1334             if (StringUtils.isNotEmpty(getOlePatronId())) {
1335                 if (StringUtils.isNotEmpty(getOlePatronId())) {
1336                     Map<String, String> parameterMap = new HashMap<>();
1337                     parameterMap.put("olePatronId", getOlePatronId());
1338                     List<OleAddressBo> oleAddressBos = (List<OleAddressBo>) KRADServiceLocator.getBusinessObjectService().findMatching(OleAddressBo.class, parameterMap);
1339                     if (CollectionUtils.isNotEmpty(oleAddressBos)) {
1340                         oleAddresses = oleAddressBos;
1341                     }
1342                 }
1343             }
1344         }
1345         return oleAddresses;
1346     }
1347 
1348     public void setOleAddresses(List<OleAddressBo> oleAddresses) {
1349         this.oleAddresses = oleAddresses;
1350     }
1351 
1352     public byte[] getPatronPhotograph() {
1353         return patronPhotograph;
1354     }
1355 
1356     public void setPatronPhotograph(byte[] patronPhotograph) {
1357         this.patronPhotograph = patronPhotograph;
1358     }
1359 
1360     public List<OlePatronLocalIdentificationBo> getOlePatronLocalIds() {
1361         if (CollectionUtils.isEmpty(olePatronLocalIds)) {
1362             if (StringUtils.isNotEmpty(getOlePatronId())) {
1363                 if (StringUtils.isNotEmpty(getOlePatronId())) {
1364                     Map<String, String> parameterMap = new HashMap<>();
1365                     parameterMap.put("olePatronId", getOlePatronId());
1366                     List<OlePatronLocalIdentificationBo> olePatronLocalIdentificationBoList = (List<OlePatronLocalIdentificationBo>) KRADServiceLocator.getBusinessObjectService().findMatching(OlePatronLocalIdentificationBo.class, parameterMap);
1367                     if (CollectionUtils.isNotEmpty(olePatronLocalIdentificationBoList)) {
1368                         olePatronLocalIds = olePatronLocalIdentificationBoList;
1369                     }
1370                 }
1371             }
1372         }
1373         return olePatronLocalIds;
1374     }
1375 
1376     public void setOlePatronLocalIds(List<OlePatronLocalIdentificationBo> olePatronLocalIds) {
1377         this.olePatronLocalIds = olePatronLocalIds;
1378     }
1379 
1380     public boolean isLoanFlag() {
1381         return loanFlag;
1382     }
1383 
1384     public void setLoanFlag(boolean loanFlag) {
1385         this.loanFlag = loanFlag;
1386     }
1387 
1388     public boolean isTempCircHistoryFlag() {
1389         return tempCircHistoryFlag;
1390     }
1391 
1392     public void setTempCircHistoryFlag(boolean tempCircHistoryFlag) {
1393         this.tempCircHistoryFlag = tempCircHistoryFlag;
1394     }
1395 
1396     public boolean isRequestFlag() {
1397         return requestFlag;
1398     }
1399 
1400     public void setRequestFlag(boolean requestFlag) {
1401         this.requestFlag = requestFlag;
1402     }
1403 
1404     public List<OleProxyPatronDocument> getOleProxyPatronDocumentList() {
1405         if (CollectionUtils.isEmpty(oleProxyPatronDocumentList)) {
1406             if (StringUtils.isNotEmpty(getOlePatronId())) {
1407                 if (StringUtils.isNotEmpty(getOlePatronId())) {
1408                     Map<String, String> parameterMap = new HashMap<>();
1409                     parameterMap.put("proxyPatronId", getOlePatronId());
1410                     List<OleProxyPatronDocument> oleProxyPatronDocuments = (List<OleProxyPatronDocument>) KRADServiceLocator.getBusinessObjectService().findMatching(OleProxyPatronDocument.class, parameterMap);
1411                     if (CollectionUtils.isNotEmpty(oleProxyPatronDocuments)) {
1412                         oleProxyPatronDocumentList = oleProxyPatronDocuments;
1413                     }
1414                 }
1415             }
1416         }
1417         return oleProxyPatronDocumentList;
1418     }
1419 
1420     public void setOleProxyPatronDocumentList(List<OleProxyPatronDocument> oleProxyPatronDocumentList) {
1421         this.oleProxyPatronDocumentList = oleProxyPatronDocumentList;
1422     }
1423 
1424     public boolean isPointing() {
1425         return pointing;
1426     }
1427 
1428     public void setPointing(boolean pointing) {
1429         this.pointing = pointing;
1430     }
1431 
1432     public boolean isStartingIndexExecuted() {
1433         return startingIndexExecuted;
1434     }
1435 
1436     public void setStartingIndexExecuted(boolean startingIndexExecuted) {
1437         this.startingIndexExecuted = startingIndexExecuted;
1438     }
1439 
1440     public boolean isActivateBarcode() {
1441         return activateBarcode;
1442     }
1443 
1444     public void setActivateBarcode(boolean activateBarcode) {
1445         this.activateBarcode = activateBarcode;
1446     }
1447 
1448     public boolean isDeactivateBarcode() {
1449         return deactivateBarcode;
1450     }
1451 
1452     public void setDeactivateBarcode(boolean deactivateBarcode) {
1453         this.deactivateBarcode = deactivateBarcode;
1454     }
1455 
1456     public String getLostStatus() {
1457         return lostStatus;
1458     }
1459 
1460     public void setLostStatus(String lostStatus) {
1461         this.lostStatus = lostStatus;
1462     }
1463 
1464     public String getLostDescription() {
1465         return lostDescription;
1466     }
1467 
1468     public void setLostDescription(String lostDescription) {
1469         this.lostDescription = lostDescription;
1470     }
1471 
1472     public boolean isInvalidateBarcode() {
1473         return invalidateBarcode;
1474     }
1475 
1476     public void setInvalidateBarcode(boolean invalidateBarcode) {
1477         this.invalidateBarcode = invalidateBarcode;
1478     }
1479 
1480     public boolean isReinstateBarcode() {
1481         return reinstateBarcode;
1482     }
1483 
1484     public void setReinstateBarcode(boolean reinstateBarcode) {
1485         this.reinstateBarcode = reinstateBarcode;
1486     }
1487 
1488     public boolean isSkipBarcodeValidation() {
1489         return skipBarcodeValidation;
1490     }
1491 
1492     public void setSkipBarcodeValidation(boolean skipBarcodeValidation) {
1493         this.skipBarcodeValidation = skipBarcodeValidation;
1494     }
1495 
1496     public boolean isBarcodeChanged() {
1497         return barcodeChanged;
1498     }
1499 
1500     public void setBarcodeChanged(boolean barcodeChanged) {
1501         this.barcodeChanged = barcodeChanged;
1502     }
1503 
1504     public boolean isBarcodeEditable() {
1505         return barcodeEditable;
1506     }
1507 
1508     public void setBarcodeEditable(boolean barcodeEditable) {
1509         this.barcodeEditable = barcodeEditable;
1510     }
1511 
1512     public boolean isPopupDialog() {
1513         return popupDialog;
1514     }
1515 
1516     public void setPopupDialog(boolean popupDialog) {
1517         this.popupDialog = popupDialog;
1518     }
1519 
1520     public String getPatronMessage() {
1521         return patronMessage;
1522     }
1523 
1524     public void setPatronMessage(String patronMessage) {
1525         this.patronMessage = patronMessage;
1526     }
1527 
1528     public String getUiMessageType() {
1529         return uiMessageType;
1530     }
1531 
1532     public void setUiMessageType(String uiMessageType) {
1533         this.uiMessageType = uiMessageType;
1534     }
1535 
1536     public boolean isReinstated() {
1537         return reinstated;
1538     }
1539 
1540     public void setReinstated(boolean reinstated) {
1541         this.reinstated = reinstated;
1542     }
1543 
1544     public OLEPatronEntityViewBo getOlePatronEntityViewBo() {
1545         if (null == olePatronEntityViewBo) {
1546             if (StringUtils.isNotEmpty(getOlePatronId())) {
1547                 if (StringUtils.isNotEmpty(getOlePatronId())) {
1548                     Map<String, String> parameterMap = new HashMap<>();
1549                     parameterMap.put("patronId", getOlePatronId());
1550                     List<OLEPatronEntityViewBo> olePatronEntityViewBoList = (List<OLEPatronEntityViewBo>) KRADServiceLocator.getBusinessObjectService().findMatching(OLEPatronEntityViewBo.class, parameterMap);
1551                     if (CollectionUtils.isNotEmpty(olePatronEntityViewBoList)) {
1552                         olePatronEntityViewBo = olePatronEntityViewBoList.get(0);
1553                     }
1554                 }
1555             }
1556         }
1557         return olePatronEntityViewBo;
1558     }
1559 
1560     public void setOlePatronEntityViewBo(OLEPatronEntityViewBo olePatronEntityViewBo) {
1561         this.olePatronEntityViewBo = olePatronEntityViewBo;
1562     }
1563 
1564     public String getPatronBillFileName() {
1565         return patronBillFileName;
1566     }
1567 
1568     public void setPatronBillFileName(String patronBillFileName) {
1569         this.patronBillFileName = patronBillFileName;
1570     }
1571 
1572     public String getViewBillUrl() {
1573         return viewBillUrl;
1574     }
1575 
1576     public void setViewBillUrl(String viewBillUrl) {
1577         this.viewBillUrl = viewBillUrl;
1578     }
1579 
1580     public String getCreateBillUrl() {
1581         return createBillUrl;
1582     }
1583 
1584     public void setCreateBillUrl(String createBillUrl) {
1585         this.createBillUrl = createBillUrl;
1586     }
1587 
1588     public String getNamePrefix() {
1589         return namePrefix;
1590     }
1591 
1592     public void setNamePrefix(String namePrefix) {
1593         this.namePrefix = namePrefix;
1594     }
1595 
1596     public String getNameSuffix() {
1597         return nameSuffix;
1598     }
1599 
1600     public void setNameSuffix(String nameSuffix) {
1601         this.nameSuffix = nameSuffix;
1602     }
1603 
1604     public List<EntityPhoneBo> getDeletedPhones() {
1605         return deletedPhones;
1606     }
1607 
1608     public void setDeletedPhones(List<EntityPhoneBo> deletedPhones) {
1609         this.deletedPhones = deletedPhones;
1610     }
1611 
1612     public List<OleEntityAddressBo> getDeletedOleEntityAddressBo() {
1613         return deletedOleEntityAddressBo;
1614     }
1615 
1616     public void setDeletedOleEntityAddressBo(List<OleEntityAddressBo> deletedOleEntityAddressBo) {
1617         this.deletedOleEntityAddressBo = deletedOleEntityAddressBo;
1618     }
1619 
1620     public List<EntityEmailBo> getDeletedEmails() {
1621         return deletedEmails;
1622     }
1623 
1624     public void setDeletedEmails(List<EntityEmailBo> deletedEmails) {
1625         this.deletedEmails = deletedEmails;
1626     }
1627 
1628     public List<OleProxyPatronDocument> getDeletedOleProxyPatronDocuments() {
1629         return deletedOleProxyPatronDocuments;
1630     }
1631 
1632     public void setDeletedOleProxyPatronDocuments(List<OleProxyPatronDocument> deletedOleProxyPatronDocuments) {
1633         this.deletedOleProxyPatronDocuments = deletedOleProxyPatronDocuments;
1634     }
1635 
1636     public List<OlePatronAffiliation> getDeletedPatronAffiliations() {
1637         return deletedPatronAffiliations;
1638     }
1639 
1640     public void setDeletedPatronAffiliations(List<OlePatronAffiliation> deletedPatronAffiliations) {
1641         this.deletedPatronAffiliations = deletedPatronAffiliations;
1642     }
1643 
1644     public List<EntityEmploymentBo> getDeletedEmployments() {
1645         return deletedEmployments;
1646     }
1647 
1648     public void setDeletedEmployments(List<EntityEmploymentBo> deletedEmployments) {
1649         this.deletedEmployments = deletedEmployments;
1650     }
1651 
1652     public List<OlePatronNotes> getDeletedNotes() {
1653         return deletedNotes;
1654     }
1655 
1656     public void setDeletedNotes(List<OlePatronNotes> deletedNotes) {
1657         this.deletedNotes = deletedNotes;
1658     }
1659 
1660     public List<OlePatronLocalIdentificationBo> getDeletedOlePatronLocalIds() {
1661         return deletedOlePatronLocalIds;
1662     }
1663 
1664     public void setDeletedOlePatronLocalIds(List<OlePatronLocalIdentificationBo> deletedOlePatronLocalIds) {
1665         this.deletedOlePatronLocalIds = deletedOlePatronLocalIds;
1666     }
1667 
1668     public boolean isShowLoanedRecords() {
1669         return showLoanedRecords;
1670     }
1671 
1672     public void setShowLoanedRecords(boolean showLoanedRecords) {
1673         this.showLoanedRecords = showLoanedRecords;
1674     }
1675 
1676     public boolean isShowRequestedItems() {
1677         return showRequestedItems;
1678     }
1679 
1680     public void setShowRequestedItems(boolean showRequestedItems) {
1681         this.showRequestedItems = showRequestedItems;
1682     }
1683 
1684     public boolean isShowTemporaryCirculationHistoryRecords() {
1685         return showTemporaryCirculationHistoryRecords;
1686     }
1687 
1688     public void setShowTemporaryCirculationHistoryRecords(boolean showTemporaryCirculationHistoryRecords) {
1689         this.showTemporaryCirculationHistoryRecords = showTemporaryCirculationHistoryRecords;
1690     }
1691 
1692     public String getRealPatronFirstName() {
1693         if(entity!=null && entity.getNames()!=null && entity.getNames().size()>0){
1694             this.realPatronFirstName=entity.getNames().get(0).getFirstName().replaceAll("'", "\'");
1695         }
1696         return realPatronFirstName;
1697     }
1698 
1699     public void setRealPatronFirstName(String realPatronFirstName) {
1700         this.realPatronFirstName = realPatronFirstName;
1701     }
1702 
1703     public String getRealPatronLastName() {
1704         if(entity!=null && entity.getNames()!=null && entity.getNames().size()>0){
1705             this.realPatronLastName=entity.getNames().get(0).getLastName().replaceAll("'", "\'");
1706         }
1707         return realPatronLastName;
1708     }
1709 
1710     public void setRealPatronLastName(String realPatronLastName) {
1711         this.realPatronLastName = realPatronLastName;
1712     }
1713 
1714     public int getLoanCount() {
1715         return loanCount;
1716     }
1717 
1718     public void setLoanCount(int loanCount) {
1719         this.loanCount = loanCount;
1720     }
1721 
1722     public int getRequestedItemRecordsCount() {
1723         return requestedItemRecordsCount;
1724     }
1725 
1726     public void setRequestedItemRecordsCount(int requestedItemRecordsCount) {
1727         this.requestedItemRecordsCount = requestedItemRecordsCount;
1728     }
1729 
1730     public int getTempCirculationHistoryCount() {
1731         return tempCirculationHistoryCount;
1732     }
1733 
1734     public void setTempCirculationHistoryCount(int tempCirculationHistoryCount) {
1735         this.tempCirculationHistoryCount = tempCirculationHistoryCount;
1736     }
1737 
1738     public boolean isDeleteImageFlag() {
1739         return deleteImageFlag;
1740     }
1741 
1742     public void setDeleteImageFlag(boolean deleteImageFlag) {
1743         this.deleteImageFlag = deleteImageFlag;
1744     }
1745 }