NIHVIVO-3357 - updated autocomplete generator and autocomplete template: generator returns empty list in case only owl:Thing returned, as Solr search doesn't create the index using this class, and updated freemarker template so that the type parameter for autocomplete is only passed in case the types list from the generator is not empty. Also added similar logic for parameter value for "multiple types"

This commit is contained in:
hjkhjk54 2012-01-06 17:40:49 +00:00
parent 9d520d14b5
commit 225a254b71
2 changed files with 26 additions and 2 deletions

View file

@ -59,9 +59,18 @@ public class AutocompleteObjectPropertyFormGenerator extends DefaultObjectProper
for(VClass v: vclasses) {
types.add(v.getURI());
}
//if types array contains only owl:Thing, the search will not return any results
//In this case, return an empty array
if(isOWLThing(types)) {
return new ArrayList<String>();
}
return types;
}
private boolean isOWLThing(List<String> types) {
return(types.size() == 1 && types.get(0).equals(VitroVocabulary.OWL_THING));
}
public EditMode getEditMode(VitroRequest vreq) {
//In this case, the original jsp didn't rely on FrontEndEditingUtils
//but instead relied on whether or not the object Uri existed