1 package org.kuali.ole.describe.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
22 public List getResponseFromSOLR(String queryField, String value) {
23 String queryString = queryField + ":" + value;
24 return getSolrRequestReponseHandler().retriveResults(queryString);
25 }
26
27
28
29
30
31
32
33 public List getBibInformationFromInsatnceId(String instanceUUID) {
34 return getSolrRequestReponseHandler().retriveResults(queryString + instanceUUID);
35 }
36
37
38
39
40
41
42
43 public List getBibInformationFromBibId(String bibUUID) {
44 return getSolrRequestReponseHandler().retriveResults(bibQueryString + bibUUID);
45 }
46
47
48
49
50
51
52
53 public SolrRequestReponseHandler getSolrRequestReponseHandler() {
54 if (null == solrRequestReponseHandler) {
55 solrRequestReponseHandler = new SolrRequestReponseHandler();
56 }
57 return solrRequestReponseHandler;
58 }
59
60
61
62
63
64
65 public void setSolrRequestReponseHandler(SolrRequestReponseHandler solrRequestReponseHandler) {
66 this.solrRequestReponseHandler = solrRequestReponseHandler;
67 }
68 }