001package org.kuali.ole.describe.form;
002
003import org.kuali.ole.describe.bo.BibDocumentSearchResult;
004import org.kuali.ole.describe.bo.ImportBibConfirmReplace;
005import org.kuali.ole.describe.bo.ImportBibSearch;
006import org.kuali.ole.describe.bo.ImportBibUserPreferences;
007import org.kuali.ole.describe.service.ImportBibService;
008import org.kuali.ole.docstore.common.document.content.bib.marc.BibMarcRecord;
009import org.kuali.ole.docstore.common.document.content.instance.InstanceCollection;
010import org.kuali.ole.docstore.common.search.SearchCondition;
011import org.kuali.ole.docstore.common.search.SearchParams;
012import org.kuali.ole.docstore.model.bo.WorkInstanceDocument;
013import org.kuali.ole.docstore.model.xmlpojo.ingest.Request;
014import org.kuali.rice.krad.web.form.UifFormBase;
015
016import java.util.*;
017
018/**
019 * Created with IntelliJ IDEA.
020 * User: pj7789
021 * Date: 26/11/12
022 * Time: 11:49 AM
023 * To change this template use File | Settings | File Templates.
024 */
025public class ImportBibForm
026        extends UifFormBase {
027
028    private List<BibMarcRecord> bibMarcRecordList = new ArrayList<BibMarcRecord>();
029    private ImportBibUserPreferences importBibUserPreferences;
030    private ImportBibSearch importBibSearch;
031    private ImportBibConfirmReplace importBibConfirmReplace;
032    private SearchParams searchParams;
033    private BibMarcRecord newBibMarcRecord;
034    private BibMarcRecord existingBibMarcRecord;
035//    private WorkInstanceDocument neWorkInstanceOlemlRecord;
036    private InstanceCollection newInstanceCollection;
037    private String message;
038    private String displayField;
039    private String uuid;
040    private List<BibDocumentSearchResult> bibUuidsList;
041    private String requestString;
042    private Request request;
043    private SortedMap<BibDocumentSearchResult, BibMarcRecord> marcDocRecMap;
044
045
046    public ImportBibForm() {
047        List<SearchCondition> searchConditions = getSearchParams().getSearchConditions();
048        if (null == searchConditions) {
049            searchConditions = new ArrayList<SearchCondition>();
050        }
051        searchConditions.add(new SearchCondition());
052        searchConditions.add(new SearchCondition());
053    }
054
055    public SearchParams getSearchParams() {
056        if (null == searchParams) {
057            searchParams = new SearchParams();
058        }
059        return searchParams;
060    }
061
062    public void setSearchParams(SearchParams searchParams) {
063        this.searchParams = searchParams;
064    }
065
066    public ImportBibUserPreferences getImportBibUserPreferences() {
067        return importBibUserPreferences;
068    }
069
070    public void setImportBibUserPreferences(ImportBibUserPreferences importBibUserPreferences) {
071        this.importBibUserPreferences = importBibUserPreferences;
072    }
073
074    public List<BibMarcRecord> getBibMarcRecordList() {
075        return bibMarcRecordList;
076    }
077
078    public void setBibMarcRecordList(List<BibMarcRecord> bibMarcRecordList) {
079        this.bibMarcRecordList = bibMarcRecordList;
080    }
081
082    public ImportBibSearch getImportBibSearch() {
083        if (null == importBibSearch) {
084            importBibSearch = new ImportBibSearch();
085        }
086        return importBibSearch;
087    }
088
089    public void setImportBibSearch(ImportBibSearch importBibSearch) {
090        this.importBibSearch = importBibSearch;
091    }
092
093    public ImportBibConfirmReplace getImportBibConfirmReplace() {
094        if (null == importBibConfirmReplace) {
095            importBibConfirmReplace = new ImportBibConfirmReplace();
096        }
097        return importBibConfirmReplace;
098    }
099
100    public void setImportBibConfirmReplace(ImportBibConfirmReplace importBibConfirmReplace) {
101        this.importBibConfirmReplace = importBibConfirmReplace;
102    }
103
104    public BibMarcRecord getNewBibMarcRecord() {
105        return newBibMarcRecord;
106    }
107
108    public void setNewBibMarcRecord(BibMarcRecord newBibMarcRecord) {
109        this.newBibMarcRecord = newBibMarcRecord;
110    }
111
112    public BibMarcRecord getExistingBibMarcRecord() {
113        return existingBibMarcRecord;
114    }
115
116    public void setExistingBibMarcRecord(BibMarcRecord existingBibMarcRecord) {
117        this.existingBibMarcRecord = existingBibMarcRecord;
118    }
119
120//    public WorkInstanceDocument getNeWorkInstanceOlemlRecord() {
121//        return neWorkInstanceOlemlRecord;
122//    }
123//
124//    public void setNeWorkInstanceOlemlRecord(WorkInstanceDocument neWorkInstanceOlemlRecord) {
125//        this.neWorkInstanceOlemlRecord = neWorkInstanceOlemlRecord;
126//    }
127
128    public String getMessage() {
129        return message;
130    }
131
132    public void setMessage(String message) {
133        this.message = message;
134    }
135
136    public String getDisplayField() {
137        return displayField;
138    }
139
140    public void setDisplayField(String displayField) {
141        this.displayField = displayField;
142    }
143
144    public String getUuid() {
145        return uuid;
146    }
147
148    public void setUuid(String uuid) {
149        this.uuid = uuid;
150    }
151
152    public List<BibDocumentSearchResult> getBibUuidsList() {
153        if (null == bibUuidsList) {
154            bibUuidsList = new ArrayList<BibDocumentSearchResult>();
155        }
156        return bibUuidsList;
157    }
158
159    public void setBibUuidsList(List<BibDocumentSearchResult> bibUuidsList) {
160        this.bibUuidsList = bibUuidsList;
161    }
162
163    public String getRequestString() {
164        return requestString;
165    }
166
167    public void setRequestString(String requestString) {
168        this.requestString = requestString;
169    }
170
171    public Request getRequest() {
172        return request;
173    }
174
175    public void setRequest(Request request) {
176        this.request = request;
177    }
178
179    public InstanceCollection getNewInstanceCollection() {
180        return newInstanceCollection;
181    }
182
183    public void setNewInstanceCollection(InstanceCollection newInstanceCollection) {
184        this.newInstanceCollection = newInstanceCollection;
185    }
186
187    public SortedMap<BibDocumentSearchResult, BibMarcRecord> getMarcDocRecMap() {
188        if (null == marcDocRecMap) {
189            marcDocRecMap = new TreeMap<BibDocumentSearchResult, BibMarcRecord>(new ImportBibService());
190        }
191        return marcDocRecMap;
192    }
193
194    public void setMarcDocRecMap(SortedMap<BibDocumentSearchResult, BibMarcRecord> marcDocRecMap) {
195        this.marcDocRecMap = marcDocRecMap;
196    }
197}
198