Minor cleanup - omit problematic call to super.doGet(). Add some generics.
This commit is contained in:
parent
6ebb72a09d
commit
1c1d48a971
6 changed files with 28 additions and 69 deletions
|
@ -28,17 +28,8 @@ public class AllClassGroupsListingController extends BaseEditController {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
if(!checkLoginStatus(request,response))
|
||||
return;
|
||||
|
||||
try {
|
||||
super.doGet(request, response);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
VitroRequest vreq = new VitroRequest(request);
|
||||
Portal portal = vreq.getPortal();
|
||||
|
||||
|
@ -56,9 +47,7 @@ public class AllClassGroupsListingController extends BaseEditController {
|
|||
results.add("XX");
|
||||
|
||||
if (groups != null) {
|
||||
Iterator<VClassGroup> groupsIt = groups.iterator();
|
||||
while (groupsIt.hasNext()) {
|
||||
VClassGroup vcg = (VClassGroup) groupsIt.next();
|
||||
for(VClassGroup vcg: groups) {
|
||||
results.add("XX");
|
||||
String publicName = vcg.getPublicName();
|
||||
if ( StringUtils.isBlank(publicName) ) {
|
||||
|
@ -82,7 +71,7 @@ public class AllClassGroupsListingController extends BaseEditController {
|
|||
results.add("@@entities");
|
||||
Iterator<VClass> classIt = classList.iterator();
|
||||
while (classIt.hasNext()) {
|
||||
VClass vcw = (VClass) classIt.next();
|
||||
VClass vcw = classIt.next();
|
||||
results.add("XX");
|
||||
if (vcw.getName() != null && vcw.getURI() != null) {
|
||||
try {
|
||||
|
|
|
@ -48,19 +48,12 @@ public class ClassHierarchyListingController extends BaseEditController {
|
|||
|
||||
private VClassDao vcDao = null;
|
||||
|
||||
@Override
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) {
|
||||
VitroRequest vrequest = new VitroRequest(request);
|
||||
Portal portal = vrequest.getPortal();
|
||||
|
||||
try {
|
||||
|
||||
try {
|
||||
super.doGet(request, response);
|
||||
} catch (Exception e) {
|
||||
log.error("Exception calling super.doGet() from "+this.getClass().getName()+":");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
boolean inferred = (vrequest.getParameter("inferred") != null);
|
||||
|
||||
if (vrequest.getAssertionsWebappDaoFactory() != null && !inferred) {
|
||||
|
@ -69,7 +62,7 @@ public class ClassHierarchyListingController extends BaseEditController {
|
|||
vcDao = vrequest.getFullWebappDaoFactory().getVClassDao();
|
||||
}
|
||||
|
||||
ArrayList results = new ArrayList();
|
||||
ArrayList<String> results = new ArrayList<String>();
|
||||
results.add("XX"); // column 1
|
||||
results.add("class"); // column 2
|
||||
results.add("shortdef"); // column 3
|
||||
|
@ -83,7 +76,7 @@ public class ClassHierarchyListingController extends BaseEditController {
|
|||
String ontologyUri = request.getParameter("ontologyUri");
|
||||
String startClassUri = request.getParameter("vclassUri");
|
||||
|
||||
List roots = null;
|
||||
List<VClass> roots = null;
|
||||
|
||||
if (ontologyUri != null) {
|
||||
roots = vcDao.getOntologyRootClasses(ontologyUri);
|
||||
|
|
|
@ -48,24 +48,18 @@ public class DataPropertyHierarchyListingController extends BaseEditController {
|
|||
private PropertyGroupDao pgDao = null;
|
||||
private DatatypeDao dDao = null;
|
||||
|
||||
@Override
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) {
|
||||
VitroRequest vrequest = new VitroRequest(request);
|
||||
Portal portal = vrequest.getPortal();
|
||||
try {
|
||||
|
||||
try {
|
||||
super.doGet(request, response);
|
||||
} catch (Exception e) {
|
||||
log.error("Exception calling super.doGet() from "+this.getClass().getName()+":");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
dpDao = vrequest.getAssertionsWebappDaoFactory().getDataPropertyDao();
|
||||
vcDao = vrequest.getAssertionsWebappDaoFactory().getVClassDao();
|
||||
pgDao = vrequest.getAssertionsWebappDaoFactory().getPropertyGroupDao();
|
||||
dDao = vrequest.getAssertionsWebappDaoFactory().getDatatypeDao();
|
||||
|
||||
ArrayList results = new ArrayList();
|
||||
ArrayList<String> results = new ArrayList<String>();
|
||||
results.add("XX"); // column 1
|
||||
results.add("property"); // column 2
|
||||
results.add("domain vclass"); // column 3
|
||||
|
@ -79,7 +73,7 @@ public class DataPropertyHierarchyListingController extends BaseEditController {
|
|||
String ontologyUri = request.getParameter("ontologyUri");
|
||||
String startPropertyUri = request.getParameter("propertyUri");
|
||||
|
||||
List roots = null;
|
||||
List<DataProperty> roots = null;
|
||||
|
||||
if (startPropertyUri != null) {
|
||||
roots = new LinkedList<DataProperty>();
|
||||
|
@ -92,7 +86,7 @@ public class DataPropertyHierarchyListingController extends BaseEditController {
|
|||
}
|
||||
|
||||
if (roots!=null) {
|
||||
Iterator rootIt = roots.iterator();
|
||||
Iterator<DataProperty> rootIt = roots.iterator();
|
||||
if (!rootIt.hasNext()) {
|
||||
DataProperty dp = new DataProperty();
|
||||
dp.setURI(ontologyUri+"fake");
|
||||
|
@ -102,7 +96,7 @@ public class DataPropertyHierarchyListingController extends BaseEditController {
|
|||
results.addAll(addDataPropertyDataToResultsList(dp,0,ontologyUri));
|
||||
} else {
|
||||
while (rootIt.hasNext()) {
|
||||
DataProperty root = (DataProperty) rootIt.next();
|
||||
DataProperty root = rootIt.next();
|
||||
if ( (ontologyUri==null) || ( (ontologyUri!=null) && (root.getNamespace()!=null) && (ontologyUri.equals(root.getNamespace())) ) ) {
|
||||
ArrayList childResults = new ArrayList();
|
||||
addChildren(root, childResults, 0, ontologyUri);
|
||||
|
|
|
@ -46,23 +46,17 @@ public class ObjectPropertyHierarchyListingController extends BaseEditController
|
|||
private VClassDao vcDao = null;
|
||||
private PropertyGroupDao pgDao = null;
|
||||
|
||||
@Override
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) {
|
||||
VitroRequest vrequest = new VitroRequest(request);
|
||||
Portal portal = vrequest.getPortal();
|
||||
try {
|
||||
|
||||
try {
|
||||
super.doGet(request, response);
|
||||
} catch (Exception e) {
|
||||
log.error("Exception calling super.doGet() from "+this.getClass().getName()+":");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
opDao = vrequest.getAssertionsWebappDaoFactory().getObjectPropertyDao();
|
||||
vcDao = vrequest.getAssertionsWebappDaoFactory().getVClassDao();
|
||||
pgDao = vrequest.getAssertionsWebappDaoFactory().getPropertyGroupDao();
|
||||
|
||||
ArrayList results = new ArrayList();
|
||||
ArrayList<String> results = new ArrayList<String>();
|
||||
results.add("XX"); // column 1
|
||||
results.add("property"); // column 2
|
||||
results.add("domain vclass"); // column 3
|
||||
|
@ -76,7 +70,7 @@ public class ObjectPropertyHierarchyListingController extends BaseEditController
|
|||
String ontologyUri = request.getParameter("ontologyUri");
|
||||
String startPropertyUri = request.getParameter("propertyUri");
|
||||
|
||||
List roots = null;
|
||||
List<ObjectProperty> roots = null;
|
||||
|
||||
if (startPropertyUri != null) {
|
||||
roots = new LinkedList<ObjectProperty>();
|
||||
|
@ -89,7 +83,7 @@ public class ObjectPropertyHierarchyListingController extends BaseEditController
|
|||
}
|
||||
|
||||
if (roots!=null) {
|
||||
Iterator rootIt = roots.iterator();
|
||||
Iterator<ObjectProperty> rootIt = roots.iterator();
|
||||
if (!rootIt.hasNext()) {
|
||||
ObjectProperty op = new ObjectProperty();
|
||||
op.setURI(ontologyUri+"fake");
|
||||
|
@ -98,7 +92,7 @@ public class ObjectPropertyHierarchyListingController extends BaseEditController
|
|||
results.addAll(addObjectPropertyDataToResultsList(op,0,ontologyUri));
|
||||
} else {
|
||||
while (rootIt.hasNext()) {
|
||||
ObjectProperty root = (ObjectProperty) rootIt.next();
|
||||
ObjectProperty root = rootIt.next();
|
||||
if ( (ontologyUri==null) || ( (ontologyUri!=null) && (root.getNamespace()!=null) && (ontologyUri.equals(root.getNamespace())) ) ) {
|
||||
ArrayList childResults = new ArrayList();
|
||||
addChildren(root, childResults, 0, ontologyUri);
|
||||
|
|
|
@ -27,12 +27,6 @@ public class OntologiesListingController extends BaseEditController {
|
|||
VitroRequest vrequest = new VitroRequest(request);
|
||||
Portal portal = vrequest.getPortal();
|
||||
|
||||
try {
|
||||
super.doGet(request, response);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
//need to figure out how to structure the results object to put the classes underneath
|
||||
|
||||
String noResultsMsgStr = "No ontologies found";
|
||||
|
|
|
@ -28,14 +28,8 @@ import edu.cornell.mannlib.vitro.webapp.dao.PropertyGroupDao;
|
|||
@RequiresAuthorizationFor(UseOntologyEditorPages.class)
|
||||
public class PropertyGroupsListingController extends BaseEditController {
|
||||
|
||||
@Override
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
try {
|
||||
super.doGet(request, response);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
VitroRequest vrequest = new VitroRequest(request);
|
||||
Portal portal = vrequest.getPortal();
|
||||
|
||||
|
@ -43,9 +37,9 @@ public class PropertyGroupsListingController extends BaseEditController {
|
|||
|
||||
PropertyGroupDao dao = vrequest.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||
|
||||
List groups = dao.getPublicGroups(true);
|
||||
List<PropertyGroup> groups = dao.getPublicGroups(true);
|
||||
|
||||
ArrayList results = new ArrayList();
|
||||
ArrayList<String> results = new ArrayList<String>();
|
||||
results.add("XX");
|
||||
results.add("Group");
|
||||
results.add("Public description");
|
||||
|
@ -139,12 +133,13 @@ public class PropertyGroupsListingController extends BaseEditController {
|
|||
|
||||
}
|
||||
|
||||
private class PropertyGroupDisplayComparator implements Comparator {
|
||||
public int compare (Object o1, Object o2) {
|
||||
private class PropertyGroupDisplayComparator implements Comparator<PropertyGroup> {
|
||||
@Override
|
||||
public int compare (PropertyGroup o1, PropertyGroup o2) {
|
||||
try {
|
||||
int diff = ((PropertyGroup)o1).getDisplayRank() - ((PropertyGroup)o2).getDisplayRank();
|
||||
int diff = o1.getDisplayRank() - o2.getDisplayRank();
|
||||
if (diff==0) {
|
||||
return ((PropertyGroup)o1).getName().compareToIgnoreCase(((PropertyGroup)o2).getName());
|
||||
return o1.getName().compareToIgnoreCase(o2.getName());
|
||||
}
|
||||
return diff;
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue