NIHVIVO-161 Don't show "main image" as an object propety in the editing list.
This commit is contained in:
parent
ceb1bb2af9
commit
7b3b9d27e8
1 changed files with 13 additions and 4 deletions
|
@ -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,9 +115,11 @@ 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) {
|
||||||
|
if (!SUPPRESSED_OBJECT_PROPERTIES.contains(op)) {
|
||||||
op.setEditLabel(op.getDomainPublic());
|
op.setEditLabel(op.getDomainPublic());
|
||||||
mergedPropertyList.add(op);
|
mergedPropertyList.add(op);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (editMode) {
|
if (editMode) {
|
||||||
// for the full list, in order to show empty properties, now need to merge in new ObjectProperty objects with null objectPropertyStatements
|
// for the full list, in order to show empty properties, now need to merge in new ObjectProperty objects with null objectPropertyStatements
|
||||||
|
|
Loading…
Add table
Reference in a new issue