VIVO-266 and VIVO-24 improvements to restriction editing
This commit is contained in:
parent
a719e6b706
commit
688b858641
3 changed files with 23 additions and 6 deletions
|
@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
|
import com.hp.hpl.jena.vocabulary.OWL;
|
||||||
import com.hp.hpl.jena.vocabulary.RDFS;
|
import com.hp.hpl.jena.vocabulary.RDFS;
|
||||||
import com.ibm.icu.text.Collator;
|
import com.ibm.icu.text.Collator;
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@ public class RestrictionRetryController extends BaseEditController {
|
||||||
List<Option> onPropertyList = new LinkedList<Option>();
|
List<Option> onPropertyList = new LinkedList<Option>();
|
||||||
Collections.sort(pList, new PropSorter());
|
Collections.sort(pList, new PropSorter());
|
||||||
for (Property p: pList) {
|
for (Property p: pList) {
|
||||||
onPropertyList.add( new Option(p.getURI(),p.getLocalNameWithPrefix()) );
|
onPropertyList.add( new Option(p.getURI(),p.getPickListName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
epo.setFormObject(new FormObject());
|
epo.setFormObject(new FormObject());
|
||||||
|
@ -117,8 +118,20 @@ public class RestrictionRetryController extends BaseEditController {
|
||||||
private List<Option> getValueClassOptionList(VitroRequest request) {
|
private List<Option> getValueClassOptionList(VitroRequest request) {
|
||||||
List<Option> valueClassOptionList = new LinkedList<Option>();
|
List<Option> valueClassOptionList = new LinkedList<Option>();
|
||||||
VClassDao vcDao = request.getUnfilteredWebappDaoFactory().getVClassDao();
|
VClassDao vcDao = request.getUnfilteredWebappDaoFactory().getVClassDao();
|
||||||
for (VClass vc: vcDao.getAllVclasses()) {
|
List<VClass> vclasses = vcDao.getAllVclasses();
|
||||||
valueClassOptionList.add(new Option(vc.getURI(), vc.getLocalNameWithPrefix()));
|
boolean addOwlThing = true;
|
||||||
|
for (VClass vclass : vclasses) {
|
||||||
|
if (OWL.Thing.getURI().equals(vclass.getURI())) {
|
||||||
|
addOwlThing = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(addOwlThing) {
|
||||||
|
vclasses.add(new VClass(OWL.Thing.getURI()));
|
||||||
|
}
|
||||||
|
Collections.sort(vclasses);
|
||||||
|
for (VClass vc: vclasses) {
|
||||||
|
valueClassOptionList.add(new Option(vc.getURI(), vc.getPickListName()));
|
||||||
}
|
}
|
||||||
return valueClassOptionList;
|
return valueClassOptionList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,9 +183,11 @@ public class DataPropertyDaoJena extends PropertyDaoJena implements
|
||||||
if (!VitroVocabulary.vitroURI.equals(dp.getNamespace())) {
|
if (!VitroVocabulary.vitroURI.equals(dp.getNamespace())) {
|
||||||
log.debug("datapropFromOntProperty(): no ontology object found for the namespace "+dp.getNamespace());
|
log.debug("datapropFromOntProperty(): no ontology object found for the namespace "+dp.getNamespace());
|
||||||
}
|
}
|
||||||
|
dp.setLocalNameWithPrefix(dp.getLocalName());
|
||||||
|
dp.setPickListName(getLabelOrId(op));
|
||||||
} else {
|
} else {
|
||||||
dp.setLocalNameWithPrefix(o.getPrefix()==null?(o.getName()==null?"unspec:"+dp.getLocalName():o.getName()+":"+dp.getLocalName()):o.getPrefix()+":"+dp.getLocalName());
|
dp.setLocalNameWithPrefix(o.getPrefix()==null?(o.getName()==null?"unspec:"+dp.getLocalName():o.getName()+":"+dp.getLocalName()):o.getPrefix()+":"+dp.getLocalName());
|
||||||
dp.setPickListName(dp.getLocalName()+o.getPrefix()==null?(o.getName()==null?" (unspec:)":" ("+o.getName()+")"):" ("+o.getPrefix()+")");
|
dp.setPickListName(getLabelOrId(op)+o.getPrefix()==null?(o.getName()==null?" (unspec:)":" ("+o.getName()+")"):" ("+o.getPrefix()+")");
|
||||||
}
|
}
|
||||||
dp.setName(op.getLocalName());
|
dp.setName(op.getLocalName());
|
||||||
dp.setPublicName(getLabelOrId(op));
|
dp.setPublicName(getLabelOrId(op));
|
||||||
|
|
|
@ -96,15 +96,17 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
|
||||||
p.setLocalName(op.getLocalName());
|
p.setLocalName(op.getLocalName());
|
||||||
OntologyDao oDao=getWebappDaoFactory().getOntologyDao();
|
OntologyDao oDao=getWebappDaoFactory().getOntologyDao();
|
||||||
Ontology o = oDao.getOntologyByURI(p.getNamespace());
|
Ontology o = oDao.getOntologyByURI(p.getNamespace());
|
||||||
if (o==null) {
|
if (o == null) {
|
||||||
if (!VitroVocabulary.vitroURI.equals(p.getNamespace())) {
|
if (!VitroVocabulary.vitroURI.equals(p.getNamespace())) {
|
||||||
log.debug("propertyFromOntProperty(): no ontology object found for the namespace "+p.getNamespace());
|
log.debug("propertyFromOntProperty(): no ontology object found for the namespace "+p.getNamespace());
|
||||||
}
|
}
|
||||||
|
p.setLocalNameWithPrefix(p.getLocalName());
|
||||||
|
p.setPickListName(getLabelOrId(op));
|
||||||
} else {
|
} else {
|
||||||
String prefix = o.getPrefix()==null?(o.getName()==null?"unspec":o.getName()):o.getPrefix();
|
String prefix = o.getPrefix()==null?(o.getName()==null?"unspec":o.getName()):o.getPrefix();
|
||||||
p.setLocalNameWithPrefix(prefix+":"+p.getLocalName());
|
p.setLocalNameWithPrefix(prefix+":"+p.getLocalName());
|
||||||
//log.warn("setting pickListName to: "+p.getLocalName()+" ("+prefix+")");
|
//log.warn("setting pickListName to: "+p.getLocalName()+" ("+prefix+")");
|
||||||
p.setPickListName(p.getLocalName()+" ("+prefix+")");
|
p.setPickListName(getLabelOrId(op) + " ("+prefix+")");
|
||||||
}
|
}
|
||||||
String propertyName = getPropertyStringValue(op,PROPERTY_FULLPROPERTYNAMEANNOT);
|
String propertyName = getPropertyStringValue(op,PROPERTY_FULLPROPERTYNAMEANNOT);
|
||||||
if (op.getLabel(null) != null)
|
if (op.getLabel(null) != null)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue