merge from nihvivo-rel-1.1-maint branch: moving the individual rendering changes back to the vitro

This commit is contained in:
nac26 2010-07-22 18:38:29 +00:00
parent 23007ba45e
commit fa77c80a91
2 changed files with 151 additions and 71 deletions

View file

@ -80,6 +80,7 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
<c:set var='themeDir'><c:out value='${portalBean.themeDir}' /></c:set> <c:set var='themeDir'><c:out value='${portalBean.themeDir}' /></c:set>
<div id="content"> <div id="content">
<div id="personWrap">
<jsp:include page="entityAdmin.jsp"/> <jsp:include page="entityAdmin.jsp"/>
<div class="contents entity ${editingClass}"> <div class="contents entity ${editingClass}">
@ -126,6 +127,55 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
<jsp:include page="sparklineVisualization.jsp"/> <jsp:include page="sparklineVisualization.jsp"/>
<!-- END Sparkline Visualization --> <!-- END Sparkline Visualization -->
<%-- Thumbnail --%>
<c:set var="isPerson" value='<%= entity.isVClass("http://xmlns.com/foaf/0.1/Person") %>' />
<c:set var="hasImage" value="${!empty entity.thumbUrl}" />
<c:set var="imageLinks"><edLnk:editLinks item="<%= VitroVocabulary.IND_MAIN_IMAGE %>" icons="false" /></c:set>
<c:choose>
<c:when test="${!isPerson && !hasImage}">
<c:if test="${showEdits && !empty imageLinks}">
<div id="dprop-vitro-image" class="propsItem ${editingClass}">
<h3 class="propertyName">image</h3>
${imageLinks}
</div>
</c:if>
</c:when>
<c:when test="${isPerson && !hasImage}">
<div id="dprop-vitro-image" class="propsItem ${editingClass}">
<div class="datatypeProperties">
<div class="datatypePropertyValue">
<div class="statementWrap thumbnail">
<img src="<c:url value='/images/dummyImages/person.thumbnail.jpg'/>"
title="no image" alt="" width="115"/>
<c:if test="${showEdits}">
<span class="editLinks">${imageLinks}</span>
</c:if>
</div>
</div>
</div>
</div>
</c:when>
<c:otherwise> <%-- hasImage --%>
<div id="dprop-vitro-image" class="propsItem ${editingClass}">
<div class="datatypeProperties">
<div class="datatypePropertyValue">
<div class="statementWrap thumbnail">
<a class="image" href="${pageContext.request.contextPath}${entity.imageUrl}">
<img src="${pageContext.request.contextPath}${entity.thumbUrl}"
title="click to view larger image"
alt="" width="115"/>
</a>
<c:if test="${showEdits}">
<span class="editLinks">${imageLinks}</span>
</c:if>
</div>
</div>
</div>
</div>
<jsp:include page="entityCitation.jsp" />
</c:otherwise>
</c:choose>
<%-- Links --%> <%-- Links --%>
<c:if test="${ showEdits || !empty entity.url || !empty entity.linksList }"> <c:if test="${ showEdits || !empty entity.url || !empty entity.linksList }">
<div id="dprop-vitro-links" class="propsItem ${editingClass}"> <div id="dprop-vitro-links" class="propsItem ${editingClass}">
@ -190,59 +240,11 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
</div> <!-- end dprop-vitro-links --> </div> <!-- end dprop-vitro-links -->
</c:if> </c:if>
<%-- Thumbnail --%>
<c:set var="isPerson" value='<%= entity.isVClass("http://xmlns.com/foaf/0.1/Person") %>' />
<c:set var="hasImage" value="${!empty entity.thumbUrl}" />
<c:set var="imageLinks"><edLnk:editLinks item="<%= VitroVocabulary.IND_MAIN_IMAGE %>" icons="false" /></c:set>
<c:choose>
<c:when test="${!isPerson && !hasImage}">
<c:if test="${showEdits && !empty imageLinks}">
<div id="dprop-vitro-image" class="propsItem ${editingClass}">
<h3 class="propertyName">image</h3>
${imageLinks}
</div>
</c:if>
</c:when>
<c:when test="${isPerson && !hasImage}">
<div id="dprop-vitro-image" class="propsItem ${editingClass}">
<div class="datatypeProperties">
<div class="datatypePropertyValue">
<div class="statementWrap thumbnail">
<img src="<c:url value='/images/dummyImages/person.thumbnail.jpg'/>"
title="no image" alt="" width="115"/>
<c:if test="${showEdits}">
<span class="editLinks">${imageLinks}</span>
</c:if>
</div>
</div>
</div>
</div>
</c:when>
<c:otherwise> <%-- hasImage --%>
<div id="dprop-vitro-image" class="propsItem ${editingClass}">
<div class="datatypeProperties">
<div class="datatypePropertyValue">
<div class="statementWrap thumbnail">
<a class="image" href="${pageContext.request.contextPath}${entity.imageUrl}">
<img src="${pageContext.request.contextPath}${entity.thumbUrl}"
title="click to view larger image"
alt="" width="115"/>
</a>
<c:if test="${showEdits}">
<span class="editLinks">${imageLinks}</span>
</c:if>
</div>
</div>
</div>
</div>
<jsp:include page="entityCitation.jsp" />
</c:otherwise>
</c:choose>
<%-- Description --%> <%-- Description --%>
<%--
<c:if test="${ showEdits || !empty entity.description}"> <c:if test="${ showEdits || !empty entity.description}">
<c:if test="${not empty entity.description }"> <c:if test="${not empty entity.description }">
<c:set var="editLinksForExisitngDesc"><edLnk:editLinks item="<%= VitroVocabulary.DESCRIPTION %>" data="${entity.description}" icons="false"/></c:set> <c:set var="editLinksForExistingDesc"><edLnk:editLinks item="<%= VitroVocabulary.DESCRIPTION %>" data="${entity.description}" icons="false"/></c:set>
</c:if> </c:if>
<c:set var="editLinksForNewDesc"><edLnk:editLinks item="<%= VitroVocabulary.DESCRIPTION %>" icons="false"/></c:set> <c:set var="editLinksForNewDesc"><edLnk:editLinks item="<%= VitroVocabulary.DESCRIPTION %>" icons="false"/></c:set>
<c:set var="mayEditDesc" value="${showEdits && ((empty entity.description and not empty editLinksForNewDesc) or (not empty entity.description and not empty editLinksForExisitngDesc))}"/> <c:set var="mayEditDesc" value="${showEdits && ((empty entity.description and not empty editLinksForNewDesc) or (not empty entity.description and not empty editLinksForExisitngDesc))}"/>
@ -257,8 +259,8 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
<div class="datatypePropertyValue"> <div class="datatypePropertyValue">
<div class="statementWrap"> <div class="statementWrap">
<div class="description"><p:process>${entity.description}</p:process></div> <div class="description"><p:process>${entity.description}</p:process></div>
<c:if test="${showEdits && !empty editLinksForExisitngDesc}"> <c:if test="${showEdits && !empty editLinksForExistingDesc}">
<span class="editLinks">${editLinksForExisitngDesc}</span> <span class="editLinks">${editLinksForExistingDesc}</span>
</c:if> </c:if>
</div> </div>
</div> </div>
@ -268,14 +270,14 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
</div> </div>
</c:if> </c:if>
</c:if> </c:if>
--%>
<%-- Ontology properties --%> <%-- Ontology properties --%>
<c:import url="${entityMergedPropsListJsp}"> <c:import url="${entityMergedPropsListJsp}">
<c:param name="mode" value="${showEdits ? 'edit' : ''}"/> <c:param name="mode" value="${showEdits ? 'edit' : ''}"/>
<c:param name="grouped" value="false"/> <c:param name="grouped" value="true"/>
<%-- unless a value is provided, properties not assigned to a group will not have a tab or appear on the page --%> <%-- unless a value is provided, properties not assigned to a group will not have a tab or appear on the page --%>
<c:param name="unassignedPropsGroupName" value=""/> <c:param name="unassignedPropsGroupName" value="other"/>
</c:import> </c:import>
<%-- Blurb --%> <%-- Blurb --%>
@ -308,9 +310,7 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
</c:if> </c:if>
--> -->
</div> <!-- contents --> </div> <!-- contents -->
</div> <!-- personWrap -->
</div> <!-- content --> </div> <!-- content -->
<script type="text/javascript" src="<c:url value="/js/imageUpload/imageUploadUtils.js"/>"></script> <script type="text/javascript" src="<c:url value="/js/imageUpload/imageUploadUtils.js"/>"></script>

View file

@ -116,7 +116,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
<% int propTotal = g.getPropertyList().size(); %> <% int propTotal = g.getPropertyList().size(); %>
<c:set var="propTotal" value="<%=propTotal%>" /> <c:set var="propTotal" value="<%=propTotal%>" />
<c:if test="${propTotal>0}">
<div class="propsCategory" id="<%=g.getLocalName()%>"> <div class="propsCategory" id="<%=g.getLocalName()%>">
<h3><strong><%=g.getName()%></strong></h3> <h3><strong><%=g.getName()%></strong></h3>
<div class="propsWrap"> <div class="propsWrap">
@ -142,12 +142,52 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
<c:set var="objRows" value="${fn:length(objProp.objectPropertyStatements)}"/> <c:set var="objRows" value="${fn:length(objProp.objectPropertyStatements)}"/>
<c:if test="${objRows==0}"><c:set var="objStyle" value="display: block;"/></c:if> <c:if test="${objRows==0}"><c:set var="objStyle" value="display: block;"/></c:if>
<c:if test="${editableInSomeWay || objRows>0}"> <%-- nac26 Changing the test on objRows here to be GTE so that properties marked with an update level of "nobody" are still rendered --%>
<c:if test="${editableInSomeWay || objRows>=0}">
<c:set var="first" value=""/><c:if test="${counter == 0}"><c:set var="first" value=" first"/></c:if> <c:set var="first" value=""/><c:if test="${counter == 0}"><c:set var="first" value=" first"/></c:if>
<c:set var="last" value=""/><c:if test="${(counter+1) == propTotal}"><c:set var="last" value=" last"/></c:if> <c:set var="last" value=""/><c:if test="${(counter+1) == propTotal}"><c:set var="last" value=" last"/></c:if>
<div class="propsItem${first}${last}" id="${objProp.localName}"> <div class="propsItem${first}${last}" id="${objProp.localName}">
<h4>${objProp.editLabel}</h4> <h4>${objProp.editLabel}</h4>
<c:if test="${showSelfEdits || showCuratorEdits}"><edLnk:editLinks item="${objProp}" icons="false" /></c:if> <c:if test="${showSelfEdits || showCuratorEdits}"><edLnk:editLinks item="${objProp}" icons="false" /></c:if>
<%-- Verbose property display additions for object properties, using context variable verbosePropertyListing --%>
<c:if test="${showCuratorEdits && verbosePropertyListing}">
<c:url var="propertyEditLink" value="/propertyEdit">
<c:param name="home" value="${portal.portalId}"/>
<c:param name="uri" value="${objProp.URI}"/>
</c:url>
<c:choose>
<c:when test="${!empty objProp.hiddenFromDisplayBelowRoleLevel.label}"><c:set var="displayCue" value="${objProp.hiddenFromDisplayBelowRoleLevel.label}"/></c:when>
<c:otherwise><c:set var="displayCue" value="unspecified"/></c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty objProp.prohibitedFromUpdateBelowRoleLevel.label}"><c:set var="updateCue" value="${objProp.prohibitedFromUpdateBelowRoleLevel.label}"/></c:when>
<c:otherwise><c:set var="updateCue" value="unspecified"/></c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty objProp.localNameWithPrefix}"><c:set var="localName" value="${objProp.localNameWithPrefix}"/></c:when>
<c:otherwise><c:set var="localName" value="no local name"/></c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty objProp.domainDisplayTier}"><c:set var="displayTier" value="${objProp.domainDisplayTier}"/></c:when>
<c:otherwise><c:set var="displayTier" value="blank"/></c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty objProp.groupURI}">
<% PropertyGroup pg = pgDao.getGroupByURI(op.getGroupURI());
if (pg!=null && pg.getName()!=null) {
request.setAttribute("groupName",pg.getName());%>
<span class="verbosePropertyListing"><a class="propertyLink" href="${propertyEditLink}"/>${localName}</a> (object property); display tier ${displayTier} within group ${groupName}; display level: ${displayCue}; update level: ${updateCue}</span>
<% } else {%>
<span class="verbosePropertyListing"><a class="propertyLink" href="${propertyEditLink}"/>${localName}</a> (object property); display tier ${displayTier}; display level: ${displayCue}; update level: ${updateCue}</span>
<% } %>
</c:when>
<c:otherwise>
<span class="verbosePropertyListing"><a class="propertyLink" href="${propertyEditLink}"/>${localName}</a> (object property); display tier ${displayTier}; display level: ${displayCue}; update level: ${updateCue}</span>
</c:otherwise>
</c:choose>
</c:if>
<%-- end Verbose property display additions for object properties --%>
<c:set var="displayLimit" value="${objProp.domainDisplayLimit}"/> <c:set var="displayLimit" value="${objProp.domainDisplayLimit}"/>
<c:if test="${displayLimit<0}"> <c:if test="${displayLimit<0}">
@ -221,6 +261,46 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
</c:if> </c:if>
<%-- Verbose property display additions for data properties, using context variable verbosePropertyListing --%>
<c:if test="${showCuratorEdits && verbosePropertyListing}">
<c:url var="propertyEditLink" value="/datapropEdit">
<c:param name="home" value="${portal.portalId}"/>
<c:param name="uri" value="${dataProp.URI}"/>
</c:url>
<c:choose>
<c:when test="${!empty dataProp.hiddenFromDisplayBelowRoleLevel.label}"><c:set var="displayCue" value="${dataProp.hiddenFromDisplayBelowRoleLevel.label}"/></c:when>
<c:otherwise><c:set var="displayCue" value="unspecified"/></c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty dataProp.prohibitedFromUpdateBelowRoleLevel.label}"><c:set var="updateCue" value="${dataProp.prohibitedFromUpdateBelowRoleLevel.label}"/></c:when>
<c:otherwise><c:set var="updateCue" value="unspecified"/></c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty dataProp.localNameWithPrefix}"><c:set var="localName" value="${dataProp.localNameWithPrefix}"/></c:when>
<c:otherwise><c:set var="localName" value="no local name"/></c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty dataProp.displayTier}"><c:set var="displayTier" value="${dataProp.displayTier}"/></c:when>
<c:otherwise><c:set var="displayTier" value="blank"/></c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty dataProp.groupURI}">
<% PropertyGroup pg = pgDao.getGroupByURI(dp.getGroupURI());
if (pg!=null && pg.getName()!=null) {
request.setAttribute("groupName",pg.getName());%>
<span class="verbosePropertyListing"><a class="propertyLink" href="${propertyEditLink}"/>${localName}</a> (data property); display tier ${displayTier} within group ${groupName}; display level: ${displayCue}; update level: ${updateCue}</span>
<% } else {%>
<span class="verbosePropertyListing"><a class="propertyLink" href="${propertyEditLink}"/>${localName}</a> (data property); display tier ${displayTier}; display level: ${displayCue}; update level: ${updateCue}</span>
<% } %>
</c:when>
<c:otherwise>
<span class="verbosePropertyListing"><a class="propertyLink" href="${propertyEditLink}"/>${localName}</a> (data property); display tier ${displayTier}; display level: ${displayCue}; update level: ${updateCue}</span>
</c:otherwise>
</c:choose>
</c:if>
<%-- end Verbose property display additions for data properties --%>
<c:if test="${displayLimit<0}"> <c:if test="${displayLimit<0}">
<%-- set to an arbitrary but high positive limit if unset on property, i.e. -1 --%> <%-- set to an arbitrary but high positive limit if unset on property, i.e. -1 --%>
<c:set var="displayLimit" value="32"/> <c:set var="displayLimit" value="32"/>
@ -240,7 +320,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
<c:when test='${dataRows==1}'> <c:when test='${dataRows==1}'>
<span class="statementWrap"> <span class="statementWrap">
${dataPropertyStmt.data} ${dataPropertyStmt.data}
<c:if test='${displayLimit>1 && (showSelfEdits || showCuratorEdits)}'> <c:if test='${showSelfEdits || showCuratorEdits}'>
<c:set var="editLinks"><edLnk:editLinks item="${dataPropertyStmt}" icons="false"/></c:set> <c:set var="editLinks"><edLnk:editLinks item="${dataPropertyStmt}" icons="false"/></c:set>
<c:if test="${!empty editLinks}"><span class="editLinks">${editLinks}</span></c:if> <c:if test="${!empty editLinks}"><span class="editLinks">${editLinks}</span></c:if>
<c:if test="${empty editLinks}"><em class="nonEditable">(non-editable)</em></c:if> <c:if test="${empty editLinks}"><em class="nonEditable">(non-editable)</em></c:if>
@ -285,6 +365,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
%> %>
</div><!-- propsWrap --> </div><!-- propsWrap -->
</div><!-- class="propsCategory" --> </div><!-- class="propsCategory" -->
</c:if>
<c:if test="${showSelfEdits || showCuratorEdits}"> <c:if test="${showSelfEdits || showCuratorEdits}">
<a class="backToTop" href="#wrap" title="jump to top of the page">back to top</a> <a class="backToTop" href="#wrap" title="jump to top of the page">back to top</a>
</c:if> </c:if>
@ -293,4 +374,3 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
log.debug("incoming groups list with merged properties not found as request attribute for subject "+subject.getName()+"\n"); log.debug("incoming groups list with merged properties not found as request attribute for subject "+subject.getName()+"\n");
} }
%> %>