Improve output: distinguish between failed assertions (failures) and unexpected exceptions (errors), and print a filtered stack trace for any exception.

This commit is contained in:
jeb228 2010-01-29 22:13:57 +00:00
commit 4f2e303079
1839 changed files with 235630 additions and 0 deletions

View file

@ -0,0 +1,59 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.VClass" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditSubmission" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
<%@ page import="java.util.List" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page errorPage="/error.jsp"%>
<c:if test="${sessionScope.loginHandler != null &&
sessionScope.loginHandler.loginStatus == 'authenticated' &&
sessionScope.loginHandler.loginRole >= sessionScope.loginHandler.editor}">
<c:set var="showCuratorEdits" value="true"/>
</c:if>
<c:set var='entity' value='${requestScope.entity}'/><%/* just moving this into page scope for easy use */ %>
<c:set var='dashboardPropsListJsp' value='/dashboardPropList'/>
<c:set var='portal' value='${currentPortalId}'/>
<c:set var='portalBean' value='${currentPortal}'/>
<c:set var='imageDir' value='images' />
<div id="dashboard"<c:if test="${showCuratorEdits}"> class="loggedIn"</c:if>>
<c:if test="${!empty entity.imageThumb}">
<c:if test="${!empty entity.imageFile}">
<c:url var="imageUrl" value="${imageDir}/${entity.imageFile}" />
<a class="image" href="${imageUrl}">
</c:if>
<c:url var="imageSrc" value='${imageDir}/${entity.imageThumb}'/>
<img class="headshot" src="<c:out value="${imageSrc}"/>" title="click to view larger image in new window" alt="" width="150"/>
<c:if test="${!empty entity.imageFile}"></a></c:if>
<c:if test="${!empty entity.citation}"><div class="citation">${entity.citation}</div></c:if>
</c:if>
<ul class="profileLinks">
<c:if test="${!empty entity.anchor}">
<c:choose>
<c:when test="${!empty entity.url}">
<c:url var="entityUrl" value="${entity.url}" />
<li><a class="externalLink" href="<c:out value="${entityUrl}"/>">${entity.anchor}</a></li>
</c:when>
<c:otherwise><li>${entity.anchor}</li></c:otherwise>
</c:choose>
</c:if>
<c:if test="${!empty entity.linksList }">
<c:forEach items="${entity.linksList}" var='link'>
<c:url var="linkUrl" value="${link.url}" />
<li><a class="externalLink" href="<c:out value="${linkUrl}"/>">${link.anchor}</a></li>
</c:forEach>
</c:if>
</ul>
<c:if test="${showCuratorEdits}">
<c:import url="${dashboardPropsListJsp}">
<%-- unless a value is provided, properties not assigned to a group will not appear on the dashboard --%>
<c:param name="unassignedPropsGroupName" value=""/>
</c:import>
</c:if>
</div>

View file

@ -0,0 +1,70 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page language="java"%>
<%@ page import="java.util.Calendar" %>
<%@ page import="org.apache.commons.logging.Log" %>
<%@ page import="org.apache.commons.logging.LogFactory" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%>
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.*"%>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Portal" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %><%/* this odd thing points to something in web.xml */ %>
<jsp:useBean id="loginHandler" class="edu.cornell.mannlib.vedit.beans.LoginFormBean" scope="session" />
<%
/**
* @version 1.00
* @author Jon Corson-Rikert
* UPDATES:
* 2006-01-04 bdc removed <head> and <body> tags and moved from <table> to <div>
* 2005-07-07 JCR included LoginFormBean so can substitute filterbrowse for portalbrowse for authorized users
*/
final Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.web.themes.default.footer.jsp");
VitroRequest vreq = new VitroRequest(request);
Portal portal = vreq.getPortal();
if (portal==null) {
log.error("portal from vreq.getPortal() null in themes/default/footer.jsp");
}
HttpSession currentSession = request.getSession();
boolean authorized = false;
if (loginHandler.getLoginStatus().equals("authenticated")) /* test if session is still valid */
if (currentSession.getId().equals(loginHandler.getSessionId()))
if (request.getRemoteAddr().equals(
loginHandler.getLoginRemoteAddr()))
authorized = true;
%>
<c:set var="currentYear" value="<%= Calendar.getInstance().get(Calendar.YEAR) %>" />
<div class='footer'><div class='footerLinks'>
<% String rootBreadCrumb = BreadCrumbsUtil.getRootBreadCrumb(vreq,"",portal);
if (rootBreadCrumb != null && rootBreadCrumb.length()>0) { %>
<%=rootBreadCrumb%> |
<% } %>
<a href="<%=(authorized?"browsecontroller":"browsecontroller")%>?home=<%=portal.getPortalId()%>">Index</a>
| <a href="comments?home=<%=portal.getPortalId()%>">Contact Us</a>
<c:if test="${sessionScope.loginHandler.loginStatus == 'authenticated' && sessionScope.loginHandler.loginRole > 3 }">
| admin [
<a href="http://validator.w3.org/check?uri=referer">validate xhtml</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">validate css</a>
]
</c:if>
</div>
<% if (portal.getCopyrightAnchor() != null && portal.getCopyrightAnchor().length()>0) { %>
<div class='copyright'>
&copy;${currentYear}&nbsp;
<% if (portal.getCopyrightURL() != null && portal.getCopyrightURL().length()>0) { %>
<a href="<%=portal.getCopyrightURL()%>">
<% } %>
<%=portal.getCopyrightAnchor()%>
<% if (portal.getCopyrightURL() != null && portal.getCopyrightURL().length()>0) { %>
</a>.
<% } %>
</div>
<div class='copyright'>
All Rights Reserved. <a href="termsOfUse?home=<%=portal.getPortalId()%>">Terms of Use</a>
</div>
<% } %>
</div>

View file

@ -0,0 +1,140 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page language="java" %>
<%@ page errorPage="error.jsp"%>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ApplicationBean" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Portal" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%><%/* this odd thing points to something in web.xml */ %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.PortalWebUtil" %>
<jsp:useBean id="loginHandler" class="edu.cornell.mannlib.vedit.beans.LoginFormBean" scope="session" />
<%
/**
*
* @version 1.00
* @author Jon Corson-Rikert, Brian Caruso, and Brian Lowe
*
* UPDATES:
* 2007-09-27 BJL moved VIVO and CALS-specific markup to VIVO clone
* 2006-01-31 BJL edited to remove deprecated markup
* 2005-11-06 JCR put styling on extra search selection box
* 2005-10-25 JCR changed local ALL CALS RESEARCH constant to appBean.getSharedPortalFlagNumeric()
* 2005-10-11 JCR tweaks to VIVO search label spacing in header
* 2005-09-15 JCR,BDC converted to use revised ApplicationBean and PortalBean
* 2005-08-16 JCR added CALS_IMPACT contant and modified code to use CALS display for that portal
* 2005-08-01 JCR changed ordering of other portals being displayed to displayRank instead of appName (affects SGER, CALS portals)
* 2005-07-05 JCR retrieving ONLY_CURRENT and ONLY_PUBLIC from database and setting in ApplicationBean
* 2005-06-20 JCR enabling a common CALS research portal via ALL CALS RESEARCH
* 2005-06-20 JCR removed MIN_STATUS_ID and minstatus parameter from search -- has been changed to interactive-only maxstatus parameter
* JCR 2005-06-14 : added isInitialized() test for appBean and portalBean
*/
// application variables not stored in application bean
final int CALS_IMPACT = 6;
final int FILTER_SECURITY_LEVEL = 4;
final int CALS_SEARCHBOX_SIZE = 25;
final int VIVO_SEARCHBOX_SIZE = 20;
HttpSession currentSession = request.getSession();
String currentSessionIdStr = currentSession.getId();
int securityLevel = -1;
String loginName = null;
if (loginHandler.testSessionLevel(request) > -1) {
securityLevel = Integer.parseInt(loginHandler.getLoginRole());
loginName = loginHandler.getLoginName();
}
VitroRequest vreq = new VitroRequest(request);
ApplicationBean appBean = vreq.getAppBean();
Portal portal = vreq.getPortal();
PortalWebUtil.populateSearchOptions(portal, appBean, vreq.getWebappDaoFactory().getPortalDao());
PortalWebUtil.populateNavigationChoices(portal, request, appBean, vreq.getWebappDaoFactory().getPortalDao());
String fixedTabStr = (fixedTabStr = request.getParameter("fixed")) == null ? null : fixedTabStr.equals("") ? null : fixedTabStr;
final String DEFAULT_SEARCH_METHOD = "fulltext";
%>
<c:set var="portal" value="${requestScope.portalBean}"/>
<c:set var="appBean" value="${requestScope.appBean}"/>
<div id="header">
<c:set var='themeDir' >
<c:out value='${portal.themeDir}' />
</c:set>
<table id="head"><tr>
<td id="LogotypeArea">
<table><tr>
<td>
<%
String homeURL = (portal.getRootBreadCrumbURL()!=null && portal.getRootBreadCrumbURL().length()>0) ?
portal.getRootBreadCrumbURL() : request.getContextPath()+"/";
%>
<a href="<%=homeURL%>">
<img class="closecrop" src="${themeDir}site_icons/<%=appBean.getRootLogotypeImage()%>"
width="<%=appBean.getRootLogotypeWidth()%>"
height="<%=appBean.getRootLogotypeHeight()%>"
alt="<%=appBean.getRootLogotypeTitle()%>"/></a>
</td><td>
<a href="<%=homeURL%>">
<img class="closecrop" src="${themeDir}site_icons/<%=portal.getLogotypeImage()%>"
width="<%=portal.getLogotypeWidth()%>" height="<%=portal.getLogotypeHeight()%>"
alt="<%=portal.getAppName()%>"/></a>
</td>
</tr></table>
</td>
<td id="SearchArea" <%if ((portal.getBannerImage() == null || portal.getBannerImage().equals(""))){%>align="right"<% } %>>
<% if (fixedTabStr != null && fixedTabStr.equalsIgnoreCase("Search")) { %>
<% } else { %>
<table align="center"><tr><td>
<div class="searchForm">
<c:url var="searchURL" value="/search"/>
<form action="${searchURL}" >
<table><tr>
<td>
<label for="search">Search </label>
</td>
<td>
<% if (securityLevel>=FILTER_SECURITY_LEVEL && appBean.isFlag1Active()) { %>
<select id="select" name="flag1" class="form-item" >
<option value="nofiltering" selected="selected">entire database (<%=loginName%>)</option>
<option value="<%=portal.getPortalId()%>"><%=portal.getShortHand()%></option>
</select>
<% } else {%>
<input type="hidden" name="flag1" value="<%=portal.getPortalId()%>" />
<% } %>
<input type="text" name="querytext" id="search" class="search-form-item" value="<c:out value="${requestScope.querytext}"/>"
size="<%=VIVO_SEARCHBOX_SIZE%>" />
</td>
<td>
<input class="search-form-button" name="submit" type="submit" value="Go" />
</td>
</tr></table>
</form>
</div>
</td></tr></table>
<% } // not a fixed tab %>
</td>
<% if (!(portal.getBannerImage() == null || portal.getBannerImage().equals("")))
{
%>
<td id="BannerArea" align="right">
<img src="${portal.themeDir}site_icons/<%=portal.getBannerImage()%>" alt="<%=portal.getShortHand()%>"/>
</td>
<% } %>
</tr></table>
</div><!--header-->

View file

@ -0,0 +1,122 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="org.apache.commons.logging.Log" %>
<%@ page import="org.apache.commons.logging.LogFactory" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.TabMenu" %>
<%@ 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.web.BreadCrumbsUtil" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<jsp:useBean id="loginHandler" class="edu.cornell.mannlib.vedit.beans.LoginFormBean" scope="session" />
<%
/***********************************************
Make the Tab menu div, nothing else.
bdc34 2006-01-03 created
**********************************************/
HttpSession currentSession = request.getSession();
String currentSessionIdStr = currentSession.getId();
int securityLevel = -1;
String loginName = null;
if (loginHandler.testSessionLevel(request) > -1) {
securityLevel = Integer.parseInt(loginHandler.getLoginRole());
loginName = loginHandler.getLoginName();
}
final Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.web.menu.jsp");
VitroRequest vreq = new VitroRequest(request);
Portal portal = vreq.getPortal();
int portalId = -1;
if (portal==null) {
log.error("Attribute 'portalBean' missing or null; portalId defaulted to 1");
portalId=1;
} else {
portalId=portal.getPortalId();
}
String fixedTabStr=(fixedTabStr=request.getParameter("fixed"))==null?null:fixedTabStr.equals("")?null:fixedTabStr;
%>
<c:set var="currentPortal" value="<%=portal.getPortalId()%>"/>
<!-- ************** START menu.jsp **** -->
<div id="menu">
<div id="primaryAndOther">
<%=TabMenu.getPrimaryTabMenu(vreq)%>
<ul id="otherMenu">
<%-- A user is logged in --%>
<% if (securityLevel > 0) { %>
<c:url var="logoutHref" value="<%= Controllers.LOGOUT_JSP %>">
<c:param name="home" value="${currentPortal}" />
<c:param name="loginSubmitMode" value="Log Out" />
</c:url>
<c:url var="siteAdminHref" value="<%= Controllers.SITE_ADMIN %>">
<c:param name="home" value="${currentPortal}" />
</c:url>
<li class="border">
Logged in as <strong><%= loginName %></strong> (<a href="${logoutHref}">Log out</a>)
</li>
<li class="border"><a href="${siteAdminHref}" >Site Admin</a></li>
<%-- A user is not logged in --%>
<% } else { %>
<c:url var="loginHref" value="<%= Controllers.LOGIN %>">
<c:param name="home" value="${currentPortal}"/>
<c:param name="login" value="block"/>
</c:url>
<li class="border"><a title="log in to manage this site" href="${loginHref}">Log in</a></li>
<% }
if ("browse".equalsIgnoreCase(fixedTabStr)) {%>
<li class="activeTab"><a href="<c:url value="/browsecontroller"/>" title="list all contents by type">Index</a></li>
<% } else {%>
<li><a href="<c:url value="/browsecontroller"><c:param name="home" value="${portalBean.portalId}"/></c:url>" title="list all contents by type">Index</a></li>
<% }
if ("about".equalsIgnoreCase(fixedTabStr)) {%>
<c:url var="aboutHref" value="<%= Controllers.ABOUT %>">
<c:param name="home" value="${currentPortal}"/>
<c:param name="login" value="none"/>
</c:url>
<c:set var="aboutHref">
<c:out value="${aboutHref}" escapeXml="true"/>
</c:set>
<li><a class="activeTab" href="${aboutHref}" title="more about this web site">About</a></li>
<% } else {%>
<c:url var="aboutHref" value="<%= Controllers.ABOUT %>">
<c:param name="home" value="${currentPortal}"/>
<c:param name="login" value="none"/>
</c:url>
<c:set var="aboutHref">
<c:out value="${aboutHref}" escapeXml="true"/>
</c:set>
<li><a href="${aboutHref}" title="more about this web site">About</a></li>
<% }
if ("comments".equalsIgnoreCase(fixedTabStr)) { %>
<li class="activeTab"><a href="<c:url value="/comments"><c:param name="home" value="${portalBean.portalId }"/></c:url>">Contact Us</a></li>
<% } else {%>
<li><a href="<c:url value="/comments"><c:param name="home" value="${portalBean.portalId }"/></c:url>">Contact Us</a></li>
<% }%>
</ul>
</div><!--END 'primaryAndOther'-->
<% if( fixedTabStr == null ) {%>
<div id="secondaryTabMenu">
<%=TabMenu.getSecondaryTabMenu(vreq)%>
</div><!--END 'secondaryTabMenu'-->
<% }%>
</div><!-- END 'menu' -->
<div id="breadcrumbs"><%=BreadCrumbsUtil.getBreadCrumbsDiv(request)%></div>
<!-- ************************ END menu.jsp ************************ -->