1 package org.kuali.ole.editor.service;
2
3 import org.kuali.incubator.SolrRequestReponseHandler;
4
5 import java.util.List;
6
7
8
9
10 public class DiscoveryHelperService {
11 private final String queryString = "DocType:bibliographic AND instanceIdentifier:";
12 private final String bibQueryString = "DocType:bibliographic AND uniqueId:";
13 SolrRequestReponseHandler solrRequestReponseHandler;
14
15
16
17
18
19
20
21 public List getResponseFromSOLR(String queryField, String value) {
22 String queryString = queryField + ":" + value;
23 return getSolrRequestReponseHandler().retriveResults(queryString);
24 }
25
26
27
28
29
30
31 public List getBibInformationFromInsatnceId(String instanceUUID) {
32 return getSolrRequestReponseHandler().retriveResults(queryString + instanceUUID);
33 }
34
35
36
37
38
39
40 public List getBibInformationFromBibId(String bibUUID) {
41 return getSolrRequestReponseHandler().retriveResults(bibQueryString + bibUUID);
42 }
43
44
45
46
47
48
49 public SolrRequestReponseHandler getSolrRequestReponseHandler() {
50 if (null == solrRequestReponseHandler) {
51 solrRequestReponseHandler = new SolrRequestReponseHandler();
52 }
53 return solrRequestReponseHandler;
54 }
55
56
57
58
59
60 public void setSolrRequestReponseHandler(SolrRequestReponseHandler solrRequestReponseHandler) {
61 this.solrRequestReponseHandler = solrRequestReponseHandler;
62 }
63 }