updates to help with autocomplete
This commit is contained in:
parent
5a24f48c15
commit
989f0d9f97
1 changed files with 26 additions and 5 deletions
|
@ -158,8 +158,30 @@ public class EditConfigurationTemplateModel extends BaseTemplateModel {
|
||||||
Individual objectIndividual = EditConfigurationUtils.getObjectIndividual(vreq);
|
Individual objectIndividual = EditConfigurationUtils.getObjectIndividual(vreq);
|
||||||
ObjectProperty prop = EditConfigurationUtils.getObjectProperty(vreq);
|
ObjectProperty prop = EditConfigurationUtils.getObjectProperty(vreq);
|
||||||
Individual subject = EditConfigurationUtils.getSubjectIndividual(vreq);
|
Individual subject = EditConfigurationUtils.getSubjectIndividual(vreq);
|
||||||
|
String propertyTitle = getObjectPropertyNameForDisplay();
|
||||||
if(objectIndividual != null) {
|
if(objectIndividual != null) {
|
||||||
formTitle = "Change entry for: <em>" + prop.getDomainPublic() + " </em>";
|
formTitle = "Change entry for: <em>" + propertyTitle + " </em>";
|
||||||
|
} else {
|
||||||
|
if ( prop.getOfferCreateNewOption() ) {
|
||||||
|
|
||||||
|
log.debug("property set to offer \"create new\" option; custom form: ["+prop.getCustomEntryForm()+"]");
|
||||||
|
formTitle = "Select an existing "+propertyTitle+" for "+subject.getName();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
formTitle = "Add an entry to: <em>"+propertyTitle+"</em>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pageData.put("formTitle", formTitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Also used above and can be used in object auto complete form
|
||||||
|
public String getObjectPropertyNameForDisplay() {
|
||||||
|
String propertyTitle = null;
|
||||||
|
Individual objectIndividual = EditConfigurationUtils.getObjectIndividual(vreq);
|
||||||
|
ObjectProperty prop = EditConfigurationUtils.getObjectProperty(vreq);
|
||||||
|
Individual subject = EditConfigurationUtils.getSubjectIndividual(vreq);
|
||||||
|
if(objectIndividual != null) {
|
||||||
|
propertyTitle = prop.getDomainPublic();
|
||||||
} else {
|
} else {
|
||||||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
||||||
if ( prop.getOfferCreateNewOption() ) {
|
if ( prop.getOfferCreateNewOption() ) {
|
||||||
|
@ -183,14 +205,13 @@ public class EditConfigurationTemplateModel extends BaseTemplateModel {
|
||||||
if( classOfObjectFillers == null )
|
if( classOfObjectFillers == null )
|
||||||
classOfObjectFillers = wdf.getVClassDao().getTopConcept();
|
classOfObjectFillers = wdf.getVClassDao().getTopConcept();
|
||||||
}
|
}
|
||||||
log.debug("property set to offer \"create new\" option; custom form: ["+prop.getCustomEntryForm()+"]");
|
propertyTitle = classOfObjectFillers.getName();
|
||||||
formTitle = "Select an existing "+classOfObjectFillers.getName()+" for "+subject.getName();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
formTitle = "Add an entry to: <em>"+prop.getDomainPublic()+"</em>";
|
propertyTitle = prop.getDomainPublic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pageData.put("formTitle", formTitle);
|
return propertyTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue