001package org.kuali.ole.bo.serachRetrieve;
002
003
004import java.util.ArrayList;
005import java.util.List;
006
007/**
008 * Created with IntelliJ IDEA.
009 * User: srirams
010 * Date: 7/6/13
011 * Time: 5:57 PM
012 * To change this template use File | Settings | File Templates.
013 */
014public class OleSRUDublinRecord {
015
016    public static final String TITLE = "title";
017    public static final String CREATOR = "creator";
018    public static final String SUBJECT = "subject";
019    public static final String DESCRIPTION = "description";
020    public static final String PUBLISHER = "publisher";
021    public static final String DATE = "date";
022    public static final String IDENTIFIER = "identifier";
023    public static final String SOURCE = "source";
024    public static final String LANGUAGE = "language";
025    public static final String TYPE = "type";
026    public static final String RIGHTS = "rights";
027    public static final String FORMAT = "format";
028    public static final String CONTRIBUTOR = "contributor";
029    public static final String COVERAGE = "coverage";
030    public static final String RELATION = "relation";
031
032    private List<OleSRUDublin> records = new ArrayList<OleSRUDublin>();
033
034    /**
035     * Method to add, set or update tag value.
036     *
037     * @param tagName
038     * @param value
039     */
040    public void put(String tagName, String value) {
041        OleSRUDublin OleSRUDublin = new org.kuali.ole.bo.serachRetrieve.OleSRUDublin();
042        if (tagName.equalsIgnoreCase(TITLE)) {
043            OleSRUDublin.setTitle(value);
044        } else if (tagName.equalsIgnoreCase(DATE)) {
045            OleSRUDublin.setDate(value);
046        } else if (tagName.equalsIgnoreCase(CREATOR)) {
047            OleSRUDublin.setCreator(value);
048        } else if (tagName.equalsIgnoreCase(SUBJECT)) {
049            OleSRUDublin.setSubject(value);
050        } else if (tagName.equalsIgnoreCase(DESCRIPTION)) {
051            OleSRUDublin.setDescription(value);
052        } else if (tagName.equalsIgnoreCase(PUBLISHER)) {
053            OleSRUDublin.setPublisher(value);
054        } else if (tagName.equalsIgnoreCase(IDENTIFIER)) {
055            OleSRUDublin.setIdentifier(value);
056        } else if (tagName.equalsIgnoreCase(SOURCE)) {
057            OleSRUDublin.setSource(value);
058        } else if (tagName.equalsIgnoreCase(LANGUAGE)) {
059            OleSRUDublin.setLanguage(value);
060        } else if (tagName.equalsIgnoreCase(TYPE)) {
061            OleSRUDublin.setType(value);
062        } else if (tagName.equalsIgnoreCase(RIGHTS)) {
063            OleSRUDublin.setRights(value);
064        } else if (tagName.equalsIgnoreCase(FORMAT)) {
065            OleSRUDublin.setFormat(value);
066        } else if (tagName.equalsIgnoreCase(CONTRIBUTOR)) {
067            OleSRUDublin.setContributor(value);
068        } else if (tagName.equalsIgnoreCase(COVERAGE)) {
069            OleSRUDublin.setCoverage(value);
070        } else if (tagName.equalsIgnoreCase(RELATION)) {
071            OleSRUDublin.setRelation(value);
072        }
073        records.add(OleSRUDublin);
074    }
075
076    /**
077     * Method to return all tags
078     *
079     * @return
080     */
081    public List<OleSRUDublin> getAllTags() {
082        return records;
083    }
084
085    @Override
086    public String toString() {
087        return "[OaiDcDoc: " + records + "]";
088    }
089
090}