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> titles = new ArrayList<String>();
19      protected List<String> authors = new ArrayList<String>();
20      protected List<String> subjects;
21      protected List<String> issns;
22      protected List<String> isbns;
23      protected List<String> publicationPlaces;
24      protected List<String> publishers = new ArrayList<String>();
25      protected List<String> descriptions;
26      protected List<String> publicationDates = new ArrayList<String>();
27      protected List<String> editions = new ArrayList<String>();
28      protected List<String> formGenres;
29      protected List<String> languages;
30      protected List<String> formats;
31      protected WorkInstanceDocument instanceDocument;
32      protected List<WorkInstanceDocument> workInstanceDocumentList;
33      protected String instanceIdentifier;
34      protected String docFormat;
35  
36      public WorkInstanceDocument getInstanceDocument() {
37          return instanceDocument;
38      }
39  
40      public void setInstanceDocument(WorkInstanceDocument instanceDocument) {
41          this.instanceDocument = instanceDocument;
42      }
43  
44      public WorkBibDocument() {
45          docCategory = DocCategory.WORK;
46          docType = DocType.BIB;
47      }
48  
49      /* Getters and Setters */
50      public List<String> getTitles() {
51          return titles;
52      }
53  
54      public void setTitles(List<String> titles) {
55          this.titles = titles;
56      }
57  
58      public List<String> getAuthors() {
59          return authors;
60      }
61  
62      public void setAuthors(List<String> authors) {
63          this.authors = authors;
64      }
65  
66      public List<String> getSubjects() {
67          return subjects;
68      }
69  
70      public void setSubjects(List<String> subjects) {
71          this.subjects = subjects;
72      }
73  
74      public List<String> getIssns() {
75          return issns;
76      }
77  
78      public void setIssns(List<String> issns) {
79          this.issns = issns;
80      }
81  
82      public List<String> getIsbns() {
83          return isbns;
84      }
85  
86      public void setIsbns(List<String> isbns) {
87          this.isbns = isbns;
88      }
89  
90      public List<String> getPublicationPlaces() {
91          return publicationPlaces;
92      }
93  
94      public void setPublicationPlaces(List<String> publicationPlaces) {
95          this.publicationPlaces = publicationPlaces;
96      }
97  
98      public List<String> getPublishers() {
99          return publishers;
100     }
101 
102     public void setPublishers(List<String> publishers) {
103         this.publishers = publishers;
104     }
105 
106     public List<String> getDescriptions() {
107         return descriptions;
108     }
109 
110     public void setDescriptions(List<String> descriptions) {
111         this.descriptions = descriptions;
112     }
113 
114     public List<String> getPublicationDates() {
115         return publicationDates;
116     }
117 
118     public void setPublicationDates(List<String> publicationDates) {
119         this.publicationDates = publicationDates;
120     }
121 
122     public List<String> getEditions() {
123         return editions;
124     }
125 
126     public void setEditions(List<String> editions) {
127         this.editions = editions;
128     }
129 
130     public List<String> getFormGenres() {
131         return formGenres;
132     }
133 
134     public void setFormGenres(List<String> formGenres) {
135         this.formGenres = formGenres;
136     }
137 
138     public List<String> getLanguages() {
139         return languages;
140     }
141 
142     public void setLanguages(List<String> languages) {
143         this.languages = languages;
144     }
145 
146     public List<String> getFormats() {
147         return formats;
148     }
149 
150     public void setFormats(List<String> formats) {
151         this.formats = formats;
152     }
153 
154 
155     /* Convenience methods */
156     public String getTitle() {
157         if (!CollectionUtils.isEmpty(titles)) {
158             return titles.get(0);
159         }
160         else {
161             return null;
162         }
163     }
164 
165     public void setTitle(String title) {
166         if (null == titles) {
167             titles = new ArrayList<String>();
168             titles.add(title);
169         }
170         else {
171             titles.add(title);
172         }
173     }
174 
175     public String getEdition() {
176         if (!CollectionUtils.isEmpty(editions)) {
177             return editions.get(0);
178         }
179         else {
180             return null;
181         }
182     }
183 
184     public void setEdition(String edition) {
185         if (null == editions) {
186             editions = new ArrayList<String>();
187             editions.add(edition);
188         }
189         else {
190             editions.add(edition);
191         }
192     }
193 
194     public String getAuthor() {
195         if (!CollectionUtils.isEmpty(authors)) {
196             return authors.get(0);
197         }
198         else {
199             return null;
200         }
201     }
202 
203     public void setAuthor(String author) {
204         if (null == authors) {
205             authors = new ArrayList<String>();
206             authors.add(author);
207         }
208         else {
209             authors.add(author);
210         }
211     }
212 
213     public String getPublicationDate() {
214         if (!CollectionUtils.isEmpty(publicationDates)) {
215             return publicationDates.get(0);
216         }
217         else {
218             return null;
219         }
220     }
221 
222     public void setPublicationDate(String publicationDate) {
223         if (null == publicationDates) {
224             publicationDates = new ArrayList<String>();
225             publicationDates.add(publicationDate);
226         }
227         else {
228             publicationDates.add(publicationDate);
229         }
230     }
231 
232     public String getIsbn() {
233         if (!CollectionUtils.isEmpty(isbns)) {
234             return isbns.get(0);
235         }
236         else {
237             return null;
238         }
239     }
240 
241     public void setIsbn(String isbn) {
242         if (null == isbns) {
243             isbns = new ArrayList<String>();
244             isbns.add(isbn);
245         }
246         else {
247             isbns.add(isbn);
248         }
249     }
250 
251     public String getPublisher() {
252         if (!CollectionUtils.isEmpty(publishers)) {
253             return publishers.get(0);
254         }
255         else {
256             return null;
257         }
258     }
259 
260     public List<WorkInstanceDocument> getWorkInstanceDocumentList() {
261         return workInstanceDocumentList;
262     }
263 
264     public void setWorkInstanceDocumentList(List<WorkInstanceDocument> workInstanceDocumentList) {
265         this.workInstanceDocumentList = workInstanceDocumentList;
266     }
267 
268     public String getInstanceIdentifier() {
269         return instanceIdentifier;
270     }
271 
272     public void setInstanceIdentifier(String instanceIdentifier) {
273         this.instanceIdentifier = instanceIdentifier;
274     }
275 
276     public String getDocFormat() {
277         return docFormat;
278     }
279 
280     public void setDocFormat(String docFormat) {
281         this.docFormat = docFormat;
282     }
283 
284     @Override
285     public String toString() {
286         return "WorkBibDocument{" +
287                "titles=" + titles +
288                ", authors=" + authors +
289                ", subjects=" + subjects +
290                ", issns=" + issns +
291                ", isbns=" + isbns +
292                ", publicationPlaces=" + publicationPlaces +
293                ", publishers=" + publishers +
294                ", descriptions=" + descriptions +
295                ", publicationDates=" + publicationDates +
296                ", editions=" + editions +
297                ", formGenres=" + formGenres +
298                ", languages=" + languages +
299                ", formats=" + formats +
300                ", instanceDocument=" + instanceDocument +
301                ", workInstanceDocumentList=" + workInstanceDocumentList +
302                '}';
303     }
304 
305 
306 
307     public void setPublisher(String publisher) {
308         if (null == publishers) {
309             publishers = new ArrayList<String>();
310             publishers.add(publisher);
311         }
312         else {
313             publishers.add(publisher);
314         }
315 
316 
317 
318 
319 
320 
321     }
322 
323     /*   public String getItemLink() {
324         if (!CollectionUtils.isEmpty(itemLinks)) {
325             return itemLinks.get(0);
326         }
327         else {
328             return null;
329         }
330     }
331 
332     public void setItemLink(String itemLink) {
333         if (null == itemLinks) {
334             itemLinks = new ArrayList<String>();
335             itemLinks.add(itemLink);
336         }
337         else {
338             itemLinks.add(itemLink);
339         }
340     }*/
341 
342 }