NIHVIVO-3940 remove the implementation of /individual/prefix/localname
This has been broken since before release 1.3 and nobody has missed it.
This commit is contained in:
parent
4422fd07b9
commit
81b0b2c145
6 changed files with 0 additions and 204 deletions
|
@ -15,12 +15,6 @@ public interface IndividualRequestAnalysisContext {
|
|||
*/
|
||||
String getDefaultNamespace();
|
||||
|
||||
/**
|
||||
* Is there a namespace for this prefix? If not, return an empty string, but
|
||||
* never null.
|
||||
*/
|
||||
String getNamespaceForPrefix(String prefix);
|
||||
|
||||
/**
|
||||
* Use the IndividualDao to get this individual.
|
||||
*
|
||||
|
|
|
@ -15,8 +15,6 @@ import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
|||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||
import edu.cornell.mannlib.vitro.webapp.filestorage.model.FileInfo;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.NamespaceMapper;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.NamespaceMapperFactory;
|
||||
|
||||
/**
|
||||
* Implement all of the fiddly-bits that we need for analyzing the request for
|
||||
|
@ -45,25 +43,6 @@ public class IndividualRequestAnalysisContextImpl implements
|
|||
return wadf.getDefaultNamespace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespaceForPrefix(String prefix) {
|
||||
if (prefix == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
NamespaceMapper namespaceMapper = NamespaceMapperFactory
|
||||
.getNamespaceMapper(ctx);
|
||||
if (namespaceMapper == null) {
|
||||
log.warn("No NamespaceMapper in ServletContext. Request URL was '"
|
||||
+ vreq.getRequestURL() + "'");
|
||||
return "";
|
||||
}
|
||||
|
||||
String ns = namespaceMapper.getNamespaceForPrefix(prefix);
|
||||
|
||||
return (ns == null) ? "" : ns;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Individual getIndividualByURI(String individualUri) {
|
||||
if (individualUri == null) {
|
||||
|
|
|
@ -30,7 +30,6 @@ public class IndividualRequestAnalyzer {
|
|||
private static Pattern RDF_REQUEST = Pattern.compile("^/individual/([^/]+)/\\1\\.(rdf|n3|ttl)$");
|
||||
private static Pattern HTML_REQUEST = Pattern.compile("^/display/([^/]+)$");
|
||||
private static Pattern LINKED_DATA_URL = Pattern.compile("^/individual/([^/]+)$");
|
||||
private static Pattern NS_PREFIX_URL = Pattern.compile("^/individual/([^/]*)/([^/]+)$");
|
||||
|
||||
private final VitroRequest vreq;
|
||||
private final IndividualRequestAnalysisContext analysisContext;
|
||||
|
@ -164,7 +163,6 @@ public class IndividualRequestAnalyzer {
|
|||
* /individual/localname/localname.rdf
|
||||
* /individual/localname/localname.n3
|
||||
* /individual/localname/localname.ttl
|
||||
* /individual/nsprefix/localname
|
||||
* </pre>
|
||||
*
|
||||
* @return null on failure.
|
||||
|
@ -202,14 +200,6 @@ public class IndividualRequestAnalyzer {
|
|||
return getIndividualByLocalname(rdfMatch.group(1));
|
||||
}
|
||||
|
||||
// Does the URL look like a namespace prefix followed by a local
|
||||
// name?
|
||||
Matcher prefix_match = NS_PREFIX_URL.matcher(url);
|
||||
if (prefix_match.matches() && prefix_match.groupCount() == 2) {
|
||||
return getIndividualByPrefixAndLocalname(prefix_match.group(1),
|
||||
prefix_match.group(2));
|
||||
}
|
||||
|
||||
// Couldn't match it to anything.
|
||||
return null;
|
||||
} catch (Throwable e) {
|
||||
|
@ -299,12 +289,6 @@ public class IndividualRequestAnalyzer {
|
|||
return getIndividualByUri(uri);
|
||||
}
|
||||
|
||||
private Individual getIndividualByPrefixAndLocalname(String prefix,
|
||||
String localName) {
|
||||
String ns = analysisContext.getNamespaceForPrefix(prefix);
|
||||
return getIndividualByUri(ns + localName);
|
||||
}
|
||||
|
||||
private Individual getIndividualByNetId(String netId) {
|
||||
return analysisContext.getIndividualByNetId(netId);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue