1 | package eu.clarin.cmdi.vlo; |
---|
2 | |
---|
3 | import java.io.UnsupportedEncodingException; |
---|
4 | import java.net.URLEncoder; |
---|
5 | |
---|
6 | /** |
---|
7 | * see applicationContext.xml resource for proper values. |
---|
8 | * |
---|
9 | **/ |
---|
10 | public final class Configuration { |
---|
11 | |
---|
12 | private final static Configuration INSTANCE = new Configuration(); |
---|
13 | |
---|
14 | public static final String CONFIG_FILE = "applicationContext.xml"; |
---|
15 | |
---|
16 | private String solrUrl; |
---|
17 | |
---|
18 | private String imdiBrowserUrl;// = "http://corpus1.mpi.nl/ds/imdi_browser?openpath="; |
---|
19 | |
---|
20 | private String[] facetFields;// = new String[] { "origin", "organisation", "continent", "genre", "country", "subject", "language" }; |
---|
21 | |
---|
22 | private String handleServerUrl; //"http://hdl.handle.net/" |
---|
23 | |
---|
24 | private Configuration() { |
---|
25 | } |
---|
26 | |
---|
27 | public static Configuration getInstance() { |
---|
28 | return INSTANCE; |
---|
29 | } |
---|
30 | |
---|
31 | public void setSolrUrl(String solrUrl) { |
---|
32 | this.solrUrl = solrUrl; |
---|
33 | } |
---|
34 | |
---|
35 | public String getSolrUrl() { |
---|
36 | return solrUrl; |
---|
37 | } |
---|
38 | |
---|
39 | public void setIMDIBrowserUrl(String imdiBrowserUrl) { |
---|
40 | this.imdiBrowserUrl = imdiBrowserUrl; |
---|
41 | } |
---|
42 | |
---|
43 | public String getIMDIBrowserUrl(String handle) { |
---|
44 | String result; |
---|
45 | try { |
---|
46 | result = imdiBrowserUrl + URLEncoder.encode(handle, "UTF-8"); |
---|
47 | } catch (UnsupportedEncodingException e) { |
---|
48 | result = imdiBrowserUrl + handle; |
---|
49 | } |
---|
50 | return result; |
---|
51 | } |
---|
52 | |
---|
53 | public String[] getFacetFields() { |
---|
54 | return facetFields; |
---|
55 | } |
---|
56 | |
---|
57 | public void setFacetFields(String[] facetFields) { |
---|
58 | this.facetFields = facetFields; |
---|
59 | } |
---|
60 | |
---|
61 | public String getHandleServerUrl() { |
---|
62 | return handleServerUrl; |
---|
63 | } |
---|
64 | |
---|
65 | public void setHandleServerUrl(String handleServerUrl) { |
---|
66 | this.handleServerUrl = handleServerUrl; |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | } |
---|