View Javadoc

1   package org.kuali.ole.bo.serachRetrieve;
2   
3   
4   import java.util.ArrayList;
5   import java.util.List;
6   
7   /**
8    * Created with IntelliJ IDEA.
9    * User: srirams
10   * Date: 7/6/13
11   * Time: 5:57 PM
12   * To change this template use File | Settings | File Templates.
13   */
14  public class OleSRUDublinRecord {
15  
16      public static final String TITLE = "title";
17      public static final String CREATOR = "creator";
18      public static final String SUBJECT = "subject";
19      public static final String DESCRIPTION = "description";
20      public static final String PUBLISHER = "publisher";
21      public static final String DATE = "date";
22      public static final String IDENTIFIER = "identifier";
23      public static final String SOURCE = "source";
24      public static final String LANGUAGE = "language";
25      public static final String TYPE = "type";
26      public static final String RIGHTS = "rights";
27      public static final String FORMAT = "format";
28      public static final String CONTRIBUTOR = "contributor";
29      public static final String COVERAGE = "coverage";
30      public static final String RELATION = "relation";
31  
32      private List<OleSRUDublin> records = new ArrayList<OleSRUDublin>();
33  
34      /**
35       * Method to add, set or update tag value.
36       *
37       * @param tagName
38       * @param value
39       */
40      public void put(String tagName, String value) {
41          OleSRUDublin OleSRUDublin = new org.kuali.ole.bo.serachRetrieve.OleSRUDublin();
42          if (tagName.equalsIgnoreCase(TITLE)) {
43              OleSRUDublin.setTitle(value);
44          } else if (tagName.equalsIgnoreCase(DATE)) {
45              OleSRUDublin.setDate(value);
46          } else if (tagName.equalsIgnoreCase(CREATOR)) {
47              OleSRUDublin.setCreator(value);
48          } else if (tagName.equalsIgnoreCase(SUBJECT)) {
49              OleSRUDublin.setSubject(value);
50          } else if (tagName.equalsIgnoreCase(DESCRIPTION)) {
51              OleSRUDublin.setDescription(value);
52          } else if (tagName.equalsIgnoreCase(PUBLISHER)) {
53              OleSRUDublin.setPublisher(value);
54          } else if (tagName.equalsIgnoreCase(IDENTIFIER)) {
55              OleSRUDublin.setIdentifier(value);
56          } else if (tagName.equalsIgnoreCase(SOURCE)) {
57              OleSRUDublin.setSource(value);
58          } else if (tagName.equalsIgnoreCase(LANGUAGE)) {
59              OleSRUDublin.setLanguage(value);
60          } else if (tagName.equalsIgnoreCase(TYPE)) {
61              OleSRUDublin.setType(value);
62          } else if (tagName.equalsIgnoreCase(RIGHTS)) {
63              OleSRUDublin.setRights(value);
64          } else if (tagName.equalsIgnoreCase(FORMAT)) {
65              OleSRUDublin.setFormat(value);
66          } else if (tagName.equalsIgnoreCase(CONTRIBUTOR)) {
67              OleSRUDublin.setContributor(value);
68          } else if (tagName.equalsIgnoreCase(COVERAGE)) {
69              OleSRUDublin.setCoverage(value);
70          } else if (tagName.equalsIgnoreCase(RELATION)) {
71              OleSRUDublin.setRelation(value);
72          }
73          records.add(OleSRUDublin);
74      }
75  
76      /**
77       * Method to return all tags
78       *
79       * @return
80       */
81      public List<OleSRUDublin> getAllTags() {
82          return records;
83      }
84  
85      @Override
86      public String toString() {
87          return "[OaiDcDoc: " + records + "]";
88      }
89  
90  }