Some reorganization of templates. Restored entitylist as destination of links on index page, since new individuallist controller/templates not finished yet.

This commit is contained in:
rjy7 2010-05-26 14:03:59 +00:00
parent 8b0665a0d7
commit b7d2027da4
20 changed files with 37 additions and 21 deletions

View file

@ -804,7 +804,6 @@
<url-pattern>/listObjectPropertyStatements</url-pattern> <url-pattern>/listObjectPropertyStatements</url-pattern>
</servlet-mapping> </servlet-mapping>
<!--
<servlet> <servlet>
<servlet-name>EntityListController</servlet-name> <servlet-name>EntityListController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.EntityListController</servlet-class> <servlet-class>edu.cornell.mannlib.vitro.webapp.controller.EntityListController</servlet-class>
@ -813,7 +812,6 @@
<servlet-name>EntityListController</servlet-name> <servlet-name>EntityListController</servlet-name>
<url-pattern>/entitylist</url-pattern> <url-pattern>/entitylist</url-pattern>
</servlet-mapping> </servlet-mapping>
-->
<servlet> <servlet>
<servlet-name>IndividualListController</servlet-name> <servlet-name>IndividualListController</servlet-name>

View file

@ -57,6 +57,14 @@ import edu.cornell.mannlib.vitro.webapp.web.jsptags.StringProcessorTag;
* @author bdc34 * @author bdc34
* *
*/ */
/* IMPLEMENTATION NOTES
- See NIHVIVO-512:
build up the list of actually rendered items first. Only then, if there are any, add the label on top.
*/
public class IndividualController extends FreeMarkerHttpServlet { public class IndividualController extends FreeMarkerHttpServlet {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View file

@ -11,7 +11,7 @@ public class Routes {
public static final String BROWSE = "/browse"; public static final String BROWSE = "/browse";
public static final String CONTACT = "/contact"; public static final String CONTACT = "/contact";
public static final String INDIVIDUAL = "/individual"; public static final String INDIVIDUAL = "/individual";
public static final String INDIVIDUAL_LIST = "/individuallist"; public static final String INDIVIDUAL_LIST = "/entitylist"; //"/individuallist";
public static final String SEARCH = "/search"; public static final String SEARCH = "/search";
public static final String TERMS_OF_USE = "/termsOfUse"; public static final String TERMS_OF_USE = "/termsOfUse";

View file

@ -36,17 +36,18 @@ public class IndividualView extends ViewObject {
return individual.getURI(); return individual.getURI();
} }
// Or maybe getProfileUrl - there might be other kinds of urls // Return link to individual's profile page.
// e.g., getEditUrl, getDeleteUrl - these would return the computations of PropertyEditLinks // There may be other urls associated with the individual. E.g., we might need
// getEditUrl(), getDeleteUrl() to return the links computed by PropertyEditLinks.
// RY **** Need to account for everything in URLRewritingHttpServlet // RY **** Need to account for everything in URLRewritingHttpServlet
public String getProfileUrl() { public String getProfileUrl() {
return getUrl("/individual/" + individual.getLocalName()); return getUrl("/individual/" + individual.getLocalName());
} }
public String getRenderer() { public String getShortView() {
// TODO // TODO
// iterate through class hierarchy looking for a custom renderer. If none, use // iterate through class hierarchy looking for a custom short view. If none, use
// default individual renderer. template will just do an include on individual.renderer // default individual short view. template will just do an include on individual.shortView
// Use individual.getVClasses() - this is the class hierarchy // Use individual.getVClasses() - this is the class hierarchy
// Question: what order are they returned in ? If from specific to general, break out of the iteration as soon as we find one. // Question: what order are they returned in ? If from specific to general, break out of the iteration as soon as we find one.
return null; return null;

View file

@ -131,8 +131,16 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
</c:if> </c:if>
</c:if> </c:if>
<c:set var="objStyle" value="display: block;"/> <c:set var="objStyle" value="display: block;"/>
<%-- rjy7 We have a logic problem here: if the custom short view dictates that the item NOT be rendered,
and because of this there are NO items to render, we shouldn't show the label when not in edit mode.
Example: people ( = positionHistory) of an organization don't render if the position end date is in the past.
So the organization might not have any current people, in which case we shouldn't show the "people" label.
We need to compute objRows on the basis of the rendering, not the number of objectPropertyStatements.
See NIHVIVO-512. --%>
<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}"> <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>

View file

@ -3,7 +3,6 @@
<#-- List individual members of a class. --> <#-- List individual members of a class. -->
<div class="contents"> <div class="contents">
<div class="individualList"> <div class="individualList">
<h2>${title}</h2> <h2>${title}</h2>
<#if subtitle??> <#if subtitle??>
@ -17,11 +16,10 @@
<ul> <ul>
<#list individuals as individual> <#list individuals as individual>
<li> <li>
<a href="${individual.profileUrl}">${individual.name}</a> ${individual.tagline} <#include "partials/defaultIndividualListView.ftl">
</li> </li>
</#list> </#list>
</ul> </ul>
</#if> </#if>
</div> </div>
</div> </div>

View file

@ -0,0 +1,3 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<a href="${individual.profileUrl}">${individual.name}</a> ${individual.tagline}

View file

@ -1,22 +1,22 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#include "/components/doctype.html"> <#include "partials/doctype.html">
<#include "/components/head.ftl"> <#include "partials/head.ftl">
<body> <body>
<div id="wrap" class="container"> <div id="wrap" class="container">
<div id="header"> <div id="header">
<#include "/components/identity.ftl"> <#include "partials/identity.ftl">
<#-- Note to UI team: do not change this div without also making the corresponding change in menu.jsp --> <#-- Note to UI team: do not change this div without also making the corresponding change in menu.jsp -->
<div id="navAndSearch" class="block"> <div id="navAndSearch" class="block">
<#include "/components/menu.ftl"> <#include "partials/menu.ftl">
<#include "/components/search.ftl"> <#include "partials/search.ftl">
</div> <!-- navAndSearch --> </div> <!-- navAndSearch -->
<#include "/components/breadcrumbs.ftl"> <#include "partials/breadcrumbs.ftl">
</div> <!-- header --> </div> <!-- header -->
<hr class="hidden" /> <hr class="hidden" />
@ -29,10 +29,10 @@
</div> <!-- content --> </div> <!-- content -->
</div> <!-- contentwrap --> </div> <!-- contentwrap -->
<#include "/components/footer.ftl"> <#include "partials/footer.ftl">
</div> <!-- wrap --> </div> <!-- wrap -->
<#include "/components/scripts.ftl"> <#include "partials/scripts.ftl">
</body> </body>
</html> </html>

View file

@ -18,7 +18,7 @@
</@l.makeList> </@l.makeList>
</ul> </ul>
</div> </div>
<#include "copyright.ftl"> <#include "copyright.ftl">
All Rights Reserved. <a href="${urls.termsOfUse}">Terms of Use</a> All Rights Reserved. <a href="${urls.termsOfUse}">Terms of Use</a>