NIHVIVO-1968 Removed unused methods isPerson(), isOrganization(), getVisualizationUrl(), and isVClass() from IndividualTemplateModel.
This commit is contained in:
parent
eb4d4a9f40
commit
7b18bbe8d6
1 changed files with 18 additions and 33 deletions
|
@ -49,24 +49,24 @@ public class IndividualTemplateModel extends BaseTemplateModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isVClass(String vClassUri) {
|
// private boolean isVClass(String vClassUri) {
|
||||||
boolean isVClass = individual.isVClass(vClassUri);
|
// boolean isVClass = individual.isVClass(vClassUri);
|
||||||
// If reasoning is asynchronous (under RDB), this inference may not have been made yet.
|
// // If reasoning is asynchronous (under RDB), this inference may not have been made yet.
|
||||||
// Check the superclasses of the individual's vclass.
|
// // Check the superclasses of the individual's vclass.
|
||||||
if (!isVClass && SimpleReasoner.isABoxReasoningAsynchronous(getServletContext())) {
|
// if (!isVClass && SimpleReasoner.isABoxReasoningAsynchronous(getServletContext())) {
|
||||||
log.debug("Checking superclasses to see if individual is a " + vClassUri + " because reasoning is asynchronous");
|
// log.debug("Checking superclasses to see if individual is a " + vClassUri + " because reasoning is asynchronous");
|
||||||
List<VClass> directVClasses = individual.getVClasses(true);
|
// List<VClass> directVClasses = individual.getVClasses(true);
|
||||||
for (VClass directVClass : directVClasses) {
|
// for (VClass directVClass : directVClasses) {
|
||||||
VClassDao vcDao = vreq.getWebappDaoFactory().getVClassDao();
|
// VClassDao vcDao = vreq.getWebappDaoFactory().getVClassDao();
|
||||||
List<String> superClassUris = vcDao.getAllSuperClassURIs(directVClass.getURI());
|
// List<String> superClassUris = vcDao.getAllSuperClassURIs(directVClass.getURI());
|
||||||
if (superClassUris.contains(vClassUri)) {
|
// if (superClassUris.contains(vClassUri)) {
|
||||||
isVClass = true;
|
// isVClass = true;
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return isVClass;
|
// return isVClass;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
/* These methods perform some manipulation of the data returned by the Individual methods */
|
/* These methods perform some manipulation of the data returned by the Individual methods */
|
||||||
|
@ -75,10 +75,6 @@ public class IndividualTemplateModel extends BaseTemplateModel {
|
||||||
return UrlBuilder.getIndividualProfileUrl(individual, vreq.getWebappDaoFactory());
|
return UrlBuilder.getIndividualProfileUrl(individual, vreq.getWebappDaoFactory());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVisualizationUrl() {
|
|
||||||
return isPerson() ? getUrl(Route.VISUALIZATION_AJAX.path(), "uri", getUri()) : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This remains as a convenience method for getting the image url. We could instead use a custom list
|
// This remains as a convenience method for getting the image url. We could instead use a custom list
|
||||||
// view for mainImage which would provide this data in the query results.
|
// view for mainImage which would provide this data in the query results.
|
||||||
public String getImageUrl() {
|
public String getImageUrl() {
|
||||||
|
@ -131,17 +127,6 @@ public class IndividualTemplateModel extends BaseTemplateModel {
|
||||||
return urlBuilder.getPortalUrl(Route.INDIVIDUAL_EDIT, "uri", getUri());
|
return urlBuilder.getPortalUrl(Route.INDIVIDUAL_EDIT, "uri", getUri());
|
||||||
}
|
}
|
||||||
|
|
||||||
// RY We should not have references to a specific ontology in the vitro code.
|
|
||||||
// We should subclass IndividualTemplateModel in the VIVO code and add the isPerson()
|
|
||||||
// and getVisualizationUrl() methods there.
|
|
||||||
public boolean isPerson() {
|
|
||||||
return isVClass("http://xmlns.com/foaf/0.1/Person");
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOrganization() {
|
|
||||||
return isVClass("http://xmlns.com/foaf/0.1/Organization");
|
|
||||||
}
|
|
||||||
|
|
||||||
public GroupedPropertyList getPropertyList() {
|
public GroupedPropertyList getPropertyList() {
|
||||||
if (propertyList == null) {
|
if (propertyList == null) {
|
||||||
propertyList = new GroupedPropertyList(individual, vreq, policyHelper);
|
propertyList = new GroupedPropertyList(individual, vreq, policyHelper);
|
||||||
|
|
Loading…
Add table
Reference in a new issue