<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@ taglib uri="http://vitro.mannlib.cornell.edu/vitro/tags/PropertyEditLink" prefix="edLnk" %> <%@ taglib uri="http://vitro.mannlib.cornell.edu/vitro/tags/StringProcessorTag" prefix="p" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Portal" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.dao.PropertyInstanceDao" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.PropertyInstance" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Property" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.KeywordProperty" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.PropertyGroup" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.dao.PropertyGroupDao" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataProperty" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.RdfLiteralHash" %> <%@ page import="java.util.Collection" %> <%@ page import="java.util.Collections" %> <%@ page import="java.util.Comparator" %> <%@ page import="java.util.List" %> <%@ page import="java.util.ArrayList" %> <%@ page import="java.util.Iterator" %> <%@ page import="java.util.HashSet" %> <%@ page import="org.apache.commons.logging.Log" %> <%@ page import="org.apache.commons.logging.LogFactory" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %> <%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %> <%! public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.templates.entity.entityMergedPropsList.jsp"); %> <% if( VitroRequestPrep.isSelfEditing(request) ) { log.debug("setting showSelfEdits true");%> <% } if (loginHandler!=null && loginHandler.getLoginStatus()=="authenticated" && Integer.parseInt(loginHandler.getLoginRole())>=loginHandler.getNonEditor()) { log.debug("setting showCuratorEdits true");%> <% } String unassignedPropGroupName=null; String unassignedName = (String) request.getAttribute("unassignedPropsGroupName"); if (unassignedName != null && unassignedName.length()>0) { unassignedPropGroupName=unassignedName; log.debug("found temp group attribute \""+unassignedName+"\" for unassigned properties"); }%> <%-- just moving this into page scope for easy use --%> <%-- likewise --%> <% Individual subject = (Individual) request.getAttribute("entity"); if (subject==null) { throw new Error("Subject individual must be in request scope for entityMergedPropsList.jsp"); } // Nick wants not to use explicit parameters to trigger visibility of a div, but for now we don't just want to always show the 1st one String openingGroupLocalName = (String) request.getParameter("curgroup"); VitroRequest vreq = new VitroRequest(request); // added to permit distinguishing links outside the current portal int currentPortalId = -1; Portal currentPortal = vreq.getPortal(); if (currentPortal!=null) { currentPortalId = currentPortal.getPortalId(); } WebappDaoFactory wdf = vreq.getWebappDaoFactory(); PropertyGroupDao pgDao = wdf.getPropertyGroupDao(); ArrayList groupsList = (ArrayList) request.getAttribute("groupsList"); if (groupsList!=null && groupsList.size()>0) { // first do the list of headers if (groupsList.size()==1) { for (PropertyGroup pg : groupsList) { if (unassignedPropGroupName != null && !unassignedPropGroupName.equalsIgnoreCase(pg.getName())) { log.debug("only one group ["+pg.getName() +"] so rendering without group headers"); } request.setAttribute("mergedList",pg.getPropertyList()); } %><% return; }%> <%--
    <% for (PropertyGroup pg : groupsList ) { if (openingGroupLocalName == null || openingGroupLocalName.equals("")) { openingGroupLocalName = pg.getLocalName(); } String styleStr = "display: inline;"; if (openingGroupLocalName.equals(pg.getLocalName())) {%>
  • <%=pg.getName()%>
  • <% } else { %>
  • <%=pg.getName()%>
  • <% } } %>
--%> <% // now display the properties themselves, by group for (PropertyGroup g : groupsList) {%> <%-- Getting the count of properties in each group --%> <% int propTotal = g.getPropertyList().size(); %>

<%=g.getName()%>

<% for (Property p : g.getPropertyList()) {%> <% if (p instanceof ObjectProperty) { ObjectProperty op = (ObjectProperty)p;%>

${objProp.editLabel}

<% /* arbitrary limit if value is unset, i.e. -1 */ %>
  • <%-- <% ObjectPropertyStatement oStmt = (ObjectPropertyStatement)request.getAttribute("opStmt"); if (oStmt!=null) { Individual obj= (Individual)oStmt.getObject(); if (obj != null) { if (!obj.doesFlag1Match(currentPortalId)) {%> <% } } }%> --%> ${editLinks} (non-editable)
<% } else if (p instanceof DataProperty) { DataProperty dp = (DataProperty)p;%>

${dataProp.editLabel}

<%-- just put in a single "edit" link, not an "add" link that expands to reveal edit/delete links --%> ${editLinks} (non-editable) <%-- creates an add link, even if displayLimit is unset, i.e. -1 --%> <%-- set to an arbitrary but high positive limit if unset on property, i.e. -1 --%> <%-- don't leave just one statement to expand --%> <%-- c:if test="${displayLimit < 0}">
    ${dataPropertyStmt.data} ${editLinks} (non-editable)
  • ${dataPropertyStmt.data} ${editLinks} (non-editable)
<% } else { // keyword property -- ignore if (p instanceof KeywordProperty) {%>

Not expecting keyword properties here.

<% } else { log.warn("unexpected unknown property type found");%>

Unknown property type found

<% } } %><% } // end for (Property p : g.getPropertyList() %>
back to top <% } // end for (PropertyGroup g : groupsList) } else { log.debug("incoming groups list with merged properties not found as request attribute for subject "+subject.getName()+"\n"); } %>