View Javadoc
1   package org.kuali.ole.docstore.common.document.content.instance;
2   
3   import com.thoughtworks.xstream.annotations.XStreamAlias;
4   import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
5   import com.thoughtworks.xstream.annotations.XStreamImplicit;
6   
7   import javax.xml.bind.JAXBContext;
8   import javax.xml.bind.Marshaller;
9   import javax.xml.bind.annotation.*;
10  import java.io.StringWriter;
11  import java.sql.Timestamp;
12  import java.util.ArrayList;
13  import java.util.List;
14  
15  
16  /**
17   * Created by IntelliJ IDEA.
18   * User: Pranitha
19   * Date: 8/17/12
20   * Time: 10:47 AM
21   * To change this template use File | Settings | File Templates.
22   * <p/>
23   * This section can be used to record general holdings information if not using a specific
24   * source holdings.
25   * <p/>
26   * <p/>
27   * <p>Java class for oleHoldings complex type.
28   * <p/>
29   * <p>The following schema fragment specifies the expected content contained within this class.
30   * <p/>
31   * <pre>
32   * &lt;complexType name="oleHoldings">
33   *   &lt;complexContent>
34   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
35   *       &lt;sequence>
36   *         &lt;element name="holdingsIdentifier" type="{http://www.w3.org/2001/XMLSchema}string"/>
37   *         &lt;element name="extentOfOwnership" type="{http://ole.kuali.org/standards/ole-instance}extentOfOwnership" maxOccurs="unbounded" minOccurs="0"/>
38   *         &lt;element name="receiptStatus" type="{http://www.w3.org/2001/XMLSchema}string"/>
39   *         &lt;element name="uri" type="{http://ole.kuali.org/standards/ole-instance}uri" maxOccurs="unbounded" minOccurs="0"/>
40   *         &lt;element name="note" type="{http://ole.kuali.org/standards/ole-instance}note" maxOccurs="unbounded" minOccurs="0"/>
41   *         &lt;element name="location" type="{http://ole.kuali.org/standards/ole-instance}location"/>
42   *         &lt;element name="extension" type="{http://ole.kuali.org/standards/ole-instance}extension"/>
43   *         &lt;element name="callNumber" type="{http://ole.kuali.org/standards/ole-instance}callNumber"/>
44   *       &lt;/sequence>
45   *       &lt;attribute name="primary" type="{http://www.w3.org/2001/XMLSchema}string" />
46   *     &lt;/restriction>
47   *   &lt;/complexContent>
48   * &lt;/complexType>
49   * </pre>
50   */
51  @XmlAccessorType(XmlAccessType.FIELD)
52  @XmlType(name = "oleHoldings", propOrder = {
53          "holdingsType",
54          "bibIdentifier",
55          "holdingsIdentifier",
56          "extentOfOwnership",
57          "receiptStatus",
58          "uri",
59          "note",
60          "location",
61          "extension",
62          "callNumber",
63          "copyNumber",
64          "publisher",
65          "imprint",
66          "localPersistentLink",
67          "link",
68          "interLibraryLoanAllowed",
69          "staffOnlyFlag",
70          "donorPublicDisplay",
71          "donorNote",
72          "accessStatus",
73          "statusDate",
74          "statisticalSearchingCode",
75          "eResourceId",
76          "holdingsAccessInformation",
77          "platform",
78          "subscriptionStatus",
79          "donorInfo",
80          })
81  @XStreamAlias("oleHoldings")
82  @XmlRootElement(name = "oleHoldings")
83  public class OleHoldings {
84  
85      @XmlElement(required = true)
86      protected String holdingsType;
87      @XmlElement(required = true)
88      protected String holdingsIdentifier;
89      @XmlElement(name = "resourceIdentifier")
90      protected String bibIdentifier;
91      @XStreamImplicit(itemFieldName = "extentOfOwnership")
92      protected List<ExtentOfOwnership> extentOfOwnership;
93      @XmlElement(required = true)
94      protected String receiptStatus;
95      @XStreamImplicit(itemFieldName = "uri")
96      protected List<Uri> uri;
97      @XStreamImplicit(itemFieldName = "note")
98      protected List<Note> note;
99      @XmlElement(required = true)
100     protected Location location;
101     @XmlElement(required = true)
102     protected Extension extension;
103     @XmlElement(required = true)
104     protected CallNumber callNumber;
105     @XmlElement(required = true)
106     protected String copyNumber;
107     @XmlAttribute
108     @XStreamAsAttribute
109     protected String primary;
110     protected String publisher;
111     protected String imprint;
112     @XmlSchemaType(name = "anyURI")
113     protected String localPersistentLink;
114     protected List<Link> link;
115     protected boolean interLibraryLoanAllowed;
116     protected boolean staffOnlyFlag;
117     protected String donorPublicDisplay;
118     protected String donorNote;
119     protected String accessStatus;
120     protected String statusDate;
121     protected StatisticalSearchingCode statisticalSearchingCode;
122     protected String eResourceId;
123     protected HoldingsAccessInformation holdingsAccessInformation;
124     @XmlElement(required = true)
125     protected Platform platform;
126     protected String subscriptionStatus;
127     protected List<DonorInfo> donorInfo;
128 
129 
130 //    @XmlElement(name = , required = true)
131 //    protected String createdBy;
132 //    @XmlElement(name = , required = false)
133 //    protected String updatedBy;
134 //    @XmlElement(name = , required = true)
135 //    protected Timestamp createdDate;
136 //    @XmlElement(name = , required = false)
137 //    protected Timestamp updatedDate;
138 
139 
140 //    public String getCreatedBy() {
141 //        return createdBy;
142 //    }
143 //
144 //    public void setCreatedBy(String createdBy) {
145 //        this.createdBy = createdBy;
146 //    }
147 //
148 //    public String getUpdatedBy() {
149 //        return updatedBy;
150 //    }
151 //
152 //    public void setUpdatedBy(String updatedBy) {
153 //        this.updatedBy = updatedBy;
154 //    }
155 //
156 //    public Timestamp getCreatedDate() {
157 //        return createdDate;
158 //    }
159 //
160 //    public void setCreatedDate(Timestamp createdDate) {
161 //        this.createdDate = createdDate;
162 //    }
163 //
164 //    public Timestamp getUpdatedDate() {
165 //        return updatedDate;
166 //    }
167 //
168 //    public void setUpdatedDate(Timestamp updatedDate) {
169 //        this.updatedDate = updatedDate;
170 //    }
171 
172     public String getHoldingsType() {
173         return holdingsType;
174     }
175 
176     public void setHoldingsType(String holdingsType) {
177         this.holdingsType = holdingsType;
178     }
179 
180     /**
181      * Gets the value of the holdingsIdentifier property.
182      *
183      * @return possible object is
184      *         {@link String }
185      */
186     public String getHoldingsIdentifier() {
187         return holdingsIdentifier;
188     }
189 
190     /**
191      * Sets the value of the holdingsIdentifier property.
192      *
193      * @param value allowed object is
194      *              {@link String }
195      */
196     public void setHoldingsIdentifier(String value) {
197         this.holdingsIdentifier = value;
198     }
199 
200     /**
201      * Gets the value of the extentOfOwnership property.
202      * <p/>
203      * <p/>
204      * This accessor method returns a reference to the live list,
205      * not a snapshot. Therefore any modification you make to the
206      * returned list will be present inside the JAXB object.
207      * This is why there is not a <CODE>set</CODE> method for the extentOfOwnership property.
208      * <p/>
209      * <p/>
210      * For example, to add a new item, do as follows:
211      * <pre>
212      *    getExtentOfOwnership().add(newItem);
213      * </pre>
214      * <p/>
215      * <p/>
216      * <p/>
217      * Objects of the following type(s) are allowed in the list
218      * {@link ExtentOfOwnership }
219      */
220     public List<ExtentOfOwnership> getExtentOfOwnership() {
221         if (extentOfOwnership == null) {
222             extentOfOwnership = new ArrayList<ExtentOfOwnership>();
223         }
224         return this.extentOfOwnership;
225     }
226 
227     /**
228      * @param extentOfOwnership
229      */
230     public void setExtentOfOwnership(List<ExtentOfOwnership> extentOfOwnership) {
231         this.extentOfOwnership = extentOfOwnership;
232     }
233 
234     /**
235      * Gets the value of the receiptStatus property.
236      *
237      * @return possible object is
238      *         {@link String }
239      */
240     public String getReceiptStatus() {
241         return receiptStatus;
242     }
243 
244     /**
245      * Sets the value of the receiptStatus property.
246      *
247      * @param value allowed object is
248      *              {@link String }
249      */
250     public void setReceiptStatus(String value) {
251         this.receiptStatus = value;
252     }
253 
254     /**
255      * Gets the value of the uri property.
256      * <p/>
257      * <p/>
258      * This accessor method returns a reference to the live list,
259      * not a snapshot. Therefore any modification you make to the
260      * returned list will be present inside the JAXB object.
261      * This is why there is not a <CODE>set</CODE> method for the uri property.
262      * <p/>
263      * <p/>
264      * For example, to add a new item, do as follows:
265      * <pre>
266      *    getUri().add(newItem);
267      * </pre>
268      * <p/>
269      * <p/>
270      * <p/>
271      * Objects of the following type(s) are allowed in the list
272      * {@link Uri }
273      */
274     public List<Uri> getUri() {
275         if (uri == null) {
276             uri = new ArrayList<Uri>();
277         }
278         return this.uri;
279     }
280 
281     /**
282      * @param uri
283      */
284     public void setUri(List<Uri> uri) {
285         this.uri = uri;
286     }
287 
288     /**
289      * Gets the value of the holdingsNote property.
290      * <p/>
291      * <p/>
292      * This accessor method returns a reference to the live list,
293      * not a snapshot. Therefore any modification you make to the
294      * returned list will be present inside the JAXB object.
295      * This is why there is not a <CODE>set</CODE> method for the note property.
296      * <p/>
297      * <p/>
298      * For example, to add a new item, do as follows:
299      * <pre>
300      *    getNote().add(newItem);
301      * </pre>
302      * <p/>
303      * <p/>
304      * <p/>
305      * Objects of the following type(s) are allowed in the list
306      * {@link org.kuali.ole.docstore.common.document.content.instance.Note }
307      */
308     public List<Note> getNote() {
309         if (note == null) {
310             note = new ArrayList<Note>();
311         }
312         return this.note;
313     }
314 
315     /**
316      * @param note
317      */
318     public void setNote(List<Note> note) {
319         this.note = note;
320     }
321 
322     /**
323      * Gets the value of the location property.
324      *
325      * @return possible object is
326      *         {@link org.kuali.ole.docstore.common.document.content.instance.Location }
327      */
328     public Location getLocation() {
329         return location;
330     }
331 
332     /**
333      * Sets the value of the location property.
334      *
335      * @param value allowed object is
336      *              {@link org.kuali.ole.docstore.common.document.content.instance.Location }
337      */
338     public void setLocation(Location value) {
339         this.location = value;
340     }
341 
342     /**
343      * Gets the value of the extension property.
344      *
345      * @return possible object is
346      *         {@link Extension }
347      */
348     public Extension getExtension() {
349         return extension;
350     }
351 
352     /**
353      * Sets the value of the extension property.
354      *
355      * @param value allowed object is
356      *              {@link Extension }
357      */
358     public void setExtension(Extension value) {
359         this.extension = value;
360     }
361 
362     /**
363      * Gets the value of the callNumber property.
364      *
365      * @return possible object is
366      *         {@link CallNumber }
367      */
368     public CallNumber getCallNumber() {
369         return callNumber;
370     }
371 
372     /**
373      * Sets the value of the callNumber property.
374      *
375      * @param value allowed object is
376      *              {@link CallNumber }
377      */
378     public void setCallNumber(CallNumber value) {
379         this.callNumber = value;
380     }
381 
382     /**
383      * Gets the value of the copyNumber property.
384      *
385      * @return possible object is
386      *         {@link String }
387      */
388     public String getCopyNumber() {
389         return copyNumber;
390     }
391 
392     /**
393      * Sets the value of the copyNumber property.
394      *
395      * @param value allowed object is
396      *              {@link String }
397      */
398     public void setCopyNumber(String value) {
399         this.copyNumber = value;
400     }
401 
402     /**
403      * Gets the value of the primary property.
404      *
405      * @return possible object is
406      *         {@link String }
407      */
408     public String getPrimary() {
409         return primary;
410     }
411 
412     /**
413      * Sets the value of the primary property.
414      *
415      * @param value allowed object is
416      *              {@link String }
417      */
418     public void setPrimary(String value) {
419         this.primary = value;
420     }
421 
422     /**
423      * Gets the value of the publisher property.
424      *
425      * @return possible object is
426      *         {@link String }
427      */
428     public String getPublisher() {
429         return publisher;
430     }
431 
432     /**
433      * Sets the value of the publisher property.
434      *
435      * @param value allowed object is
436      *              {@link String }
437      */
438     public void setPublisher(String value) {
439         this.publisher = value;
440     }
441 
442     /**
443      * Gets the value of the imprint property.
444      *
445      * @return possible object is
446      *         {@link String }
447      */
448     public String getImprint() {
449         return imprint;
450     }
451 
452     /**
453      * Sets the value of the imprint property.
454      *
455      * @param value allowed object is
456      *              {@link String }
457      */
458     public void setImprint(String value) {
459         this.imprint = value;
460     }
461 
462     /**
463      * Gets the value of the localPersistentLink property.
464      *
465      * @return possible object is
466      *         {@link String }
467      */
468     public String getLocalPersistentLink() {
469         return localPersistentLink;
470     }
471 
472     /**
473      * Sets the value of the localPersistentLink property.
474      *
475      * @param value allowed object is
476      *              {@link String }
477      */
478     public void setLocalPersistentLink(String value) {
479         this.localPersistentLink = value;
480     }
481 
482     /**
483      * Gets the value of the link property.
484      *
485      * @return possible object is
486      *         {@link org.kuali.ole.docstore.common.document.content.instance.Link }
487      */
488     public List<Link> getLink() {
489         if (link == null){
490             link = new ArrayList<Link>();
491         }
492         return this.link;
493     }
494 
495     /**
496      * Sets the value of the link property.
497      *
498      * @param value allowed object is
499      *              {@link org.kuali.ole.docstore.common.document.content.instance.Link }
500      */
501     public void setLink(List<Link> value) {
502         this.link = value;
503     }
504 
505     /**
506      * Gets the value of the interLibraryLoanAllowed property.
507      */
508     public boolean isInterLibraryLoanAllowed() {
509         return interLibraryLoanAllowed;
510     }
511 
512     /**
513      * Sets the value of the interLibraryLoanAllowed property.
514      */
515     public void setInterLibraryLoanAllowed(boolean value) {
516         this.interLibraryLoanAllowed = value;
517     }
518 
519     /**
520      * Gets the value of the staffOnlyFlag property.
521      */
522     public boolean isStaffOnlyFlag() {
523         return staffOnlyFlag;
524     }
525 
526     /**
527      * Sets the value of the staffOnlyFlag property.
528      */
529     public void setStaffOnlyFlag(boolean value) {
530         this.staffOnlyFlag = value;
531     }
532     /**
533      * Gets the value of the donorPublicDisplay property.
534      *
535      * @return possible object is
536      *         {@link String }
537      */
538     public String getDonorPublicDisplay() {
539         return donorPublicDisplay;
540     }
541 
542     /**
543      * Sets the value of the donorPublicDisplay property.
544      *
545      * @param value allowed object is
546      *              {@link String }
547      */
548     public void setDonorPublicDisplay(String value) {
549         this.donorPublicDisplay = value;
550     }
551 
552     /**
553      * Gets the value of the donorNote property.
554      *
555      * @return possible object is
556      *         {@link String }
557      */
558     public String getDonorNote() {
559         return donorNote;
560     }
561 
562     /**
563      * Sets the value of the donorNote property.
564      *
565      * @param value allowed object is
566      *              {@link String }
567      */
568     public void setDonorNote(String value) {
569         this.donorNote = value;
570     }
571 
572     /**
573      * Gets the value of the accessStatus property.
574      *
575      * @return possible object is
576      *         {@link String }
577      */
578     public String getAccessStatus() {
579         return accessStatus;
580     }
581 
582     /**
583      * Sets the value of the accessStatus property.
584      *
585      * @param value allowed object is
586      *              {@link String }
587      */
588     public void setAccessStatus(String value) {
589         this.accessStatus = value;
590     }
591 
592     /**
593      * Gets the value of the statusDate property.
594      *
595      * @return possible object is
596      *         {@link String }
597      */
598     public String getStatusDate() {
599         return statusDate;
600     }
601 
602     /**
603      * Sets the value of the statusDate property.
604      *
605      * @param value allowed object is
606      *              {@link String }
607      */
608     public void setStatusDate(String value) {
609         this.statusDate = value;
610     }
611 
612     public StatisticalSearchingCode getStatisticalSearchingCode() {
613         return statisticalSearchingCode;
614     }
615 
616     public void setStatisticalSearchingCode(StatisticalSearchingCode statisticalSearchingCode) {
617         this.statisticalSearchingCode = statisticalSearchingCode;
618     }
619 
620     /**
621      * Gets the value of the eResourceId property.
622      *
623      * @return possible object is
624      *         {@link String }
625      */
626     public String getEResourceId() {
627         return eResourceId;
628     }
629 
630     /**
631      * Sets the value of the eResourceId property.
632      *
633      * @param value allowed object is
634      *              {@link String }
635      */
636     public void setEResourceId(String value) {
637         this.eResourceId = value;
638     }
639 
640     /**
641      * Gets the value of the accessInformation property.
642      *
643      * @return possible object is
644      *         {@link org.kuali.ole.docstore.common.document.content.instance.AccessInformation }
645      */
646     public HoldingsAccessInformation getHoldingsAccessInformation() {
647         return holdingsAccessInformation;
648     }
649 
650     /**
651      * Sets the value of the accessInformation property.
652      *
653      * @param value allowed object is
654      *              {@link org.kuali.ole.docstore.common.document.content.instance.AccessInformation }
655      */
656     public void setHoldingsAccessInformation(HoldingsAccessInformation value) {
657         this.holdingsAccessInformation = value;
658     }
659 
660     /**
661      * Gets the value of the platform property.
662      *
663      * @return possible object is
664      *         {@link org.kuali.ole.docstore.common.document.content.instance.Platform }
665      */
666     public Platform getPlatform() {
667         return platform;
668     }
669 
670     /**
671      * Sets the value of the platform property.
672      *
673      * @param value allowed object is
674      *              {@link org.kuali.ole.docstore.common.document.content.instance.Platform }
675      */
676     public void setPlatform(Platform value) {
677         this.platform = value;
678     }
679 
680     /**
681      * Gets the value of the subscriptionStatus property.
682      *
683      * @return possible object is
684      *         {@link String }
685      */
686     public String getSubscriptionStatus() {
687         return subscriptionStatus;
688     }
689 
690     /**
691      * Sets the value of the subscriptionStatus property.
692      *
693      * @param value allowed object is
694      *              {@link String }
695      */
696     public void setSubscriptionStatus(String value) {
697         this.subscriptionStatus = value;
698     }
699     public List<DonorInfo> getDonorInfo() {
700         if (donorInfo == null) {
701             donorInfo = new ArrayList<DonorInfo>();
702         }
703         return this.donorInfo;
704     }
705 
706     public void setDonorInfo(List<DonorInfo> value){
707         this.donorInfo= value;
708     }
709 
710     public String getBibIdentifier() {
711         return bibIdentifier;
712     }
713 
714     public void setBibIdentifier(String bibIdentifier) {
715         this.bibIdentifier = bibIdentifier;
716     }
717 
718     public String serialize(Object object) {
719         String result = null;
720         StringWriter sw = new StringWriter();
721         OleHoldings oleHoldings = (OleHoldings) object;
722         try {
723             JAXBContext jaxbContext = JAXBContext.newInstance(OleHoldings.class);
724             Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
725             jaxbMarshaller.marshal(oleHoldings, sw);
726             result = sw.toString();
727         } catch (Exception e) {
728             //LOG.error("Exception ", e);
729         }
730         return result;
731     }
732 
733 }