Skip to content

Commit 11ff34a

Browse files
committed
Merge pull request #10 from dvcama/dbpedia-redirection
"pubby style" redirection
2 parents 3fb92dd + fd79163 commit 11ff34a

File tree

6 files changed

+227
-213
lines changed

6 files changed

+227
-213
lines changed

src/main/java/org/dvcama/lodview/conf/ConfigurationBean.java

Lines changed: 29 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class ConfigurationBean implements ServletContextAware, Cloneable {
2323

2424
private Model confModel = null;
2525
private ServletContext context;
26-
private String confFile, forceIriEncoding, homeUrl, license, httpRedirectSuffix, EndPointUrl, IRInamespace, contentEncoding, staticResourceURL, preferredLanguage, publicUrlPrefix = null, publicUrlSuffix = "", authUsername = null, authPassword = null, defaultInverseBehaviour = "collapse";
26+
private String confFile, endPointType, redirectionStrategy, forceIriEncoding, httpRedirectExcludeList, homeUrl, license, httpRedirectSuffix, httpRedirectPrefix, endPointUrl, IRInamespace, contentEncoding, staticResourceURL, preferredLanguage, publicUrlPrefix = null, publicUrlSuffix = "", authUsername = null, authPassword = null, defaultInverseBehaviour = "collapse";
2727

2828
private List<String> defaultQueries = null, defaultRawDataQueries = null, defaultInversesQueries = null, defaultInversesTest = null, defaultInversesCountQueries = null, typeProperties = null, audioProperties = null, imageProperties = null, videoProperties = null, linkingProperties = null, titleProperties = null, descriptionProperties = null, longitudeProperties = null, latitudeProperties = null;
2929
private List<String> colorPair = null, skipDomains = null, mainOntologiesPrefixes = null;
@@ -46,14 +46,18 @@ public void populateBean() throws IOException, Exception {
4646
}
4747
confModel = RDFDataMgr.loadModel(configFile.getAbsolutePath());
4848

49-
EndPointUrl = getSingleConfValue("endpoint");
49+
endPointUrl = getSingleConfValue("endpoint");
50+
endPointType = getSingleConfValue("endpointType", "");
5051
authPassword = getSingleConfValue("authPassword");
5152
authUsername = getSingleConfValue("authUsername");
5253
forceIriEncoding = getSingleConfValue("forceIriEncoding", "auto");
54+
redirectionStrategy = getSingleConfValue("redirectionStrategy", "");
5355

5456
IRInamespace = getSingleConfValue("IRInamespace", "<not provided>");
5557

5658
httpRedirectSuffix = getSingleConfValue("httpRedirectSuffix", "");
59+
httpRedirectPrefix = getSingleConfValue("httpRedirectPrefix", "");
60+
httpRedirectExcludeList = getSingleConfValue("httpRedirectExcludeList", "");
5761

5862
publicUrlPrefix = getSingleConfValue("publicUrlPrefix", "");
5963
publicUrlPrefix = publicUrlPrefix.replaceAll(".+/auto$", context.getContextPath() + "/");
@@ -77,6 +81,7 @@ public void populateBean() throws IOException, Exception {
7781

7882
defaultQueries = getMultiConfValue("defaultQueries");
7983
defaultRawDataQueries = getMultiConfValue("defaultRawDataQueries");
84+
8085
defaultInversesQueries = getMultiConfValue("defaultInversesQueries");
8186
defaultInversesTest = getMultiConfValue("defaultInversesTest");
8287
defaultInversesCountQueries = getMultiConfValue("defaultInversesCountQueries");
@@ -133,10 +138,6 @@ private List<String> getMultiConfValue(String prop) {
133138
return result;
134139
}
135140

136-
public void setConfFile(String confFile) {
137-
this.confFile = confFile;
138-
}
139-
140141
@Override
141142
public void setServletContext(ServletContext arg0) {
142143
this.context = arg0;
@@ -156,6 +157,14 @@ public Map<String, String> getPrefixes() {
156157
return confModel.getNsPrefixMap();
157158
}
158159

160+
public String getRedirectionStrategy() {
161+
return redirectionStrategy;
162+
}
163+
164+
public String getPreferredLanguage() {
165+
return preferredLanguage;
166+
}
167+
159168
public String getNsPrefixURI(String prefix) {
160169
return confModel.getNsPrefixURI(prefix);
161170
}
@@ -165,15 +174,7 @@ public String getNsURIPrefix(String IRI) {
165174
}
166175

167176
public String getEndPointUrl() {
168-
return EndPointUrl;
169-
}
170-
171-
public void setEndPointUrl(String EndPointUrl) {
172-
this.EndPointUrl = EndPointUrl;
173-
}
174-
175-
public void setIRInamespace(String IRInamespace) {
176-
this.IRInamespace = IRInamespace;
177+
return endPointUrl;
177178
}
178179

179180
public List<String> getDefaultQueries() {
@@ -196,14 +197,6 @@ public String getPublicUrlSuffix() {
196197
return publicUrlSuffix;
197198
}
198199

199-
public void setPublicUrlPrefix(String publicUrlPrefix) {
200-
this.publicUrlPrefix = publicUrlPrefix;
201-
}
202-
203-
public void setPublicUrlSuffix(String publicUrlSuffix) {
204-
this.publicUrlSuffix = publicUrlSuffix;
205-
}
206-
207200
public List<String> getDefaultRawDataQueries() {
208201
return defaultRawDataQueries;
209202
}
@@ -260,10 +253,6 @@ public List<String> getLinkingProperties() {
260253
return linkingProperties;
261254
}
262255

263-
public String getPreferredLanguage() {
264-
return preferredLanguage;
265-
}
266-
267256
public String getLicense() {
268257
return license;
269258
}
@@ -277,42 +266,22 @@ public String getRandomColorPair() {
277266
return colorPair.get(randomNum);
278267
}
279268

280-
public void setColorPair(List<String> colorPair) {
281-
this.colorPair = colorPair;
282-
}
283-
284269
public List<String> getSkipDomains() {
285270
return skipDomains;
286271
}
287272

288-
public void setSkipDomains(List<String> skipDomains) {
289-
this.skipDomains = skipDomains;
290-
}
291-
292273
public String getAuthPassword() {
293274
return authPassword;
294275
}
295276

296-
public void setAuthPassword(String authPassword) {
297-
this.authPassword = authPassword;
298-
}
299-
300277
public String getAuthUsername() {
301278
return authUsername;
302279
}
303280

304-
public void setAuthUsername(String authUsername) {
305-
this.authUsername = authUsername;
306-
}
307-
308281
public String getDefaultInverseBehaviour() {
309282
return defaultInverseBehaviour;
310283
}
311284

312-
public void setDefaultInverseBehaviour(String defaultInverseBehaviour) {
313-
this.defaultInverseBehaviour = defaultInverseBehaviour;
314-
}
315-
316285
public Map<String, String> getColorPairMatcher() {
317286
return colorPairMatcher;
318287
}
@@ -328,40 +297,40 @@ public Object clone() {
328297

329298
@Override
330299
public String toString() {
331-
return "ConfigurationBean [confModel=" + confModel + ", context=" + context + ", confFile=" + confFile + ", EndPointUrl=" + EndPointUrl + ", IRInamespace=" + IRInamespace + ", contentEncoding=" + contentEncoding + ", staticResourceURL=" + staticResourceURL + ", preferredLanguage=" + preferredLanguage + ", publicUrlPrefix=" + publicUrlPrefix + ", authUsername=" + authUsername + ", authPassword=" + authPassword + ", defaultInverseBehaviour=" + defaultInverseBehaviour + ", defaultQueries=" + defaultQueries + ", defaultRawDataQueries=" + defaultRawDataQueries + ", defaultInversesQueries=" + defaultInversesQueries + ", defaultInversesTest=" + defaultInversesTest + ", defaultInversesCountQueries=" + defaultInversesCountQueries + ", typeProperties=" + typeProperties
300+
return "ConfigurationBean [confModel=" + confModel + ", context=" + context + ", confFile=" + confFile + ", endPointUrl=" + endPointUrl + ", IRInamespace=" + IRInamespace + ", contentEncoding=" + contentEncoding + ", staticResourceURL=" + staticResourceURL + ", preferredLanguage=" + preferredLanguage + ", publicUrlPrefix=" + publicUrlPrefix + ", authUsername=" + authUsername + ", authPassword=" + authPassword + ", defaultInverseBehaviour=" + defaultInverseBehaviour + ", defaultQueries=" + defaultQueries + ", defaultRawDataQueries=" + defaultRawDataQueries + ", defaultInversesQueries=" + defaultInversesQueries + ", defaultInversesTest=" + defaultInversesTest + ", defaultInversesCountQueries=" + defaultInversesCountQueries + ", typeProperties=" + typeProperties
332301
+ ", imageProperties=" + imageProperties + ", audioProperties=" + audioProperties + ", videoProperties=" + videoProperties + ", linkingProperties=" + linkingProperties + ", titleProperties=" + titleProperties + ", descriptionProperties=" + descriptionProperties + ", longitudeProperties=" + longitudeProperties + ", latitudeProperties=" + latitudeProperties + ", colorPair=" + colorPair + ", skipDomains=" + skipDomains + ", rand=" + rand + "]";
333302
}
334303

335304
public String getHomeUrl() {
336305
return homeUrl;
337306
}
338307

339-
public void setHomeUrl(String homeUrl) {
340-
this.homeUrl = homeUrl;
341-
}
342-
343308
public String getHttpRedirectSuffix() {
344309
return httpRedirectSuffix;
345310
}
346311

347-
public void setHttpRedirectSuffix(String httpRedirectSuffix) {
348-
this.httpRedirectSuffix = httpRedirectSuffix;
312+
public String getHttpRedirectPrefix() {
313+
return httpRedirectPrefix;
349314
}
350315

351-
public List<String> getMainOntologiesPrefixes() {
352-
return mainOntologiesPrefixes;
316+
public String getHttpRedirectExcludeList() {
317+
return httpRedirectExcludeList;
353318
}
354319

355-
public void setMainOntologiesPrefixes(List<String> mainOntologiesPrefixes) {
356-
this.mainOntologiesPrefixes = mainOntologiesPrefixes;
320+
public List<String> getMainOntologiesPrefixes() {
321+
return mainOntologiesPrefixes;
357322
}
358323

359324
public String getForceIriEncoding() {
360325
return forceIriEncoding;
361326
}
362327

363-
public void setForceIriEncoding(String forceIriEncoding) {
364-
this.forceIriEncoding = forceIriEncoding;
328+
public String getEndPointType() {
329+
return endPointType;
330+
}
331+
332+
public void setConfFile(String confFile) {
333+
this.confFile = confFile;
365334
}
366335

367336
}

0 commit comments

Comments
 (0)