1 package org.kuali.ole.docstore.common.document;
2
3 import com.thoughtworks.xstream.converters.ConversionException;
4 import org.apache.commons.lang3.StringUtils;
5 import org.apache.log4j.Logger;
6 import org.kuali.ole.docstore.common.document.content.enums.DocCategory;
7 import org.kuali.ole.docstore.common.document.content.enums.DocFormat;
8 import org.kuali.ole.docstore.common.document.content.enums.DocType;
9 import org.kuali.ole.docstore.common.document.content.instance.*;
10 import org.kuali.ole.docstore.common.document.content.instance.xstream.ItemOlemlRecordProcessor;
11
12 import javax.xml.bind.JAXBContext;
13 import javax.xml.bind.JAXBElement;
14 import javax.xml.bind.Marshaller;
15 import javax.xml.bind.Unmarshaller;
16 import javax.xml.bind.annotation.*;
17 import javax.xml.transform.stream.StreamSource;
18 import java.io.ByteArrayInputStream;
19 import java.io.StringWriter;
20 import java.util.ArrayList;
21 import java.util.List;
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 @XmlAccessorType(XmlAccessType.FIELD)
55 @XmlType(name = "item", propOrder = {
56 "callNumberType",
57 "callNumberPrefix",
58 "itemStatus",
59 "volumeNumber",
60 "itemType",
61 "locationName",
62 "chronology",
63 "enumeration",
64 "copyNumber",
65 "barcode",
66 "shelvingOrder",
67 "location",
68 "callNumber",
69 "holding",
70 "isAnalytic",
71 "holdings"
72 })
73 @XmlRootElement(name = "itemDoc")
74
75 public class Item
76 extends DocstoreDocument implements Comparable<Item> {
77
78 private static final Logger LOG = Logger.getLogger(Item.class);
79 public static final String CALL_NUMBER = "CALLNUMBER";
80 public static final String CALL_NUMBER_TYPE = "CALLNUMBERTYPE";
81 public static final String CALL_NUMBER_PREFIX = "CALLNUMBERPREFIX";
82 public static final String LOCATION = "LOCATION";
83 public static final String SHELVING_ORDER = "SHELVINGORDER";
84 public static final String ITEM_BARCODE = "ITEMBARCODE";
85 public static final String COPY_NUMBER = "COPYNUMBER";
86 public static final String ENUMERATION = "ENUMERATION";
87 public static final String CHRONOLOGY = "CHRONOLOGY";
88 public static final String ITEM_TYPE = "ITEMTYPE";
89 public static final String VOLUME_NUMBER = "VOLUMENUMBER";
90 public static final String ITEM_STATUS = "ITEMSTATUS";
91 public static final String ITEMIDENTIFIER = "ITEMIDENTIFIER";
92 public static final String DESTINATION_FIELD_ITEM_ITEM_BARCODE = "Item Barcode";
93 public static final String DESTINATION_FIELD_CALL_NUMBER = "Call Number";
94 public static final String DESTINATION_FIELD_COPY_NUMBER = "Copy Number";
95 public static final String DESTINATION_FIELD_CALL_NUMBER_TYPE = "Call Number Type";
96 public static final String DESTINATION_FIELD_CALL_NUMBER_TYPE_PREFIX = "Call Number Prefix";
97 public static final String DESTINATION_ITEM_TYPE = "Item Type";
98 public static final String DESTINATION_ITEM_STATUS = "Item Status";
99 public static final String LCC = "LCC";
100 public static final String DESTINATION_FIELD_ITEM_HOLDINGS_CALL_NUMBER = "Holdings Call Number";
101 public static final String DESTINATION_FIELD_ITEM_HOLDINGS_CALL_NUMBER_TYPE = "Holdings Call Number Type";
102 public static final String DESTINATION_FIELD_ITEM_HOLDINGS_COPY_NUMBER = "Holdings Copy Number";
103 public static final String DESTINATION_FIELD_ITEM_HOLDINGS_CALL_NUMBER_PREFIX = "Holdings Call Number Prefix";
104 public static final String DESTINATION_FIELD_LOCATION_LEVEL_1 = "Location Level1";
105 public static final String DESTINATION_FIELD_LOCATION_LEVEL_2 = "Location Level2";
106 public static final String DESTINATION_FIELD_LOCATION_LEVEL_3 = "Location Level3";
107 public static final String DESTINATION_FIELD_LOCATION_LEVEL_4 = "Location Level4";
108 public static final String DESTINATION_FIELD_LOCATION_LEVEL_5 = "Location Level5";
109 public static final String DESTINATION_FIELD_ITEM_HOLDINGS_LOCATION_LEVEL_1 = "Holdings Location Level1";
110 public static final String DESTINATION_FIELD_ITEM_HOLDINGS_LOCATION_LEVEL_2 = "Holdings Location Level2";
111 public static final String DESTINATION_FIELD_ITEM_HOLDINGS_LOCATION_LEVEL_3 = "Holdings Location Level3";
112 public static final String DESTINATION_FIELD_ITEM_HOLDINGS_LOCATION_LEVEL_4 = "Holdings Location Level4";
113 public static final String DESTINATION_FIELD_ITEM_HOLDINGS_LOCATION_LEVEL_5 = "Holdings Location Level5";
114 protected String callNumberType;
115 protected String callNumberPrefix;
116 protected String itemStatus;
117 protected String volumeNumber;
118 protected String itemType;
119 protected String locationName;
120 protected String chronology;
121 protected String enumeration;
122 protected String copyNumber;
123 protected String barcode;
124 protected String shelvingOrder;
125 protected String location;
126 protected String callNumber;
127 @XmlElement(name = "holdingsDoc")
128 protected Holdings holding;
129 @XmlElement(name = "holdingsDocs")
130 protected List<Holdings> holdings;
131 protected boolean isAnalytic = false;
132 @XmlTransient
133 protected String locationLevel1;
134 @XmlTransient
135 protected String locationLevel2;
136 @XmlTransient
137 protected String locationLevel3;
138 @XmlTransient
139 protected String locationLevel4;
140 @XmlTransient
141 protected String locationLevel5;
142
143 @XmlTransient
144 protected String level1Location;
145 @XmlTransient
146 protected String level2Location;
147 @XmlTransient
148 protected String level3Location;
149 @XmlTransient
150 protected String level4Location;
151 @XmlTransient
152 protected String level5Location;
153
154 public String getLevel1Location() {
155 return level1Location;
156 }
157
158 public void setLevel1Location(String level1Location) {
159 this.level1Location = level1Location;
160 }
161
162 public String getLevel5Location() {
163 return level5Location;
164 }
165
166 public void setLevel5Location(String level5Location) {
167 this.level5Location = level5Location;
168 }
169
170 public String getLevel4Location() {
171 return level4Location;
172 }
173
174 public void setLevel4Location(String level4Location) {
175 this.level4Location = level4Location;
176 }
177
178 public String getLevel3Location() {
179 return level3Location;
180 }
181
182 public void setLevel3Location(String level3Location) {
183 this.level3Location = level3Location;
184 }
185
186 public String getLevel2Location() {
187 return level2Location;
188 }
189
190 public void setLevel2Location(String level2Location) {
191 this.level2Location = level2Location;
192 }
193
194 public Item() {
195 category = DocCategory.WORK.getCode();
196 type = DocType.ITEM.getCode();
197 format = DocFormat.OLEML.getCode();
198 }
199
200 public String getLocationLevel1() {
201 return locationLevel1;
202 }
203
204 public void setLocationLevel1(String locationLevel1) {
205 this.locationLevel1 = locationLevel1;
206 }
207
208 public String getLocationLevel2() {
209 return locationLevel2;
210 }
211
212 public void setLocationLevel2(String locationLevel2) {
213 this.locationLevel2 = locationLevel2;
214 }
215
216 public String getLocationLevel3() {
217 return locationLevel3;
218 }
219
220 public void setLocationLevel3(String locationLevel3) {
221 this.locationLevel3 = locationLevel3;
222 }
223
224 public String getLocationLevel4() {
225 return locationLevel4;
226 }
227
228 public void setLocationLevel4(String locationLevel4) {
229 this.locationLevel4 = locationLevel4;
230 }
231
232 public String getLocationLevel5() {
233
234 return locationLevel5;
235 }
236
237 public void setLocationLevel5(String locationLevel5) {
238 this.locationLevel5 = locationLevel5;
239 }
240
241
242
243
244
245
246
247 public String getCallNumberType() {
248 return callNumberType;
249 }
250
251
252
253
254
255
256
257 public void setCallNumberType(String value) {
258 this.callNumberType = value;
259 }
260
261
262
263
264
265
266
267 public String getCallNumberPrefix() {
268 return callNumberPrefix;
269 }
270
271
272
273
274
275
276
277 public void setCallNumberPrefix(String value) {
278 this.callNumberPrefix = value;
279 }
280
281
282
283
284
285
286
287 public String getItemStatus() {
288 return itemStatus;
289 }
290
291
292
293
294
295
296
297 public void setItemStatus(String value) {
298 this.itemStatus = value;
299 }
300
301
302
303
304
305
306
307 public String getVolumeNumber() {
308 return volumeNumber;
309 }
310
311
312
313
314
315
316
317 public void setVolumeNumber(String value) {
318 this.volumeNumber = value;
319 }
320
321
322
323
324
325
326
327 public String getItemType() {
328 return itemType;
329 }
330
331
332
333
334
335
336
337 public void setItemType(String value) {
338 this.itemType = value;
339 }
340
341
342
343
344
345
346
347 public String getLocationName() {
348 return locationName;
349 }
350
351
352
353
354
355
356
357 public void setLocationName(String value) {
358 this.locationName = value;
359 }
360
361
362
363
364
365
366
367 public String getChronology() {
368 return chronology;
369 }
370
371
372
373
374
375
376
377 public void setChronology(String value) {
378 this.chronology = value;
379 }
380
381
382
383
384
385
386
387 public String getEnumeration() {
388 return enumeration;
389 }
390
391
392
393
394
395
396
397
398 public void setEnumeration(String value) {
399 this.enumeration = value;
400 }
401
402
403
404
405
406
407
408 public String getCopyNumber() {
409 return copyNumber;
410 }
411
412
413
414
415
416
417
418 public void setCopyNumber(String value) {
419 this.copyNumber = value;
420 }
421
422
423
424
425
426
427
428 public String getBarcode() {
429 return barcode;
430 }
431
432
433
434
435
436
437
438 public void setBarcode(String value) {
439 this.barcode = value;
440 }
441
442
443
444
445
446
447
448 public String getShelvingOrder() {
449 return shelvingOrder;
450 }
451
452
453
454
455
456
457
458 public void setShelvingOrder(String value) {
459 this.shelvingOrder = value;
460 }
461
462
463
464
465
466
467
468 public String getLocation() {
469 return location;
470 }
471
472
473
474
475
476
477
478 public void setLocation(String value) {
479 this.location = value;
480 }
481
482
483
484
485
486
487
488 public String getCallNumber() {
489 return callNumber;
490 }
491
492
493
494
495
496
497
498 public void setCallNumber(String value) {
499 this.callNumber = value;
500 }
501
502
503
504
505
506
507
508 public Holdings getHolding() {
509 return holding;
510 }
511
512
513
514
515
516
517
518 public void setHolding(Holdings value) {
519 this.holding = value;
520 }
521
522 public boolean isAnalytic() {
523 return isAnalytic;
524 }
525
526 public void setAnalytic(boolean analytic) {
527 isAnalytic = analytic;
528 }
529
530 public List<Holdings> getHoldings() {
531 return holdings;
532 }
533
534 public void setHoldings(List<Holdings> holdings) {
535 this.holdings = holdings;
536 }
537
538 @Override
539 public String serialize(Object object) {
540 String result = null;
541 StringWriter sw = new StringWriter();
542 Item item = (Item) object;
543 try {
544 JAXBContext jaxbContext = JAXBContext.newInstance(Item.class);
545 Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
546 jaxbMarshaller.marshal(item, sw);
547 result = sw.toString();
548 } catch (Exception e) {
549 LOG.error("Exception ", e);
550 }
551 return result;
552 }
553
554 @Override
555 public Object deserialize(String content) {
556
557 JAXBElement<Item> itemElement = null;
558 try {
559 JAXBContext jaxbContext = JAXBContext.newInstance(Item.class);
560 Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
561 ByteArrayInputStream input = new ByteArrayInputStream(content.getBytes("UTF-8"));
562 itemElement = jaxbUnmarshaller.unmarshal(new StreamSource(input), Item.class);
563 } catch (Exception e) {
564 LOG.error("Exception ", e);
565 }
566 return itemElement.getValue();
567 }
568
569 @Override
570 public Object deserializeContent(Object object) {
571
572
573 return null;
574 }
575
576 @Override
577 public Object deserializeContent(String content) {
578 return null;
579 }
580
581 @Override
582 public String serializeContent(Object object) {
583 if (object == null) {
584 object = getContentObject();
585 }
586 LocationLevel locationLevel1 = new LocationLevel();
587 LocationLevel locationLevel2 = new LocationLevel();
588 LocationLevel locationLevel3 = new LocationLevel();
589 LocationLevel locationLevel4 = new LocationLevel();
590 LocationLevel locationLevel5 = new LocationLevel();
591
592 locationLevel1.setName(getLocationLevel1());
593 locationLevel2.setName(getLocationLevel2());
594 locationLevel3.setName(getLocationLevel3());
595 locationLevel4.setName(getLocationLevel4());
596 locationLevel5.setName(getLocationLevel5());
597 locationLevel1.setLocationLevel(locationLevel2);
598 locationLevel2.setLocationLevel(locationLevel3);
599 locationLevel3.setLocationLevel(locationLevel4);
600 locationLevel4.setLocationLevel(locationLevel5);
601 Location locationPojo = new Location();
602 locationPojo.setLocationLevel(locationLevel1);
603 org.kuali.ole.docstore.common.document.content.instance.Item itemPojo = (org.kuali.ole.docstore.common.document.content.instance.Item) object;
604 itemPojo.setLocation(locationPojo);
605 ItemOlemlRecordProcessor itemOlemlRecordProcessor = new ItemOlemlRecordProcessor();
606 String itemXml = itemOlemlRecordProcessor.toXML(itemPojo);
607 return itemXml;
608 }
609
610 public void serializeContent() {
611 if (contentObject == null) {
612 return;
613 }
614 Location locationPojo = buildLocationObj();
615 org.kuali.ole.docstore.common.document.content.instance.Item itemPojo = (org.kuali.ole.docstore.common.document.content.instance.Item) contentObject;
616 itemPojo.setLocation(locationPojo);
617 ItemOlemlRecordProcessor itemOlemlRecordProcessor = new ItemOlemlRecordProcessor();
618 content = itemOlemlRecordProcessor.toXML(itemPojo);
619 }
620
621 public void setField(String docField, String fieldValue) {
622 org.kuali.ole.docstore.common.document.content.instance.Item itemPojo = (org.kuali.ole.docstore.common.document.content.instance.Item) getContentObject();
623
624
625 if (docField.equalsIgnoreCase(DESTINATION_FIELD_ITEM_ITEM_BARCODE)) {
626 if (itemPojo.getAccessInformation() == null) {
627 AccessInformation accessInformation = new AccessInformation();
628 itemPojo.setAccessInformation(accessInformation);
629 }
630 itemPojo.getAccessInformation().setBarcode(fieldValue);
631 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_CALL_NUMBER)) {
632
633 buildItemCallNumber(itemPojo);
634 itemPojo.getCallNumber().setNumber(fieldValue);
635 String callNumberType = itemPojo.getCallNumber().getShelvingScheme().getCodeValue();
636 if(StringUtils.isEmpty(callNumberType)) {
637 itemPojo.getCallNumber().getShelvingScheme().setCodeValue(LCC);
638 }
639 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_CALL_NUMBER_TYPE)) {
640 buildItemCallNumber(itemPojo);
641 itemPojo.getCallNumber().getShelvingScheme().setCodeValue(fieldValue);
642
643 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_CALL_NUMBER_TYPE_PREFIX)) {
644 buildItemCallNumber(itemPojo);
645 itemPojo.getCallNumber().setPrefix(fieldValue);
646 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_COPY_NUMBER)) {
647 itemPojo.setCopyNumber(fieldValue);
648 } else if (docField.equalsIgnoreCase(DESTINATION_ITEM_TYPE)) {
649 ItemType itemType1 = new ItemType();
650 itemType1.setCodeValue(fieldValue);
651 itemPojo.setItemType(itemType1);
652 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_ITEM_HOLDINGS_CALL_NUMBER)) {
653
654
655
656
657
658
659 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_LOCATION_LEVEL_1)) {
660 setLocationLevel1(fieldValue);
661 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_LOCATION_LEVEL_2)) {
662 setLocationLevel2(fieldValue);
663 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_LOCATION_LEVEL_3)) {
664 setLocationLevel3(fieldValue);
665 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_LOCATION_LEVEL_4)) {
666 setLocationLevel4(fieldValue);
667 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_LOCATION_LEVEL_5)) {
668 setLocationLevel5(fieldValue);
669 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_ITEM_HOLDINGS_CALL_NUMBER_TYPE)) {
670
671
672 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_ITEM_HOLDINGS_LOCATION_LEVEL_1)) {
673
674 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_ITEM_HOLDINGS_LOCATION_LEVEL_2)) {
675
676 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_ITEM_HOLDINGS_LOCATION_LEVEL_3)) {
677
678 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_ITEM_HOLDINGS_LOCATION_LEVEL_4)) {
679
680 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_ITEM_HOLDINGS_LOCATION_LEVEL_5)) {
681
682 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_ITEM_HOLDINGS_COPY_NUMBER)) {
683
684 } else if (docField.equalsIgnoreCase(DESTINATION_FIELD_ITEM_HOLDINGS_CALL_NUMBER_PREFIX)) {
685
686
687 } else if (docField.equalsIgnoreCase(DESTINATION_ITEM_STATUS)) {
688 ItemStatus itemStatus1 = new ItemStatus();
689 itemStatus1.setCodeValue(fieldValue);
690 itemPojo.setItemStatus(itemStatus1);
691 }
692
693 }
694
695 private void buildItemCallNumber(org.kuali.ole.docstore.common.document.content.instance.Item itemPojo) {
696 if (itemPojo.getCallNumber() == null) {
697 CallNumber callNumberPojo = new CallNumber();
698 ShelvingOrder shelvingOrder1 = new ShelvingOrder();
699 ShelvingScheme shelvingScheme1 = new ShelvingScheme();
700 callNumberPojo.setShelvingScheme(shelvingScheme1);
701 callNumberPojo.setShelvingOrder(shelvingOrder1);
702 itemPojo.setCallNumber(callNumberPojo);
703 }
704 }
705
706 public Object getContentObject() {
707 if (contentObject == null) {
708 contentObject = new org.kuali.ole.docstore.common.document.content.instance.Item();
709 }
710 return contentObject;
711 }
712
713
714 public Location buildLocationObj() {
715
716 LocationLevel locationLevel1 = new LocationLevel();
717 locationLevel1.setName(getLocationLevel1());
718 locationLevel1.setLevel(getLevel1Location());
719 LocationLevel locationLevel2 = new LocationLevel();
720 locationLevel2.setName(getLocationLevel2());
721 locationLevel2.setLevel(getLevel2Location());
722 LocationLevel locationLevel3 = new LocationLevel();
723 locationLevel3.setName(getLocationLevel3());
724 locationLevel3.setLevel(getLevel3Location());
725 LocationLevel locationLevel4 = new LocationLevel();
726 locationLevel4.setName(getLocationLevel4());
727 locationLevel4.setLevel(getLevel4Location());
728 LocationLevel locationLevel5 = new LocationLevel();
729 locationLevel5.setName(getLocationLevel5());
730 locationLevel5.setLevel(getLevel5Location());
731
732 List<LocationLevel> locationLevels = new ArrayList<>();
733
734 if (StringUtils.isNotEmpty(locationLevel1.getName())) {
735 locationLevels.add(locationLevel1);
736 }
737 if (StringUtils.isNotEmpty(locationLevel2.getName())) {
738 locationLevels.add(locationLevel2);
739 }
740 if (StringUtils.isNotEmpty(locationLevel3.getName())) {
741 locationLevels.add(locationLevel3);
742 }
743 if (StringUtils.isNotEmpty(locationLevel4.getName())) {
744 locationLevels.add(locationLevel4);
745 }
746 if (StringUtils.isNotEmpty(locationLevel5.getName())) {
747 locationLevels.add(locationLevel5);
748 }
749
750 int locationLevelSize = locationLevels.size();
751
752 for (int i = 0; i < locationLevelSize; i++) {
753 if ((locationLevelSize - 1) != i) {
754 locationLevels.get(i).setLocationLevel(locationLevels.get(i + 1));
755 }
756 }
757
758 Location locationPojo = new Location();
759 if (locationLevels.size() > 0) {
760 locationPojo.setLocationLevel(locationLevels.get(0));
761 }
762
763 return locationPojo;
764 }
765
766
767 @Override
768 public int compareTo(Item o) {
769 return this.getSortedValue().compareTo(o.getSortedValue());
770 }
771
772
773 public void setItem(Item itemIncoming) throws ConversionException {
774 ItemOlemlRecordProcessor itemOlemlRecordProcessor = new ItemOlemlRecordProcessor();
775 org.kuali.ole.docstore.common.document.content.instance.Item incomingItemContent = itemOlemlRecordProcessor.fromXML(itemIncoming.getContent());
776 org.kuali.ole.docstore.common.document.content.instance.Item existingItemContent = itemOlemlRecordProcessor.fromXML(this.getContent());
777
778 this.setId(existingItemContent.getItemIdentifier());
779
780 if (StringUtils.isNotBlank(itemIncoming.getUpdatedBy())) {
781 this.updatedBy = itemIncoming.getUpdatedBy();
782 } else {
783 this.updatedBy = "UNKNOWN";
784 }
785 if (incomingItemContent.getLocation() != null) {
786 existingItemContent.setLocation(incomingItemContent.getLocation());
787 }
788 if (incomingItemContent.getCallNumber() != null) {
789 existingItemContent.setCallNumber(incomingItemContent.getCallNumber());
790 }
791 if (StringUtils.isNotBlank(incomingItemContent.getChronology())) {
792 existingItemContent.setChronology(incomingItemContent.getChronology());
793 }
794 if (StringUtils.isNotBlank(incomingItemContent.getEnumeration())) {
795 existingItemContent.setEnumeration(incomingItemContent.getEnumeration());
796 }
797 if (StringUtils.isNotBlank(incomingItemContent.getCopyNumber())) {
798 existingItemContent.setCopyNumber(incomingItemContent.getCopyNumber());
799 }
800 if (incomingItemContent.getItemStatus() != null) {
801 existingItemContent.setItemStatus(incomingItemContent.getItemStatus());
802 }
803 if (incomingItemContent.getItemType() != null) {
804 existingItemContent.setItemType(incomingItemContent.getItemType());
805 }
806 if (StringUtils.isNotBlank(incomingItemContent.getBarcodeARSL())) {
807 existingItemContent.setBarcodeARSL(incomingItemContent.getBarcodeARSL());
808 }
809 if (StringUtils.isNotBlank(incomingItemContent.getVolumeNumber())) {
810 existingItemContent.setVolumeNumber(incomingItemContent.getVolumeNumber());
811 }
812 if (StringUtils.isNotBlank(incomingItemContent.getCheckinNote())) {
813 existingItemContent.setCheckinNote(incomingItemContent.getCheckinNote());
814 }
815 if (StringUtils.isNotBlank(incomingItemContent.getCurrentBorrower())) {
816 existingItemContent.setCurrentBorrower(incomingItemContent.getCurrentBorrower());
817 }
818 if (StringUtils.isNotBlank(incomingItemContent.getClaimsReturnedFlagCreateDate())) {
819 existingItemContent.setClaimsReturnedFlagCreateDate(incomingItemContent.getClaimsReturnedFlagCreateDate());
820 }
821 if (StringUtils.isNotBlank(incomingItemContent.getAnalytic())) {
822 existingItemContent.setAnalytic(incomingItemContent.getAnalytic());
823 }
824 if (StringUtils.isNotBlank(incomingItemContent.getDueDateTime())) {
825 existingItemContent.setDueDateTime(incomingItemContent.getDueDateTime());
826 }
827 if (StringUtils.isNotBlank(incomingItemContent.getDamagedItemNote())) {
828 existingItemContent.setDamagedItemNote(incomingItemContent.getDamagedItemNote());
829 }
830 if (StringUtils.isNotBlank(incomingItemContent.getItemStatusEffectiveDate())) {
831 existingItemContent.setItemStatusEffectiveDate(incomingItemContent.getItemStatusEffectiveDate());
832 }
833 if (StringUtils.isNotBlank(incomingItemContent.getMissingPieceEffectiveDate())) {
834 existingItemContent.setMissingPieceEffectiveDate(incomingItemContent.getMissingPieceEffectiveDate());
835 }
836 if (StringUtils.isNotBlank(incomingItemContent.getClaimsReturnedNote())) {
837 existingItemContent.setClaimsReturnedNote(incomingItemContent.getClaimsReturnedNote());
838 }
839 if (StringUtils.isNotBlank(incomingItemContent.getProxyBorrower())) {
840 existingItemContent.setProxyBorrower(incomingItemContent.getProxyBorrower());
841 }
842 if (StringUtils.isNotBlank(incomingItemContent.getMissingPieceFlagNote())) {
843 existingItemContent.setMissingPieceFlagNote(incomingItemContent.getMissingPieceFlagNote());
844 }
845 if (StringUtils.isNotBlank(incomingItemContent.getMissingPiecesCount())) {
846 existingItemContent.setMissingPiecesCount(incomingItemContent.getMissingPiecesCount());
847 }
848 if (incomingItemContent.getAccessInformation() != null) {
849 if(StringUtils.isNotBlank(incomingItemContent.getAccessInformation().getBarcode())) {
850 existingItemContent.getAccessInformation().setBarcode(incomingItemContent.getAccessInformation().getBarcode());
851 }
852 if(incomingItemContent.getAccessInformation().getUri()!=null){
853 existingItemContent.getAccessInformation().setUri(incomingItemContent.getAccessInformation().getUri());
854 }
855 }
856 if (incomingItemContent.getTemporaryItemType() != null) {
857 existingItemContent.setTemporaryItemType(incomingItemContent.getTemporaryItemType());
858 }
859 if (incomingItemContent.getStatisticalSearchingCode() != null) {
860 existingItemContent.setStatisticalSearchingCode(incomingItemContent.getStatisticalSearchingCode());
861 }
862 if (incomingItemContent.getNumberOfCirculations() != null) {
863 existingItemContent.setNumberOfCirculations(incomingItemContent.getNumberOfCirculations());
864 }
865 if (incomingItemContent.getDonorInfo() != null) {
866 existingItemContent.setDonorInfo(incomingItemContent.getDonorInfo());
867 }
868 if (incomingItemContent.getHighDensityStorage() != null) {
869 existingItemContent.setHighDensityStorage(incomingItemContent.getHighDensityStorage());
870 }
871 if (incomingItemContent.getNote() != null) {
872 existingItemContent.setNote(incomingItemContent.getNote());
873 }
874 if (incomingItemContent.getFormerIdentifier() != null) {
875 existingItemContent.setFormerIdentifier(incomingItemContent.getFormerIdentifier());
876 }
877 if (StringUtils.isNotBlank(incomingItemContent.getVolumeNumberLabel())) {
878 existingItemContent.setVolumeNumberLabel(incomingItemContent.getVolumeNumberLabel());
879 }
880 if (StringUtils.isNotBlank(incomingItemContent.getVendorLineItemIdentifier())) {
881 existingItemContent.setVendorLineItemIdentifier(incomingItemContent.getVendorLineItemIdentifier());
882 }
883 if (StringUtils.isNotBlank(incomingItemContent.getPurchaseOrderLineItemIdentifier())) {
884 existingItemContent.setPurchaseOrderLineItemIdentifier(incomingItemContent.getPurchaseOrderLineItemIdentifier());
885 }
886 if (StringUtils.isNotBlank(incomingItemContent.getResourceIdentifier())) {
887 existingItemContent.setResourceIdentifier(incomingItemContent.getResourceIdentifier());
888 }
889 if (incomingItemContent.isStaffOnlyFlag() != existingItemContent.isStaffOnlyFlag()) {
890 existingItemContent.setStaffOnlyFlag(incomingItemContent.isStaffOnlyFlag());
891 this.setStaffOnly(incomingItemContent.isStaffOnlyFlag());
892
893 }
894 this.setContent(itemOlemlRecordProcessor.toXML(existingItemContent));
895 }
896
897
898 }