NIHVIVO-161 Don't show "main image" as an object propety in the editing list.

This commit is contained in:
jeb228 2010-06-30 18:39:35 +00:00
parent ceb1bb2af9
commit 7b3b9d27e8

View file

@ -4,6 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.controller;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
@ -36,6 +37,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao; import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.PropertyGroupDao; import edu.cornell.mannlib.vitro.webapp.dao.PropertyGroupDao;
import edu.cornell.mannlib.vitro.webapp.dao.PropertyInstanceDao; import edu.cornell.mannlib.vitro.webapp.dao.PropertyInstanceDao;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
import edu.cornell.mannlib.vitro.webapp.servlet.setup.PropertyMaskingSetup; import edu.cornell.mannlib.vitro.webapp.servlet.setup.PropertyMaskingSetup;
@ -59,6 +61,11 @@ public class EntityMergedPropertyListController extends VitroHttpServlet {
private static final Log log = LogFactory.getLog(EntityMergedPropertyListController.class.getName()); private static final Log log = LogFactory.getLog(EntityMergedPropertyListController.class.getName());
private static final int MAX_GROUP_DISPLAY_RANK = 99; private static final int MAX_GROUP_DISPLAY_RANK = 99;
/** Don't include these properties in the list. */
private static final Collection<String> SUPPRESSED_OBJECT_PROPERTIES = Collections
.unmodifiableCollection(Arrays
.asList(new String[] { VitroVocabulary.IND_MAIN_IMAGE }));
public void doGet( HttpServletRequest request, HttpServletResponse res ) public void doGet( HttpServletRequest request, HttpServletResponse res )
throws IOException, ServletException { throws IOException, ServletException {
@ -108,8 +115,10 @@ public class EntityMergedPropertyListController extends VitroHttpServlet {
// now first get the properties this entity actually has, presumably populated with statements // now first get the properties this entity actually has, presumably populated with statements
List<ObjectProperty> objectPropertyList = subject.getObjectPropertyList(); List<ObjectProperty> objectPropertyList = subject.getObjectPropertyList();
for (ObjectProperty op : objectPropertyList) { for (ObjectProperty op : objectPropertyList) {
op.setEditLabel(op.getDomainPublic()); if (!SUPPRESSED_OBJECT_PROPERTIES.contains(op)) {
mergedPropertyList.add(op); op.setEditLabel(op.getDomainPublic());
mergedPropertyList.add(op);
}
} }
if (editMode) { if (editMode) {