work on VIVO-303 picklist sorting and display

This commit is contained in:
brianjlowe 2013-10-08 09:40:57 -04:00
parent 967278217f
commit 5293824fa2
37 changed files with 280 additions and 349 deletions

View file

@ -1,23 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.controller.edit;
import junit.framework.Assert;
import org.junit.Test;
import edu.cornell.mannlib.vedit.beans.Option;
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
public class IndividualTypeRetryControllerTest extends AbstractTestClass {
@Test
public void optionCollator(){
IndividualTypeRetryController.OptionCollator oc = new IndividualTypeRetryController.OptionCollator();
int comp = oc.compare(
new Option("foo", "foo"),
new Option("Person", "foaf:Person") );
//we just want compare() to not throw an exception
}
}

View file

@ -113,6 +113,7 @@ public class VClassJenaTest {
Assert.assertEquals(vClassJena.getName(), vClass.getName());
Assert.assertEquals(vClassJena.getLocalNameWithPrefix(), vClass.getLocalNameWithPrefix());
Assert.assertEquals(vClassJena.getPickListName(), vClass.getPickListName());
Assert.assertEquals(vClassJena.getExample(), vClass.getExample());
Assert.assertEquals(vClassJena.getDescription(), vClass.getDescription());
@ -162,7 +163,7 @@ public class VClassJenaTest {
VClass vcw = new VClass();
cls.getModel().enterCriticalSection(Lock.READ);
vcw.setName(getLabelForClass(cls,false,false,wadf));
vcw.setLocalNameWithPrefix(getLabelForClass(cls,true,false,wadf));
vcw.setLocalNameWithPrefix(wadf.makeLocalNameWithPrefix(vcw));
vcw.setPickListName(getLabelForClass(cls,false,true,wadf));
try {
if (cls.isAnon()) {
@ -232,18 +233,6 @@ public class VClassJenaTest {
}
}
vcw.setProhibitedFromUpdateBelowRoleLevel(prohibitedRoleLevel);//this might get set to null
// We need a better way of caching the counts. For now I'm only setting 0 for the empty classes, to hide them from the DWR editing
//ClosableIterator typeIt = getOntModel().listStatements(null,RDF.type,cls);
//try {
// if (!typeIt.hasNext()) {
// vcw.setEntityCount(0);
// }
//} finally {
// typeIt.close();
//}
} finally {
cls.getModel().leaveCriticalSection();

View file

@ -81,7 +81,17 @@ public class IndividualStub implements Individual {
public String getName() {
return name;
}
@Override
public String getLabel() {
return getName();
}
@Override
public String getPickListName() {
return getName();
}
@Override
public List<DataPropertyStatement> getDataPropertyStatements() {
return new ArrayList<DataPropertyStatement>(dpsSet);