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