From f6ff54120d48f7ec7003fccc6bc1c554e5f28a9a Mon Sep 17 00:00:00 2001 From: rjy7 Date: Fri, 3 Dec 2010 17:30:18 +0000 Subject: [PATCH] NIHVIVO-1333 Handle property group for unassigned properties, and case where no property groups are defined --- .../vitro/webapp/beans/KeywordProperty.java | 2 +- .../mannlib/vitro/webapp/beans/Property.java | 22 +-- .../DashboardPropertyListController.java | 14 +- .../EntityMergedPropertyListController.java | 18 +-- .../vitro/webapp/dao/PropertyGroupDao.java | 2 +- .../dao/filtering/DataPropertyFiltering.java | 8 +- .../filtering/ObjectPropertyFiltering.java | 8 +- .../filtering/PropertyGroupDaoFiltering.java | 4 +- .../webapp/dao/jena/PropertyGroupDaoJena.java | 2 +- .../individual/PropertyList.java | 6 +- .../individual/PropertyListBuilder.java | 138 ++++++++++-------- .../entity/entityMergedPropsList.jsp | 4 +- .../entity/entityMergedPropsListUngrouped.jsp | 4 +- .../body/individual/individual-properties.ftl | 26 +++- .../freemarker/body/individual/individual.ftl | 6 +- 15 files changed, 155 insertions(+), 109 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/beans/KeywordProperty.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/beans/KeywordProperty.java index d6a5b264d..99134708c 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/beans/KeywordProperty.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/beans/KeywordProperty.java @@ -13,7 +13,7 @@ public class KeywordProperty extends Property implements Comparable objectPropertyList = subject.getObjectPropertyList(); for (ObjectProperty op : objectPropertyList) { - op.setEditLabel(op.getDomainPublic()); + op.setLabel(op.getDomainPublic()); mergedPropertyList.add(op); } } else { @@ -122,7 +122,7 @@ public class DashboardPropertyListController extends VitroHttpServlet { for (PropertyInstance pi : allPropInstColl) { if (pi!=null) { ObjectProperty op = opDao.getObjectPropertyByURI(pi.getPropertyURI()); - op.setEditLabel(op.getDomainPublic()); // no longer relevant: pi.getSubjectSide() ? op.getDomainPublic() : op.getRangePublic()); + op.setLabel(op.getDomainPublic()); // no longer relevant: pi.getSubjectSide() ? op.getDomainPublic() : op.getRangePublic()); mergedPropertyList.add(op); } else { log.error("a property instance in the Collection created by PropertyInstanceDao.getAllPossiblePropInstForIndividual() is unexpectedly null"); @@ -138,7 +138,7 @@ public class DashboardPropertyListController extends VitroHttpServlet { // now do much the same with data properties: get the list of populated data properties, then add in placeholders for missing ones List dataPropertyList = subject.getDataPropertyList(); for (DataProperty dp : dataPropertyList) { - dp.setEditLabel(dp.getPublicName()); + dp.setLabel(dp.getPublicName()); mergedPropertyList.add(dp); } } else { @@ -147,7 +147,7 @@ public class DashboardPropertyListController extends VitroHttpServlet { if (allDatapropColl != null) { for (DataProperty dp : allDatapropColl ) { if (dp!=null) { - dp.setEditLabel(dp.getPublicName()); + dp.setLabel(dp.getPublicName()); mergedPropertyList.add(dp); } else { log.error("a data property in the Collection created in DataPropertyDao.getAllPossibleDatapropsForIndividual() is unexpectedly null)"); @@ -243,7 +243,7 @@ public class DashboardPropertyListController extends VitroHttpServlet { int count = groupsList.size(); PropertyGroup tempGroup = null; if (unassignedGroupName!=null) { - tempGroup = pgDao.createTempPropertyGroup(unassignedGroupName,MAX_GROUP_DISPLAY_RANK); + tempGroup = pgDao.createDummyPropertyGroup(unassignedGroupName,MAX_GROUP_DISPLAY_RANK); log.debug("creating temp property group "+unassignedGroupName+" for any unassigned properties"); } switch (count) { @@ -270,7 +270,7 @@ public class DashboardPropertyListController extends VitroHttpServlet { if (tempGroup!=null) { // not assigned any group yet and are creating a group for unassigned properties if (!alreadyOnPropertyList(tempGroup.getPropertyList(),p)) { tempGroup.getPropertyList().add(p); - log.debug("adding property "+p.getEditLabel()+" to members of temp group "+unassignedGroupName); + log.debug("adding property "+p.getLabel()+" to members of temp group "+unassignedGroupName); } } // otherwise don't put that property on the list } else if (p.getGroupURI().equals(pg.getURI())) { @@ -350,7 +350,7 @@ public class DashboardPropertyListController extends VitroHttpServlet { if (diff==0) { diff = determineDisplayRank(p1) - determineDisplayRank(p2); if (diff==0) { - return p1.getEditLabel().compareTo(p2.getEditLabel()); + return p1.getLabel().compareTo(p2.getLabel()); } else { return diff; } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/EntityMergedPropertyListController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/EntityMergedPropertyListController.java index d2d06c6c2..a30cb3ab4 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/EntityMergedPropertyListController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/EntityMergedPropertyListController.java @@ -120,7 +120,7 @@ public class EntityMergedPropertyListController extends VitroHttpServlet { for (ObjectProperty op : objectPropertyList) { if (!SUPPRESSED_OBJECT_PROPERTIES.contains(op)) { - op.setEditLabel(op.getDomainPublic()); + op.setLabel(op.getDomainPublic()); mergedPropertyList.add(op); }else{ log.debug("suppressed " + op.getURI()); @@ -142,7 +142,7 @@ public class EntityMergedPropertyListController extends VitroHttpServlet { } else if (op.getURI() == null) { log.error("ObjectProperty op returned with null propertyURI from opDao.getObjectPropertyByURI()"); } else if (!alreadyOnPropertyList(mergedPropertyList,op)) { - op.setEditLabel(op.getDomainPublic()); + op.setLabel(op.getDomainPublic()); mergedPropertyList.add(op); } } @@ -158,7 +158,7 @@ public class EntityMergedPropertyListController extends VitroHttpServlet { // now do much the same with data properties: get the list of populated data properties, then add in placeholders for missing ones List dataPropertyList = subject.getDataPropertyList(); for (DataProperty dp : dataPropertyList) { - dp.setEditLabel(dp.getPublicName()); + dp.setLabel(dp.getPublicName()); mergedPropertyList.add(dp); } @@ -171,7 +171,7 @@ public class EntityMergedPropertyListController extends VitroHttpServlet { if (dp.getURI() == null) { log.error("DataProperty dp returned with null propertyURI from dpDao.getAllPossibleDatapropsForIndividual()"); } else if (!alreadyOnPropertyList(mergedPropertyList,dp)) { - dp.setEditLabel(dp.getPublicName()); + dp.setLabel(dp.getPublicName()); mergedPropertyList.add(dp); } } else { @@ -309,7 +309,7 @@ public class EntityMergedPropertyListController extends VitroHttpServlet { int count = groupsList.size(); PropertyGroup tempGroup = null; if (unassignedGroupName!=null) { - tempGroup = pgDao.createTempPropertyGroup(unassignedGroupName,MAX_GROUP_DISPLAY_RANK); + tempGroup = pgDao.createDummyPropertyGroup(unassignedGroupName,MAX_GROUP_DISPLAY_RANK); log.debug("creating temp property group "+unassignedGroupName+" for any unassigned properties"); } switch (count) { @@ -336,7 +336,7 @@ public class EntityMergedPropertyListController extends VitroHttpServlet { if (tempGroup!=null) { // not assigned any group yet and are creating a group for unassigned properties if (!alreadyOnPropertyList(tempGroup.getPropertyList(),p)) { tempGroup.getPropertyList().add(p); - log.debug("adding property "+p.getEditLabel()+" to members of temp group "+unassignedGroupName); + log.debug("adding property "+p.getLabel()+" to members of temp group "+unassignedGroupName); } } // otherwise don't put that property on the list } else if (p.getGroupURI().equals(pg.getURI())) { @@ -405,7 +405,7 @@ public class EntityMergedPropertyListController extends VitroHttpServlet { } } } catch (Exception ex) { - log.error("Cannot retrieve p1GroupRank for group "+p1.getEditLabel()); + log.error("Cannot retrieve p1GroupRank for group "+p1.getLabel()); } int p2GroupRank=MAX_GROUP_RANK; @@ -417,7 +417,7 @@ public class EntityMergedPropertyListController extends VitroHttpServlet { } } } catch (Exception ex) { - log.error("Cannot retrieve p2GroupRank for group "+p2.getEditLabel()); + log.error("Cannot retrieve p2GroupRank for group "+p2.getLabel()); } // int diff = pgDao.getGroupByURI(p1.getGroupURI()).getDisplayRank() - pgDao.getGroupByURI(p2.getGroupURI()).getDisplayRank(); @@ -425,7 +425,7 @@ public class EntityMergedPropertyListController extends VitroHttpServlet { if (diff==0) { diff = determineDisplayRank(p1) - determineDisplayRank(p2); if (diff==0) { - return p1.getEditLabel().compareTo(p2.getEditLabel()); + return p1.getLabel().compareTo(p2.getLabel()); } else { return diff; } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/PropertyGroupDao.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/PropertyGroupDao.java index c4a61712e..16b9c4c83 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/PropertyGroupDao.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/PropertyGroupDao.java @@ -15,7 +15,7 @@ public interface PropertyGroupDao { public abstract int removeUnpopulatedGroups(List groups); - public PropertyGroup createTempPropertyGroup(String name, int rank); + public PropertyGroup createDummyPropertyGroup(String name, int rank); public String insertNewPropertyGroup(PropertyGroup group); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/DataPropertyFiltering.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/DataPropertyFiltering.java index 2545d0af3..26028bc8f 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/DataPropertyFiltering.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/DataPropertyFiltering.java @@ -79,8 +79,8 @@ public class DataPropertyFiltering extends DataProperty { } @Override - public String getEditLabel() { - return innerDataProperty.getEditLabel(); + public String getLabel() { + return innerDataProperty.getLabel(); } @Override @@ -164,8 +164,8 @@ public class DataPropertyFiltering extends DataProperty { } @Override - public void setEditLabel(String label) { - innerDataProperty.setEditLabel(label); + public void setLabel(String label) { + innerDataProperty.setLabel(label); } @Override diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/ObjectPropertyFiltering.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/ObjectPropertyFiltering.java index 0da90e39f..457fd0ae9 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/ObjectPropertyFiltering.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/ObjectPropertyFiltering.java @@ -116,8 +116,8 @@ public class ObjectPropertyFiltering extends ObjectProperty { } @Override - public String getEditLabel() { - return innerObjectProperty.getEditLabel(); + public String getLabel() { + return innerObjectProperty.getLabel(); } @Override @@ -354,8 +354,8 @@ public class ObjectPropertyFiltering extends ObjectProperty { } @Override - public void setEditLabel(String label) { - innerObjectProperty.setEditLabel(label); + public void setLabel(String label) { + innerObjectProperty.setLabel(label); } @Override diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/PropertyGroupDaoFiltering.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/PropertyGroupDaoFiltering.java index ea6e40388..73a021400 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/PropertyGroupDaoFiltering.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/PropertyGroupDaoFiltering.java @@ -81,8 +81,8 @@ public class PropertyGroupDaoFiltering implements PropertyGroupDao { return groups; } - public PropertyGroup createTempPropertyGroup(String name, int rank) { - return innerDao.createTempPropertyGroup(name, rank); + public PropertyGroup createDummyPropertyGroup(String name, int rank) { + return innerDao.createDummyPropertyGroup(name, rank); } public String insertNewPropertyGroup(PropertyGroup group) { diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyGroupDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyGroupDaoJena.java index 1e6a97882..784cc1d7c 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyGroupDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyGroupDaoJena.java @@ -206,7 +206,7 @@ public class PropertyGroupDaoJena extends JenaBaseDao implements PropertyGroupDa } } - public PropertyGroup createTempPropertyGroup(String name, int rank) { + public PropertyGroup createDummyPropertyGroup(String name, int rank) { PropertyGroup newGroup = new PropertyGroup(); newGroup.setName(name); newGroup.setDisplayRank(rank); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyList.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyList.java index d0745ab8c..7ad667031 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyList.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyList.java @@ -170,7 +170,7 @@ public class PropertyList extends BaseTemplateModel { } } } catch (Exception ex) { - log.error("Cannot retrieve p1GroupRank for group "+p1.getEditLabel()); + log.error("Cannot retrieve p1GroupRank for group "+p1.getLabel()); } int p2GroupRank=MAX_GROUP_RANK; @@ -182,7 +182,7 @@ public class PropertyList extends BaseTemplateModel { } } } catch (Exception ex) { - log.error("Cannot retrieve p2GroupRank for group "+p2.getEditLabel()); + log.error("Cannot retrieve p2GroupRank for group "+p2.getLabel()); } // int diff = pgDao.getGroupByURI(p1.getGroupURI()).getDisplayRank() - pgDao.getGroupByURI(p2.getGroupURI()).getDisplayRank(); @@ -190,7 +190,7 @@ public class PropertyList extends BaseTemplateModel { if (diff==0) { diff = determineDisplayRank(p1) - determineDisplayRank(p2); if (diff==0) { - return p1.getEditLabel().compareTo(p2.getEditLabel()); + return p1.getLabel().compareTo(p2.getLabel()); } else { return diff; } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyListBuilder.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyListBuilder.java index e78e9a02d..3e84f580a 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyListBuilder.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyListBuilder.java @@ -67,7 +67,7 @@ public class PropertyListBuilder { // don't need to set editLabel, can just do this: //propertyList.addAll(objectPropertyList); for (ObjectProperty op : objectPropertyList) { - op.setEditLabel(op.getDomainPublic()); + op.setLabel(op.getDomainPublic()); propertyList.add(op); } @@ -84,7 +84,7 @@ public class PropertyListBuilder { //propertyList.addAll(subject.getPopulatedDataPropertyList()); List dataPropertyList = subject.getPopulatedDataPropertyList(); for (DataProperty dp : dataPropertyList) { - dp.setEditLabel(dp.getPublicName()); + dp.setLabel(dp.getPublicName()); propertyList.add(dp); } @@ -197,55 +197,75 @@ public class PropertyListBuilder { log.error("a null Collection is returned from DataPropertyDao.getAllPossibleDatapropsForIndividual())"); } } - + private List addPropertiesToGroups(List propertyList) { - + // Get the property groups PropertyGroupDao pgDao = wdf.getPropertyGroupDao(); List groupList = pgDao.getPublicGroups(false); // may be returned empty but not null + // To test no property groups defined, use: + // List groupList = new ArrayList(); + + int groupCount = groupList.size(); + + /* + * If no property groups are defined, create a dummy group with a null name to signal to the template that it's + * not a real group. This allows the looping structure in the template to be the same whether there are groups or not. + */ + if (groupCount == 0) { + log.warn("groupList has no groups on entering addPropertiesToGroups(); will create a new group"); + PropertyGroup dummyGroup = pgDao.createDummyPropertyGroup(null, 1); + dummyGroup.getPropertyList().addAll(propertyList); + sortGroupPropertyList(dummyGroup.getName(), propertyList); + groupList.add(dummyGroup); + return groupList; + } + + /* + * This group will hold properties that are not assigned to any groups. In case no real property groups are + * populated, we end up with the dummy group case above, and we will change the name to null to signal to the + * template that it shouldn't be treated like a group. + */ + PropertyGroup groupForUnassignedProperties = pgDao.createDummyPropertyGroup("", MAX_GROUP_DISPLAY_RANK); - int groupsCount=0; - try { - groupsCount = populateGroupsListWithProperties(pgDao, groupList, propertyList); - } catch (Exception ex) { - log.error("Exception on trying to populate groups list with properties: "+ex.getMessage()); - ex.printStackTrace(); + if (groupCount > 1) { + try { + Collections.sort(groupList); + } catch (Exception ex) { + log.error("Exception on sorting groupList in addPropertiesToGroups()"); + } } + + populateGroupListWithProperties(groupList, groupForUnassignedProperties, propertyList); + + // Remove unpopulated groups try { int removedCount = pgDao.removeUnpopulatedGroups(groupList); if (removedCount == 0) { - log.warn("Of "+groupsCount+" groups, none removed by removeUnpopulatedGroups"); - /* } else { - log.warn("Of "+groupsCount+" groups, "+removedCount+" removed by removeUnpopulatedGroups"); */ + log.warn("Of "+groupCount+" groups, none removed by removeUnpopulatedGroups"); } - groupsCount -= removedCount; + groupCount -= removedCount; } catch (Exception ex) { log.error("Exception on trying to prune groups list with properties: "+ex.getMessage()); } - return null; + + // If the group for unassigned properties is populated, add it to the group list. + if (groupForUnassignedProperties.getPropertyList().size() > 0) { + groupList.add(groupForUnassignedProperties); + // If no real property groups are populated, the groupForUnassignedProperties moves from case 2 to case 1 above, so change + // the name to null to signal to the templates that there are no real groups. + if (groupCount == 0) { + groupForUnassignedProperties.setName(null); + } + } + + return groupList; } - - private int populateGroupsListWithProperties(PropertyGroupDao pgDao, List groupList, List propertyList) { - int count = groupList.size(); - PropertyGroup tempGroup = null; - String unassignedGroupName = ""; // temp, for compilation - if (unassignedGroupName!=null) { - tempGroup = pgDao.createTempPropertyGroup(unassignedGroupName,MAX_GROUP_DISPLAY_RANK); - log.debug("creating temp property group "+unassignedGroupName+" for any unassigned properties"); - } - switch (count) { - case 0: log.warn("groupsList has no groups on entering populateGroupsListWithProperties(); will create a new group \"other\""); - break; - case 1: break; - default: try { - Collections.sort(groupList); - } catch (Exception ex) { - log.error("Exception on sorting groupsList in populateGroupsListWithProperties()"); - } - } - if (count==0 && unassignedGroupName!=null) { - groupList.add(tempGroup); - } + + private void populateGroupListWithProperties(List groupList, + PropertyGroup groupForUnassignedProperties, List propertyList) { + + // Assign the properties to the groups for (PropertyGroup pg : groupList) { if (pg.getPropertyList().size()>0) { pg.getPropertyList().clear(); @@ -253,33 +273,35 @@ public class PropertyListBuilder { for (Property p : propertyList) { if (p.getURI() == null) { log.error("Property p has null URI in populateGroupsListWithProperties()"); + // If the property is not assigned to any group, add it to the group for unassigned properties } else if (p.getGroupURI()==null) { - if (tempGroup!=null) { // not assigned any group yet and are creating a group for unassigned properties - if (!alreadyOnPropertyList(tempGroup.getPropertyList(),p)) { - - tempGroup.getPropertyList().add(p); - log.debug("adding property "+p.getEditLabel()+" to members of temp group "+unassignedGroupName); + if (groupForUnassignedProperties!=null) { + // RY How could it happen that it's already in the group? Maybe we can remove this case. + if (!alreadyOnPropertyList(groupForUnassignedProperties.getPropertyList(),p)) { + groupForUnassignedProperties.getPropertyList().add(p); + log.debug("adding property "+p.getLabel()+" to group for unassigned propertiues"); } - } // otherwise don't put that property on the list + } + // Otherwise, if the property is assigned to this group, add it to the group if it's not already there } else if (p.getGroupURI().equals(pg.getURI())) { + // RY How could it happen that it's already in the group? Maybe we can remove this case. if (!alreadyOnPropertyList(pg.getPropertyList(),p)) { pg.getPropertyList().add(p); } } } - if (pg.getPropertyList().size()>1) { - try { - Collections.sort(pg.getPropertyList(),new Property.DisplayComparatorIgnoringPropertyGroup()); - } catch (Exception ex) { - log.error("Exception sorting property group "+pg.getName()+" property list: "+ex.getMessage()); - } - } + sortGroupPropertyList(pg.getName(), pg.getPropertyList()); } - if (count>0 && tempGroup!=null && tempGroup.getPropertyList().size()>0) { - groupList.add(tempGroup); - } - count = groupList.size(); - return count; + } + + private void sortGroupPropertyList(String groupName, List propertyList) { + if (propertyList.size()>1) { + try { + Collections.sort(propertyList,new Property.DisplayComparatorIgnoringPropertyGroup()); + } catch (Exception ex) { + log.error("Exception sorting property group "+ groupName + " property list: "+ex.getMessage()); + } + } } private class PropertyRanker implements Comparator { @@ -308,7 +330,7 @@ public class PropertyListBuilder { } } } catch (Exception ex) { - log.error("Cannot retrieve p1GroupRank for group "+p1.getEditLabel()); + log.error("Cannot retrieve p1GroupRank for group "+p1.getLabel()); } int p2GroupRank=MAX_GROUP_RANK; @@ -320,7 +342,7 @@ public class PropertyListBuilder { } } } catch (Exception ex) { - log.error("Cannot retrieve p2GroupRank for group "+p2.getEditLabel()); + log.error("Cannot retrieve p2GroupRank for group "+p2.getLabel()); } // int diff = pgDao.getGroupByURI(p1.getGroupURI()).getDisplayRank() - pgDao.getGroupByURI(p2.getGroupURI()).getDisplayRank(); @@ -328,7 +350,7 @@ public class PropertyListBuilder { if (diff==0) { diff = determineDisplayRank(p1) - determineDisplayRank(p2); if (diff==0) { - return p1.getEditLabel().compareTo(p2.getEditLabel()); + return p1.getLabel().compareTo(p2.getLabel()); } else { return diff; } diff --git a/webapp/web/templates/entity/entityMergedPropsList.jsp b/webapp/web/templates/entity/entityMergedPropsList.jsp index 0f1a88775..c950d10e5 100644 --- a/webapp/web/templates/entity/entityMergedPropsList.jsp +++ b/webapp/web/templates/entity/entityMergedPropsList.jsp @@ -147,7 +147,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
-

${objProp.editLabel}

+

${objProp.label}

<%-- Verbose property display additions for object properties, using context variable verbosePropertyListing --%> @@ -272,7 +272,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
-

${dataProp.editLabel}

+

${dataProp.label}

diff --git a/webapp/web/templates/entity/entityMergedPropsListUngrouped.jsp b/webapp/web/templates/entity/entityMergedPropsListUngrouped.jsp index 51f83cb84..70d78854c 100644 --- a/webapp/web/templates/entity/entityMergedPropsListUngrouped.jsp +++ b/webapp/web/templates/entity/entityMergedPropsListUngrouped.jsp @@ -96,7 +96,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
-

${objProp.editLabel}

+

${objProp.label}

<%-- Verbose property display additions for object properties, using context variable verbosePropertyListing --%> @@ -227,7 +227,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
-

${dataProp.editLabel}

+

${dataProp.label}

<%-- Verbose property display additions for data properties, using context variable verbosePropertyListing --%> diff --git a/webapp/web/templates/freemarker/body/individual/individual-properties.ftl b/webapp/web/templates/freemarker/body/individual/individual-properties.ftl index 50eaec361..0b218ee63 100644 --- a/webapp/web/templates/freemarker/body/individual/individual-properties.ftl +++ b/webapp/web/templates/freemarker/body/individual/individual-properties.ftl @@ -2,4 +2,28 @@ <#-- Template for property listing on individual profile page --> -<#assign properties = individual.propertyList> +<#assign propertyGroups = individual.propertyList> + +<#list propertyGroups as group> + + <#-- Display the group heading --> + <#-- If there are no groups, a dummy group has been created with a null name. --> + <#if ! group.name??> + <#-- Here you might just do nothing and proceed to list the properties as in the grouped case, + or you might choose different markup for the groupless case. --> + <#-- This is the group for properties not assigned to any group. It has an empty name. --> + <#elseif group.name?length == 0> +

other

+ <#else> +

${group.name}

+ + + <#-- Now list the properties in the group --> +

Number of properties in group: ${group.propertyList?size}

<#-- testing --> + <#-- + <#list group.properties as property> + + + --> + + \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/individual/individual.ftl b/webapp/web/templates/freemarker/body/individual/individual.ftl index 14026c2eb..77e7fa7a6 100644 --- a/webapp/web/templates/freemarker/body/individual/individual.ftl +++ b/webapp/web/templates/freemarker/body/individual/individual.ftl @@ -72,7 +72,8 @@
- <#-- <#include "individual-properties.ftl"> --> + <#-- Ontology properties --> + <#include "individual-properties.ftl"> <#-- Keywords --> <#if individual.keywords?has_content> @@ -187,8 +188,7 @@ ${stylesheets.addFromTheme("/css/entity.css")} <#-- RY Figure out which of these scripts really need to go into the head, and which are needed at all (e.g., tinyMCE??) --> -${headScripts.add("/js/jquery.js", - "/js/jquery_plugins/getUrlParam.js", +${headScripts.add("/js/jquery_plugins/getUrlParam.js", "/js/jquery_plugins/colorAnimations.js", "/js/propertyGroupSwitcher.js", "/js/jquery_plugins/jquery.form.js",