NIHVIVO-650 Change servlet mappings so request for individual profile directs to new IndividualController
This commit is contained in:
parent
ca7e496925
commit
7db0ea8938
4 changed files with 48 additions and 21 deletions
|
@ -114,3 +114,5 @@ THE TEMPLATE
|
|||
The query must have been constructed to return orgName (see above under "General query requirements"), or
|
||||
alternatively the template can use the localname function: ${localname(org)}.
|
||||
|
||||
- If a variable is in an OPTIONAL clause in the query, the display of the value in the template should
|
||||
include the default value operator ! to prevent an error on null values.
|
||||
|
|
|
@ -1280,20 +1280,46 @@
|
|||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>entity</servlet-name>
|
||||
<url-pattern>/entityold</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>entity</servlet-name>
|
||||
<url-pattern>/entityold/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>entity</servlet-name>
|
||||
<url-pattern>/individualold/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>entity</servlet-name>
|
||||
<url-pattern>/displayold/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>individual</servlet-name>
|
||||
<url-pattern>/entity</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>entity</servlet-name>
|
||||
<servlet-name>individual</servlet-name>
|
||||
<url-pattern>/entity/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>entity</servlet-name>
|
||||
<servlet-name>individual</servlet-name>
|
||||
<url-pattern>/individual</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>individual</servlet-name>
|
||||
<url-pattern>/individual/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>entity</servlet-name>
|
||||
<servlet-name>individual</servlet-name>
|
||||
<url-pattern>/display</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>individual</servlet-name>
|
||||
<url-pattern>/display/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>updateEntityFlags</servlet-name>
|
||||
<url-pattern>/updateEntityFlags</url-pattern>
|
||||
|
|
|
@ -287,8 +287,8 @@ public class EntityController extends VitroHttpServlet {
|
|||
res.setStatus(res.SC_SEE_OTHER);
|
||||
}
|
||||
|
||||
private static Pattern LINKED_DATA_URL = Pattern.compile("^/individual/([^/]*)$");
|
||||
private static Pattern NS_PREFIX_URL = Pattern.compile("^/individual/([^/]*)/([^/]*)$");
|
||||
private static Pattern LINKED_DATA_URL = Pattern.compile("^/individualold/([^/]*)$");
|
||||
private static Pattern NS_PREFIX_URL = Pattern.compile("^/individualold/([^/]*)/([^/]*)$");
|
||||
|
||||
/**
|
||||
Gets the entity id from the request.
|
||||
|
@ -402,7 +402,7 @@ public class EntityController extends VitroHttpServlet {
|
|||
}
|
||||
|
||||
|
||||
private static Pattern URI_PATTERN = Pattern.compile("^/individual/([^/]*)$");
|
||||
private static Pattern URI_PATTERN = Pattern.compile("^/individualold/([^/]*)$");
|
||||
//Redirect if the request is for http://hostname/individual/localname
|
||||
// if accept is nothing or text/html redirect to ???
|
||||
// if accept is some RDF thing redirect to the URL for RDF
|
||||
|
@ -411,7 +411,7 @@ public class EntityController extends VitroHttpServlet {
|
|||
if( m.matches() && m.groupCount() == 1 ){
|
||||
ContentType c = checkForLinkedDataRequest(url, acceptHeader);
|
||||
if( c != null ){
|
||||
String redirectUrl = "/individual/" + m.group(1) + "/" + m.group(1) ;
|
||||
String redirectUrl = "/individualold/" + m.group(1) + "/" + m.group(1) ;
|
||||
if( RDFXML_MIMETYPE.equals( c.getMediaType()) ){
|
||||
return redirectUrl + ".rdf";
|
||||
}else if( N3_MIMETYPE.equals( c.getMediaType() )){
|
||||
|
@ -427,10 +427,10 @@ public class EntityController extends VitroHttpServlet {
|
|||
}
|
||||
}
|
||||
|
||||
private static Pattern RDF_REQUEST = Pattern.compile("^/individual/([^/]*)/\\1.rdf$");
|
||||
private static Pattern N3_REQUEST = Pattern.compile("^/individual/([^/]*)/\\1.n3$");
|
||||
private static Pattern TTL_REQUEST = Pattern.compile("^/individual/([^/]*)/\\1.ttl$");
|
||||
private static Pattern HTML_REQUEST = Pattern.compile("^/display/([^/]*)$");
|
||||
private static Pattern RDF_REQUEST = Pattern.compile("^/individualold/([^/]*)/\\1.rdf$");
|
||||
private static Pattern N3_REQUEST = Pattern.compile("^/individualold/([^/]*)/\\1.n3$");
|
||||
private static Pattern TTL_REQUEST = Pattern.compile("^/individualold/([^/]*)/\\1.ttl$");
|
||||
private static Pattern HTML_REQUEST = Pattern.compile("^/displayold/([^/]*)$");
|
||||
|
||||
/**
|
||||
* @return null if this is not a linked data request, returns content type if it is a
|
||||
|
|
|
@ -267,9 +267,8 @@ public class IndividualController extends FreemarkerHttpServlet {
|
|||
return new RdfResponseValues(rdfFormat, newModel);
|
||||
}
|
||||
|
||||
// RY **** Remove "fm" from the patterns when switching web.xml to this controller.
|
||||
private static Pattern LINKED_DATA_URL = Pattern.compile("^/individualfm/([^/]*)$");
|
||||
private static Pattern NS_PREFIX_URL = Pattern.compile("^/individualfm/([^/]*)/([^/]*)$");
|
||||
private static Pattern LINKED_DATA_URL = Pattern.compile("^/individual/([^/]*)$");
|
||||
private static Pattern NS_PREFIX_URL = Pattern.compile("^/individual/([^/]*)/([^/]*)$");
|
||||
|
||||
/**
|
||||
Gets the entity id from the request.
|
||||
|
@ -383,7 +382,7 @@ public class IndividualController extends FreemarkerHttpServlet {
|
|||
}
|
||||
|
||||
|
||||
private static Pattern URI_PATTERN = Pattern.compile("^/individualfm/([^/]*)$");
|
||||
private static Pattern URI_PATTERN = Pattern.compile("^/individual/([^/]*)$");
|
||||
//Redirect if the request is for http://hostname/individual/localname
|
||||
// if accept is nothing or text/html redirect to ???
|
||||
// if accept is some RDF thing redirect to the URL for RDF
|
||||
|
@ -402,16 +401,16 @@ public class IndividualController extends FreemarkerHttpServlet {
|
|||
}//else send them to html
|
||||
}
|
||||
//else redirect to HTML representation
|
||||
return UrlBuilder.getUrl("displayfm/" + m.group(1));
|
||||
return UrlBuilder.getUrl("display/" + m.group(1));
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Pattern RDF_REQUEST = Pattern.compile("^/individualfm/([^/]*)/\\1.rdf$");
|
||||
private static Pattern N3_REQUEST = Pattern.compile("^/individualfm/([^/]*)/\\1.n3$");
|
||||
private static Pattern TTL_REQUEST = Pattern.compile("^/individualfm/([^/]*)/\\1.ttl$");
|
||||
private static Pattern HTML_REQUEST = Pattern.compile("^/displayfm/([^/]*)$");
|
||||
private static Pattern RDF_REQUEST = Pattern.compile("^/individual/([^/]*)/\\1.rdf$");
|
||||
private static Pattern N3_REQUEST = Pattern.compile("^/individual/([^/]*)/\\1.n3$");
|
||||
private static Pattern TTL_REQUEST = Pattern.compile("^/individual/([^/]*)/\\1.ttl$");
|
||||
private static Pattern HTML_REQUEST = Pattern.compile("^/display/([^/]*)$");
|
||||
|
||||
/**
|
||||
* @return null if this is not a linked data request, returns content type if it is a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue