View Javadoc
1   package org.kuali.ole.docstore.model.bo;
2   
3   import org.apache.commons.collections.CollectionUtils;
4   import org.kuali.ole.docstore.model.enums.DocCategory;
5   import org.kuali.ole.docstore.model.enums.DocType;
6   
7   import java.util.ArrayList;
8   import java.util.List;
9   
10  /**
11   * Class for logical representation of OLE documents of category:Work and type:Bibliographic.
12   * User: tirumalesh.b
13   * Date: 1/2/12 Time: 2:59 PM
14   */
15  public class WorkBibDocument
16          extends OleDocument {
17  
18      protected List<String> localId = new ArrayList<String>();
19      protected List<String> titles = new ArrayList<String>();
20      protected List<String> authors = new ArrayList<String>();
21      protected List<String> subjects;
22      protected List<String> issns;
23      protected List<String> isbns;
24      protected List<String> publicationPlaces;
25      protected List<String> publishers = new ArrayList<String>();
26      protected List<String> descriptions;
27      protected List<String> publicationDates = new ArrayList<String>();
28      protected List<String> editions = new ArrayList<String>();
29      protected List<String> formGenres;
30      protected List<String> languages;
31      protected List<String> formats;
32      protected WorkInstanceDocument instanceDocument;
33      protected List<WorkInstanceDocument> workInstanceDocumentList;
34      protected String instanceIdentifier;
35      protected String docFormat;
36      protected String staffOnlyFlag;
37      protected WorkEInstanceDocument eInstanceDocument;
38      protected List<WorkEInstanceDocument> workEInstanceDocumentList;
39  
40      public List<String> getLocalId() {
41          return localId;
42      }
43  
44      public void setLocalId(List<String> localId) {
45          this.localId = localId;
46      }
47  
48      public String getStaffOnlyFlag() {
49          return staffOnlyFlag;
50      }
51  
52      public void setStaffOnlyFlag(String staffOnlyFlag) {
53          this.staffOnlyFlag = staffOnlyFlag;
54      }
55  
56      public WorkInstanceDocument getInstanceDocument() {
57          return instanceDocument;
58      }
59  
60      public void setInstanceDocument(WorkInstanceDocument instanceDocument) {
61          this.instanceDocument = instanceDocument;
62      }
63  
64      public WorkBibDocument() {
65          docCategory = DocCategory.WORK;
66          docType = DocType.BIB;
67      }
68  
69      /* Getters and Setters */
70      public List<String> getTitles() {
71          return titles;
72      }
73  
74      public void setTitles(List<String> titles) {
75          this.titles = titles;
76      }
77  
78      public List<String> getAuthors() {
79          return authors;
80      }
81  
82      public void setAuthors(List<String> authors) {
83          this.authors = authors;
84      }
85  
86      public List<String> getSubjects() {
87          return subjects;
88      }
89  
90      public void setSubjects(List<String> subjects) {
91          this.subjects = subjects;
92      }
93  
94      public List<String> getIssns() {
95          return issns;
96      }
97  
98      public void setIssns(List<String> issns) {
99          this.issns = issns;
100     }
101 
102     public List<String> getIsbns() {
103         return isbns;
104     }
105 
106     public void setIsbns(List<String> isbns) {
107         this.isbns = isbns;
108     }
109 
110     public List<String> getPublicationPlaces() {
111         return publicationPlaces;
112     }
113 
114     public void setPublicationPlaces(List<String> publicationPlaces) {
115         this.publicationPlaces = publicationPlaces;
116     }
117 
118     public List<String> getPublishers() {
119         return publishers;
120     }
121 
122     public void setPublishers(List<String> publishers) {
123         this.publishers = publishers;
124     }
125 
126     public List<String> getDescriptions() {
127         return descriptions;
128     }
129 
130     public void setDescriptions(List<String> descriptions) {
131         this.descriptions = descriptions;
132     }
133 
134     public List<String> getPublicationDates() {
135         return publicationDates;
136     }
137 
138     public void setPublicationDates(List<String> publicationDates) {
139         this.publicationDates = publicationDates;
140     }
141 
142     public List<String> getEditions() {
143         return editions;
144     }
145 
146     public void setEditions(List<String> editions) {
147         this.editions = editions;
148     }
149 
150     public List<String> getFormGenres() {
151         return formGenres;
152     }
153 
154     public void setFormGenres(List<String> formGenres) {
155         this.formGenres = formGenres;
156     }
157 
158     public List<String> getLanguages() {
159         return languages;
160     }
161 
162     public void setLanguages(List<String> languages) {
163         this.languages = languages;
164     }
165 
166     public List<String> getFormats() {
167         return formats;
168     }
169 
170     public void setFormats(List<String> formats) {
171         this.formats = formats;
172     }
173 
174 
175     /* Convenience methods */
176     public String getTitle() {
177         if (!CollectionUtils.isEmpty(titles)) {
178             return titles.get(0);
179         } else {
180             return null;
181         }
182     }
183 
184     public void setTitle(String title) {
185         if (null == titles) {
186             titles = new ArrayList<String>();
187             titles.add(title);
188         } else {
189             titles.add(title);
190         }
191     }
192 
193     public String getEdition() {
194         if (!CollectionUtils.isEmpty(editions)) {
195             return editions.get(0);
196         } else {
197             return null;
198         }
199     }
200 
201     public void setEdition(String edition) {
202         if (null == editions) {
203             editions = new ArrayList<String>();
204             editions.add(edition);
205         } else {
206             editions.add(edition);
207         }
208     }
209 
210     public String getAuthor() {
211         if (!CollectionUtils.isEmpty(authors)) {
212             return authors.get(0);
213         } else {
214             return null;
215         }
216     }
217 
218     public void setAuthor(String author) {
219         if (null == authors) {
220             authors = new ArrayList<String>();
221             authors.add(author);
222         } else {
223             authors.add(author);
224         }
225     }
226 
227     public String getPublicationDate() {
228         if (!CollectionUtils.isEmpty(publicationDates)) {
229             return publicationDates.get(0);
230         } else {
231             return null;
232         }
233     }
234 
235     public void setPublicationDate(String publicationDate) {
236         if (null == publicationDates) {
237             publicationDates = new ArrayList<String>();
238             publicationDates.add(publicationDate);
239         } else {
240             publicationDates.add(publicationDate);
241         }
242     }
243 
244     public String getIsbn() {
245         if (!CollectionUtils.isEmpty(isbns)) {
246             return isbns.get(0);
247         } else {
248             return null;
249         }
250     }
251 
252     public void setIsbn(String isbn) {
253         if (null == isbns) {
254             isbns = new ArrayList<String>();
255             isbns.add(isbn);
256         } else {
257             isbns.add(isbn);
258         }
259     }
260 
261     public String getIssn() {
262         if (!CollectionUtils.isEmpty(issns)) {
263             return issns.get(0);
264         } else {
265             return null;
266         }
267     }
268 
269     public void setIssn(String issn) {
270         if (null == issns) {
271             issns = new ArrayList<String>();
272             issns.add(issn);
273         } else {
274             issns.add(issn);
275         }
276     }
277 
278 
279     public String getPublisher() {
280         if (!CollectionUtils.isEmpty(publishers)) {
281             return publishers.get(0);
282         } else {
283             return null;
284         }
285     }
286 
287     public List<WorkInstanceDocument> getWorkInstanceDocumentList() {
288         return workInstanceDocumentList;
289     }
290 
291     public void setWorkInstanceDocumentList(List<WorkInstanceDocument> workInstanceDocumentList) {
292         this.workInstanceDocumentList = workInstanceDocumentList;
293     }
294 
295     public String getInstanceIdentifier() {
296         return instanceIdentifier;
297     }
298 
299     public void setInstanceIdentifier(String instanceIdentifier) {
300         this.instanceIdentifier = instanceIdentifier;
301     }
302 
303     public String getDocFormat() {
304         return docFormat;
305     }
306 
307     public void setDocFormat(String docFormat) {
308         this.docFormat = docFormat;
309     }
310 
311     public WorkEInstanceDocument geteInstanceDocument() {
312         return eInstanceDocument;
313     }
314 
315     public void seteInstanceDocument(WorkEInstanceDocument eInstanceDocument) {
316         this.eInstanceDocument = eInstanceDocument;
317     }
318 
319     public List<WorkEInstanceDocument> getWorkEInstanceDocumentList() {
320         return workEInstanceDocumentList;
321     }
322 
323     public void setWorkEInstanceDocumentList(List<WorkEInstanceDocument> workEInstanceDocumentList) {
324         this.workEInstanceDocumentList = workEInstanceDocumentList;
325     }
326 
327 
328     public String getLocalIds() {
329         if (!CollectionUtils.isEmpty(localId)) {
330             return localId.get(0);
331         } else {
332             return null;
333         }
334     }
335 
336     public void setLocalIds(String localIds) {
337         if (null == localId) {
338             localId = new ArrayList<String>();
339             localId.add(localIds);
340         } else {
341             localId.add(localIds);
342         }
343     }
344 
345 
346     @Override
347     public String toString() {
348         return "WorkBibDocument{" +
349                 "localId=" + localId +
350                 ", titles=" + titles +
351                 ", authors=" + authors +
352                 ", subjects=" + subjects +
353                 ", issns=" + issns +
354                 ", isbns=" + isbns +
355                 ", publicationPlaces=" + publicationPlaces +
356                 ", publishers=" + publishers +
357                 ", descriptions=" + descriptions +
358                 ", publicationDates=" + publicationDates +
359                 ", editions=" + editions +
360                 ", formGenres=" + formGenres +
361                 ", languages=" + languages +
362                 ", formats=" + formats +
363                 ", instanceDocument=" + instanceDocument +
364                 ", workInstanceDocumentList=" + workInstanceDocumentList +
365                 ", instanceIdentifier='" + instanceIdentifier + '\'' +
366                 ", docFormat='" + docFormat + '\'' +
367                 ", staffOnlyFlag='" + staffOnlyFlag + '\'' +
368                 ", eInstanceDocument=" + eInstanceDocument +
369                 ", workEInstanceDocumentList=" + workEInstanceDocumentList +
370                 '}';
371     }
372 
373     public void setPublisher(String publisher) {
374         if (null == publishers) {
375             publishers = new ArrayList<String>();
376             publishers.add(publisher);
377         } else {
378             publishers.add(publisher);
379         }
380 
381 
382     }
383 
384     /*   public String getItemLink() {
385         if (!CollectionUtils.isEmpty(itemLinks)) {
386             return itemLinks.get(0);
387         }
388         else {
389             return null;
390         }
391     }
392 
393     public void setItemLink(String itemLink) {
394         if (null == itemLinks) {
395             itemLinks = new ArrayList<String>();
396             itemLinks.add(itemLink);
397         }
398         else {
399             itemLinks.add(itemLink);
400         }
401     }*/
402 
403 }