VIVO-774 Show correct property name
Also, pre-populate the custom entry generator if the base property has one.
This commit is contained in:
parent
474b0abb44
commit
e79ace9d55
2 changed files with 8 additions and 6 deletions
|
@ -180,6 +180,7 @@ public class FauxPropertyRetryController extends BaseEditController {
|
||||||
.getHiddenFromPublishBelowRoleLevel());
|
.getHiddenFromPublishBelowRoleLevel());
|
||||||
fp.setProhibitedFromUpdateBelowRoleLevel(base
|
fp.setProhibitedFromUpdateBelowRoleLevel(base
|
||||||
.getProhibitedFromUpdateBelowRoleLevel());
|
.getProhibitedFromUpdateBelowRoleLevel());
|
||||||
|
fp.setCustomEntryForm(base.getCustomEntryForm());
|
||||||
log.debug("Created new FauxProperty: " + fp);
|
log.debug("Created new FauxProperty: " + fp);
|
||||||
return fp;
|
return fp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
|
||||||
protected String addUrl;
|
protected String addUrl;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
private FauxProperty fauxProperty;
|
||||||
|
|
||||||
PropertyTemplateModel(Property property, Individual subject, VitroRequest vreq, String name) {
|
PropertyTemplateModel(Property property, Individual subject, VitroRequest vreq, String name) {
|
||||||
this.vreq = vreq;
|
this.vreq = vreq;
|
||||||
|
@ -48,12 +49,14 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
|
||||||
propertyUri = property.getURI();
|
propertyUri = property.getURI();
|
||||||
localName = property.getLocalName();
|
localName = property.getLocalName();
|
||||||
this.name = name;
|
this.name = name;
|
||||||
setVerboseDisplayValues(property);
|
|
||||||
addUrl = "";
|
addUrl = "";
|
||||||
|
|
||||||
// Do in subclass constructor. The label has not been set on the property, and the
|
fauxProperty = isFauxProperty(property);
|
||||||
// means of getting the label differs between object and data properties.
|
if (fauxProperty != null) {
|
||||||
// this.name = property.getLabel();
|
this.name = fauxProperty.getDisplayName();
|
||||||
|
}
|
||||||
|
|
||||||
|
setVerboseDisplayValues(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setVerboseDisplayValues(Property property) {
|
protected void setVerboseDisplayValues(Property property) {
|
||||||
|
@ -100,10 +103,8 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
|
||||||
String editUrl = UrlBuilder.getUrl(getPropertyEditRoute(), "uri", property.getURI());
|
String editUrl = UrlBuilder.getUrl(getPropertyEditRoute(), "uri", property.getURI());
|
||||||
verboseDisplay.put("propertyEditUrl", editUrl);
|
verboseDisplay.put("propertyEditUrl", editUrl);
|
||||||
|
|
||||||
FauxProperty fauxProperty = isFauxProperty(property);
|
|
||||||
if (fauxProperty != null) {
|
if (fauxProperty != null) {
|
||||||
verboseDisplay.put("fauxProperty", assembleFauxPropertyValues(fauxProperty));
|
verboseDisplay.put("fauxProperty", assembleFauxPropertyValues(fauxProperty));
|
||||||
this.name = fauxProperty.getDisplayName();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue