remove compiler warnings; use new-style "for" loop.
This commit is contained in:
parent
9e2d64fb5f
commit
0fea51aed7
1 changed files with 9 additions and 16 deletions
|
@ -4,11 +4,9 @@ package edu.cornell.mannlib.vitro.webapp.controller.edit.listing;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.text.Collator;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -20,21 +18,20 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Datatype;
|
import edu.cornell.mannlib.vitro.webapp.beans.Datatype;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.PropertyInstance;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.PropertyGroup;
|
import edu.cornell.mannlib.vitro.webapp.beans.PropertyGroup;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.PropertyGroupDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.PropertyGroupDao;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||||
|
|
||||||
public class DatatypePropertiesListingController extends BaseEditController {
|
public class DatatypePropertiesListingController extends BaseEditController {
|
||||||
private final int NUM_COLS = 9;
|
private final int NUM_COLS = 9;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void doGet(HttpServletRequest request, HttpServletResponse response) {
|
public void doGet(HttpServletRequest request, HttpServletResponse response) {
|
||||||
VitroRequest vrequest = new VitroRequest(request);
|
VitroRequest vrequest = new VitroRequest(request);
|
||||||
Portal portal = vrequest.getPortal();
|
Portal portal = vrequest.getPortal();
|
||||||
|
@ -57,7 +54,7 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
||||||
DatatypeDao dDao = vrequest.getFullWebappDaoFactory().getDatatypeDao();
|
DatatypeDao dDao = vrequest.getFullWebappDaoFactory().getDatatypeDao();
|
||||||
PropertyGroupDao pgDao = vrequest.getFullWebappDaoFactory().getPropertyGroupDao();
|
PropertyGroupDao pgDao = vrequest.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||||
|
|
||||||
List props = new ArrayList();
|
List<DataProperty> props = new ArrayList<DataProperty>();
|
||||||
|
|
||||||
if (request.getParameter("propsForClass") != null) {
|
if (request.getParameter("propsForClass") != null) {
|
||||||
noResultsMsgStr = "There are no data properties that apply to this class.";
|
noResultsMsgStr = "There are no data properties that apply to this class.";
|
||||||
|
@ -68,7 +65,7 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
||||||
DataProperty dp = dataPropIt.next();
|
DataProperty dp = dataPropIt.next();
|
||||||
if (!(propURIs.contains(dp.getURI()))) {
|
if (!(propURIs.contains(dp.getURI()))) {
|
||||||
propURIs.add(dp.getURI());
|
propURIs.add(dp.getURI());
|
||||||
DataProperty prop = (DataProperty) dao.getDataPropertyByURI(dp.getURI());
|
DataProperty prop = dao.getDataPropertyByURI(dp.getURI());
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
props.add(prop);
|
props.add(prop);
|
||||||
}
|
}
|
||||||
|
@ -79,10 +76,8 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ontologyUri != null) {
|
if (ontologyUri != null) {
|
||||||
List scratch = new ArrayList();
|
List<DataProperty> scratch = new ArrayList<DataProperty>();
|
||||||
Iterator propIt = props.iterator();
|
for (DataProperty p: props) {
|
||||||
while (propIt.hasNext()) {
|
|
||||||
DataProperty p = (DataProperty) propIt.next();
|
|
||||||
if (p.getNamespace().equals(ontologyUri)) {
|
if (p.getNamespace().equals(ontologyUri)) {
|
||||||
scratch.add(p);
|
scratch.add(p);
|
||||||
}
|
}
|
||||||
|
@ -94,7 +89,7 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
||||||
Collections.sort(props);
|
Collections.sort(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList results = new ArrayList();
|
ArrayList<String> results = new ArrayList<String>();
|
||||||
results.add("XX"); // column 1
|
results.add("XX"); // column 1
|
||||||
results.add("Data Property"); // column 2
|
results.add("Data Property"); // column 2
|
||||||
results.add("domain"); // column 3
|
results.add("domain"); // column 3
|
||||||
|
@ -118,9 +113,7 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
||||||
results.add("");
|
results.add("");
|
||||||
results.add("");
|
results.add("");
|
||||||
} else {
|
} else {
|
||||||
Iterator propsIt = props.iterator();
|
for (DataProperty prop: props) {
|
||||||
while (propsIt.hasNext()) {
|
|
||||||
DataProperty prop = (DataProperty) propsIt.next();
|
|
||||||
results.add("XX"); // column 1
|
results.add("XX"); // column 1
|
||||||
String nameStr = prop.getPublicName()==null ? prop.getName()==null ? prop.getURI()==null ? "(no name)" : prop.getURI() : prop.getName() : prop.getPublicName();
|
String nameStr = prop.getPublicName()==null ? prop.getName()==null ? prop.getURI()==null ? "(no name)" : prop.getURI() : prop.getName() : prop.getPublicName();
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue