work on application ontology support for property/class configuration

This commit is contained in:
brianjlowe 2013-08-06 10:34:33 -04:00
parent d8d704064e
commit dd80f542ea
2 changed files with 10 additions and 16 deletions

View file

@ -286,7 +286,7 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
public ObjectProperty getObjectPropertyByURIAndRangeURI(String propertyURI, String rangeURI) {
ObjectProperty op = getObjectPropertyByURI(propertyURI);
if (op == null) {
if (op == null || rangeURI == null) {
return op;
}
op.setRangeVClassURI(rangeURI);

View file

@ -215,9 +215,9 @@ public class EditRequestDispatchController extends FreemarkerHttpServlet {
// *** check for a predicate URI in the request
}else if( predicateUri != null && !predicateUri.isEmpty() ){
Property prop = getProperty( predicateUri, vreq);
Property prop = getProperty( predicateUri, rangeUri, vreq);
if (prop != null && rangeUri != null) {
editConfGeneratorName = getCustomEntryFormForPropertyAndRange(prop, rangeUri);
editConfGeneratorName = getCustomEntryForm(prop);
} else if( prop != null && prop.getCustomEntryForm() != null ){
//there is a custom form, great! let's use it.
editConfGeneratorName = prop.getCustomEntryForm();
@ -247,25 +247,19 @@ public class EditRequestDispatchController extends FreemarkerHttpServlet {
return editConfGeneratorName;
}
private String getCustomEntryFormForPropertyAndRange(Property prop, String rangeUri){
String entryFormName = null;
// = ApplicationConfigurationOntologyUtils.getEntryForm(prop.getURI(), rangeUri);
if (entryFormName == null) {
if (prop.getCustomEntryForm() != null) {
return prop.getCustomEntryForm();
} else {
return DEFAULT_OBJ_FORM;
}
private String getCustomEntryForm(Property prop){
if (prop.getCustomEntryForm() == null) {
return DEFAULT_OBJ_FORM;
} else {
prop.setCustomEntryForm(entryFormName);
return entryFormName;
return prop.getCustomEntryForm();
}
}
private Property getProperty(String predicateUri, VitroRequest vreq) {
private Property getProperty(String predicateUri, String rangeUri, VitroRequest vreq) {
Property p = null;
try{
p = vreq.getWebappDaoFactory().getObjectPropertyDao().getObjectPropertyByURI(predicateUri);
p = vreq.getWebappDaoFactory().getObjectPropertyDao().getObjectPropertyByURIAndRangeURI(
predicateUri, rangeUri);
if(p == null) {
p = vreq.getWebappDaoFactory().getDataPropertyDao().getDataPropertyByURI(predicateUri);
}