Remove unused field from PropertyTemplateModel
This commit is contained in:
parent
fcaa94088e
commit
3ba7346ac4
4 changed files with 15 additions and 18 deletions
|
@ -38,9 +38,9 @@ public class DataPropertyStatementTemplateModel extends BaseTemplateModel {
|
||||||
private String dataPropHash = null;
|
private String dataPropHash = null;
|
||||||
|
|
||||||
DataPropertyStatementTemplateModel(String subjectUri, String propertyUri,
|
DataPropertyStatementTemplateModel(String subjectUri, String propertyUri,
|
||||||
Literal value2, EditingPolicyHelper policyHelper) {
|
Literal value, EditingPolicyHelper policyHelper) {
|
||||||
|
|
||||||
this.value = value2;
|
this.value = value;
|
||||||
|
|
||||||
if (policyHelper != null) {
|
if (policyHelper != null) {
|
||||||
this.subjectUri = subjectUri;
|
this.subjectUri = subjectUri;
|
||||||
|
|
|
@ -9,8 +9,6 @@ import java.util.Map;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyDecision;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.DropObjectPropStmt;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.DropObjectPropStmt;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.EditObjPropStmt;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.EditObjPropStmt;
|
||||||
|
|
|
@ -111,14 +111,14 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
|
||||||
|
|
||||||
if (hasDefaultListView()) {
|
if (hasDefaultListView()) {
|
||||||
object = DEFAULT_LIST_VIEW_QUERY_OBJECT_VARIABLE_NAME;
|
object = DEFAULT_LIST_VIEW_QUERY_OBJECT_VARIABLE_NAME;
|
||||||
log.debug("Using default list view for property " + getUri() +
|
log.debug("Using default list view for property " + propertyUri +
|
||||||
", so query object = '" + object + "'");
|
", so query object = '" + object + "'");
|
||||||
} else {
|
} else {
|
||||||
String queryString = getQueryString();
|
String queryString = getQueryString();
|
||||||
Matcher m = SUBJECT_PROPERTY_OBJECT_PATTERN.matcher(queryString);
|
Matcher m = SUBJECT_PROPERTY_OBJECT_PATTERN.matcher(queryString);
|
||||||
if (m.find()) {
|
if (m.find()) {
|
||||||
object = m.group(1);
|
object = m.group(1);
|
||||||
log.debug("Query object for property " + getUri() + " = '" + object + "'");
|
log.debug("Query object for property " + propertyUri + " = '" + object + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,23 +17,20 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
|
||||||
private static final Log log = LogFactory.getLog(PropertyTemplateModel.class);
|
private static final Log log = LogFactory.getLog(PropertyTemplateModel.class);
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
protected String propertyUri;
|
||||||
|
|
||||||
// For editing
|
// For editing
|
||||||
protected String subjectUri = null;
|
protected String subjectUri = null;
|
||||||
protected String propertyUri = null;
|
|
||||||
protected Property property; // RY DO WE NEED THIS, or just the uri??
|
|
||||||
protected boolean addAccess = false;
|
protected boolean addAccess = false;
|
||||||
|
|
||||||
PropertyTemplateModel(Property property, Individual subject, EditingPolicyHelper policyHelper) {
|
PropertyTemplateModel(Property property, Individual subject, EditingPolicyHelper policyHelper) {
|
||||||
// Do in subclass constructor. The label has not been set on the property, and getting the
|
// Do in subclass constructor. The label has not been set on the property, and the
|
||||||
// label differs between object and data properties.
|
// means of getting the label differs between object and data properties.
|
||||||
// this.name = property.getLabel();
|
// this.name = property.getLabel();
|
||||||
this.propertyUri = property.getURI();
|
propertyUri = property.getURI();
|
||||||
this.property = property;
|
|
||||||
|
|
||||||
if (policyHelper != null) {
|
if (policyHelper != null) {
|
||||||
subjectUri = subject.getURI();
|
subjectUri = subject.getURI();
|
||||||
propertyUri = property.getURI();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +38,11 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getUri() {
|
||||||
|
return propertyUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Access methods for templates */
|
/* Access methods for templates */
|
||||||
|
|
||||||
public abstract String getType();
|
public abstract String getType();
|
||||||
|
@ -49,10 +51,7 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUri() {
|
|
||||||
return propertyUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract String getAddUrl();
|
public abstract String getAddUrl();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue