updating pullProperty() to pull property/class combos
This commit is contained in:
parent
a270043063
commit
887cc94e8d
3 changed files with 13 additions and 4 deletions
|
@ -457,11 +457,16 @@ public class GroupedPropertyList extends BaseTemplateModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PropertyTemplateModel pullProperty(String propertyUri) {
|
public PropertyTemplateModel pullProperty(String propertyUri) {
|
||||||
|
return pullProperty(propertyUri, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PropertyTemplateModel pullProperty(String propertyUri, String rangeUri) {
|
||||||
|
|
||||||
for (PropertyGroupTemplateModel pgtm : groups) {
|
for (PropertyGroupTemplateModel pgtm : groups) {
|
||||||
List<PropertyTemplateModel> properties = pgtm.getProperties();
|
List<PropertyTemplateModel> properties = pgtm.getProperties();
|
||||||
for (PropertyTemplateModel ptm : properties) {
|
for (PropertyTemplateModel ptm : properties) {
|
||||||
if (propertyUri.equals(ptm.getUri())) {
|
if (propertyUri.equals(ptm.getUri()) &&
|
||||||
|
(rangeUri == null || rangeUri.equals(ptm.getRangeUri()))) {
|
||||||
// Remove the property from the group.
|
// Remove the property from the group.
|
||||||
// NB Works with a for-each loop instead of an iterator,
|
// NB Works with a for-each loop instead of an iterator,
|
||||||
// since iteration doesn't continue after the remove.
|
// since iteration doesn't continue after the remove.
|
||||||
|
|
|
@ -80,7 +80,6 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
|
||||||
private PropertyListConfig config;
|
private PropertyListConfig config;
|
||||||
private String objectKey;
|
private String objectKey;
|
||||||
private String sortDirection;
|
private String sortDirection;
|
||||||
private String rangeURI;
|
|
||||||
|
|
||||||
ObjectPropertyTemplateModel(ObjectProperty op, Individual subject, VitroRequest vreq,
|
ObjectPropertyTemplateModel(ObjectProperty op, Individual subject, VitroRequest vreq,
|
||||||
boolean editing)
|
boolean editing)
|
||||||
|
@ -90,7 +89,7 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
|
||||||
setName(op.getDomainPublic());
|
setName(op.getDomainPublic());
|
||||||
|
|
||||||
sortDirection = op.getDomainEntitySortDirection();
|
sortDirection = op.getDomainEntitySortDirection();
|
||||||
rangeURI = op.getRangeVClassURI();
|
rangeUri = op.getRangeVClassURI();
|
||||||
|
|
||||||
// Get the config for this object property
|
// Get the config for this object property
|
||||||
try {
|
try {
|
||||||
|
@ -157,7 +156,7 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
|
||||||
|
|
||||||
protected List<Map<String, String>> getStatementData() {
|
protected List<Map<String, String>> getStatementData() {
|
||||||
ObjectPropertyStatementDao opDao = vreq.getWebappDaoFactory().getObjectPropertyStatementDao();
|
ObjectPropertyStatementDao opDao = vreq.getWebappDaoFactory().getObjectPropertyStatementDao();
|
||||||
return opDao.getObjectPropertyStatementsForIndividualByProperty(subjectUri, propertyUri, objectKey, rangeURI, getSelectQuery(), getConstructQueries(), sortDirection);
|
return opDao.getObjectPropertyStatementsForIndividualByProperty(subjectUri, propertyUri, objectKey, rangeUri, getSelectQuery(), getConstructQueries(), sortDirection);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract boolean isEmpty();
|
protected abstract boolean isEmpty();
|
||||||
|
|
|
@ -29,6 +29,7 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
|
||||||
protected final VitroRequest vreq;
|
protected final VitroRequest vreq;
|
||||||
protected final String subjectUri;
|
protected final String subjectUri;
|
||||||
protected final String propertyUri;
|
protected final String propertyUri;
|
||||||
|
protected String rangeUri;
|
||||||
private final String localName;
|
private final String localName;
|
||||||
|
|
||||||
protected Map<String, Object> verboseDisplay;
|
protected Map<String, Object> verboseDisplay;
|
||||||
|
@ -110,6 +111,10 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
|
||||||
return propertyUri;
|
return propertyUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getRangeUri() {
|
||||||
|
return rangeUri;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAddUrl() {
|
public String getAddUrl() {
|
||||||
//log.info("addUrl=" + addUrl);
|
//log.info("addUrl=" + addUrl);
|
||||||
return (addUrl != null) ? addUrl : "";
|
return (addUrl != null) ? addUrl : "";
|
||||||
|
|
Loading…
Add table
Reference in a new issue