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