NIHVIVO-2403 Remove tabs from code

This commit is contained in:
brianjlowe 2011-05-10 20:15:31 +00:00
parent 132cbdce2c
commit fbead2b020
72 changed files with 337 additions and 7065 deletions

View file

@ -1,110 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
<tr class="editformcell">
<td valign="bottom" colspan="2">
<b>Tab Title*</b> <i>(a short phrase to appear on headings, menus or pick lists)</i><br/>
<input type="text" name="Title" value="<form:value name="Title"/>" style="width:60%;" maxlength="80" />
<font size="2" color="red"><form:error name="Title"/></font>
</td>
<td valign="bottom" colspan="1">
<b>Tab Shorthand</b> <i>(an alternate phrase for display as <strong>More ...</strong> in the application)</i><br/>
<input type="text" name="ShortHand" value="<form:value name="MoreTag"/>" style="width:80%;" maxlength="80" />
<font size="2" color="red"><form:error name="MoreTag"/></font>
</td>
</tr>
<tr class="editformcell">
<td valign="bottom" colspan="3">
<b>Tab Description</b> <i>A single short sentence to summarize the contents for users</i><br/>
<strong>Note that this now becomes the tool tip when the mouse rolls over a primary or secondary tab name</strong><br/>
<input type="text" name="Description" value="<form:value name="Description"/>" style="width:90%;" maxlength="255" />
<font size="2" color="red"><form:error name="Description"/></font>
</td>
</tr>
<tr class="editformcell">
<td valign="bottom" colspan="3">
<b>Tab Body</b> <i>enter any longer text or comment here</i><br/>
<textarea name="Body" rows="10" wrap="soft"><form:value name="Rows"/><form:value name="Body"/></textarea>
<font size="2" color="red"><form:error name="Body"/></font>
</td>
</tr>
<tr class="editformcell">
<td valign="top" colspan="1">
<% /*
<b>Originator</b><br>
<input type="text" disabled="disabled" name="UserId" value="<form:value name="UserId"/>"/>
<font size="2" color="red"><form:error name="UserId"/></font>
*/ %>
</td>
<td valign="bottom" colspan="1">
<b>Tab Type</b><br>
<select name="TabtypeId" >
<form:option name="TabtypeId"/>
</select>
<font size="2" color="red"><form:error name="TabtypeId"/></font>
</td>
<td valign="bottom" colspan="1">
<b>Individual link method</b><br /><i>(if method is "by tab-type relationships", select types after editing this tab itself)</i><br />
<select name="EntityLinkMethod" >
<form:option name="EntityLinkMethod"/>
</select>
<font size="2" color="red"><form:error name="EntityLinkMethod"/></font>
</td> </tr>
<tr class="editformcell"><td colspan="3"><hr /></td></tr>
<% /*
<tr class="editformcell">
<td valign="bottom" colspan="3">
<b>URL of RSS feed</b> (must include the full http://... path)<br/>
<input type="text" name="RssURL" value="<form:value name="RssURL"/>" style="width:60%;" maxlength="255" />
<font size="2" color="red"><form:error name="RssURL"/></font>
</td>
</tr>
*/ %>
<tr class="editformcell">
<td valign="bottom" colspan="1">
<b>Order for display within parent tab</b><br />
<input type="text" name="DisplayRank" value="<form:value name="DisplayRank"/>" size="5" maxlength="11" />
<font size="2" color="red"><form:error name="DisplayRank"/></font>
</td>
<td valign="bottom" colspan="2">
<b>Optional time limit for entities</b> <i>in days; use negative values for the past; not active for manual linking or image galleries</i><br/>
<i>positive values will key off entity <b>timekey</b> field; negative values off entity <b>sunrise</b> field</i><br/>
<input type="text" name="DayLimit" value="<form:value name="DayLimit"/>" size="5" maxlength="11" />
<font size="2" color="red"><form:error name="DayLimit"/></font>
</td>
</tr>
<tr class="editformcell">
<td valign="bottom" colspan="1">
<b>Sort field for related entities</b><br /><i><strong>name</strong>,rand(),timekey,sunset,sunrise</i><br/>
<input type="text" name="EntitySortField" value="<form:value name="EntitySortField"/>" size="10" maxlength="50" />
<font size="2" color="red"><form:error name="EntitySortField"/></font>
</td>
<td valign="bottom" colspan="2">
<b>Sort direction for related entities</b><br /><i>blank for ascending,"desc" for descending</i><br/>
<input type="text" name="EntitySortDirection" value="<form:value name="EntitySortDirection"/>" size="4" maxlength="4" />
<font size="2" color="red"><form:error name="EntitySortDirection"/></font>
</td>
</tr>
<tr class="editformcell"><td colspan="3"><hr /></td></tr>
<tr class="editformcell"><td colspan="3">The following fields apply only when images are involved</td></tr>
<tr class="editformcell">
<td valign="bottom" colspan="1">
<b>Columns of images to display</b><br/>
<i>9 columns of images at 94 pixels wide fits a 1024x768 display window</i><br/>
<input type="text" name="GalleryCols" value="<form:value name="GalleryCols"/>" size="5" maxlength="11" />
<font size="2" color="red"><form:error name="GalleryCols"/></font>
</td>
<td valign="bottom" colspan="1">
<b>Rows of images to display</b><br/>
<i>if only a single row is specified, the A|B|C...|Z choices don't appear with image galleries</i><br/>
<input type="text" name="GalleryRows" value="<form:value name="GalleryRows"/>" size="5" maxlength="11" />
<font size="2" color="red"><form:error name="GalleryRows"/></font>
</td>
<td valign="bottom" colspan="1">
<b>Width for image display</i><br/>
<input type="text" name="ImageWidth" value="<form:value name="ImageWidth"/>" size="5" maxlength="11" />
<font size="2" color="red"><form:error name="ImageWidth"/></font>
</td>
</tr>

View file

@ -1,28 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
<tr class="editformcell">
<td valign="top">
<b>Tab</b><br/>
<select name="TabId" >
<form:option name="TabId"/>
</select>
<font size="2" color="red"><form:error name="TabId"/></font>
</td>
</tr>
<tr class="editformcell">
<td valign="top">
<b>Individual</b><br/>
<select name="EntURI" >
<form:option name="EntId"/>
</select>
<font size="2" color="red"><form:error name="EntId"/></font>
</td>
</tr>
<tr class="editformcell">
<td valign="bottom" colspan="1">
<b>Order for display</b> in selected tab; blank will default to zero<br/>
<input type="text" name="DisplayRank" value="<form:value name="DisplayRank"/>" size="5" maxlength="11" />
<font size="2" color="red"><form:error name="DisplayRank"/></font>
</td>
</tr>

View file

@ -1,79 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.ManageTabs" %>
<% request.setAttribute("requestedActions", new ManageTabs()); %>
<vitro:confirmAuthorization />
<div class="editingForm">
<form id="editForm" name="editForm" action="doTabHierarchyOperation" method="post">
<input type="hidden" name="_epoKey" value="${epoKey}" />
<div align="center">
<table cellpadding="4" cellspacing="2" border="0">
<tr><th colspan="3">
<div class="entryFormHead">
<h2>${title}</h2>
<c:choose>
<c:when test='${_action == "insert"}'>
<h3>Creating New Record</h3>
</c:when>
<c:otherwise>
<h3>Editing Existing Record</h3>
</c:otherwise>
</c:choose>
<span class="entryFormHeadInstructions">(<sup>*</sup> Required Fields)</span>
</div><!--entryFormHead-->
</th></tr>
<tr class="editformcell">
<td valign="top">
<b>Broader tab<sup>*</sup></b><br/>
<select name="ParentId">
<c:forEach var="option" items="${epo.formObject.optionLists['ParentId']}">
<option value="${option.value}">${option.body}</option>
</c:forEach>
</select>
<span class="warning"><form:error name="ParentId"/></span>
</td>
</tr>
<tr class="editformcell">
<td valign="top">
<b>Narrower Tab<sup>*</sup></b><br/>
<select name="ChildId" >
<c:forEach var="option" items="${epo.formObject.optionLists['ChildId']}">
<option value="${option.value}">${option.body}</option>
</c:forEach>
</select>
<span class="warning"><form:error name="ChildId"/></span>
</td>
</tr>
<tr class="editformcell">
<td colspan="3" align="center">
<c:choose>
<c:when test='${_action == "insert"}'>
<input id="primaryAction" type="submit" class="form-button" name="_insert" value="Create New Record"/>
</c:when>
<c:otherwise>
<input id="primaryAction" type="submit" class="form-button" name="_update" value="Submit Changes"/>
<input type="submit" class="form-button" name="_insert" value="Save as New Record"/>
<input type="submit" class="form-button" name="_delete" onclick="return confirmDelete();" value="Delete"/>
</c:otherwise>
</c:choose>
<input type="reset" class="form-button" value="Reset"/>
<input type="submit" class="form-button" name="_cancel" value="Cancel"/>
</td>
</tr>
</table>
</div><!--alignCenter-->
</form>
</div><!--editingform-->

View file

@ -1,21 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
<tr class="editformcell">
<td valign="top">
<b>Tab</b><br/>
<select name="TabId" >
<form:option name="TabId"/>
</select>
<font size="2" color="red"><form:error name="TabId"/></font>
</td>
</tr>
<tr class="editformcell">
<td valign="top">
<b>Vclass</b><br/>
<select name="VClassURI" >
<form:option name="VClassId"/>
</select>
<font size="2" color="red"><form:error name="VClassId"/></font>
</td>
</tr>

View file

@ -1,193 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
<%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.ManageTabs" %>
<% request.setAttribute("requestedActions", new ManageTabs()); %>
<vitro:confirmAuthorization />
<div class="editingForm">
<jsp:include page="/templates/edit/fetch/vertical.jsp"/>
<%
/**
*
* @version 1.00
* @author Jon Corson-Rikert
*
* UPDATES:
* BJL 2007-XX-XX : significant modifications for semweb-align (removed SQL tags, etc.)
* JCR 2006-03-05 : modified references to ETypes and change property file used to display auto-affiliated vclasses (a.k.a. types)
* JCR 2005-11-06 : modified field specifications for tab editing so tabs_retry will get numeric rather than String versions of flag2Set and flag3Set
*/
%>
<c:set var="PRIMARY_TAB_TABTYPE" value="28"/>
<c:set var="SUBCOLLECTION_CATEGORY_TABTYPE" value="18"/>
<p/>
<div align="center">
<table class="form-background" border="0" cellpadding="2" cellspacing="2">
<tr valign="bottom" align="center">
<td>
<form action="./" method="get">
<input type="submit" class="form-button" value="Display This Tab (Public)"/>
<input type="hidden" name="primary" value="${tab.tabId}" />
</form>
<form action="listTabs" method="get">
<input type="submit" class="form-button" value="See All Tabs"/>
</form>
</td>
<td valign="bottom" align="center">
<form action="editForm" method="get">
<input name="id" type = "hidden" value="<%=request.getAttribute("tabId")%>" />
<input type="submit" class="form-button" value="Edit Tab Details"/>
<input type="hidden" name="controller" value="Tab"/>
</form>
</td>
<td valign="bottom">
<form action="editForm" method="get">
<input type="submit" class="form-button" value="Add New Tab"/>
<input type="hidden" name="controller" value="Tab"/>
</form>
</td>
</tr>
<tr><td colspan="3"><hr/></td></tr>
<!-- ____________________________ parent tabs ______________________________________ -->
<c:choose>
<c:when test="${tab.tabtypeId < PRIMARY_TAB_TABTYPE}">
<tr valign="bottom">
<td colspan="2" valign="bottom">
<c:if test="${!empty epo.formObject.checkboxLists['parentTabs']}">
<form action="doTabHierarchyOperation" method="get">
<ul>
<c:forEach var="cb" items="${epo.formObject.checkboxLists['parentTabs']}">
<li style="list-style-type:none"><input name="ParentId" type="checkbox" value="${cb.value}"/>${cb.body}</li>
</c:forEach>
</ul>
<input type="submit" class="form-button" value="Remove checked parent tabs"/>
<input type="hidden" name="ChildId" value="${tab.tabId}"/>
<input type="hidden" name="primaryAction" value="_remove"/>
<input type="hidden" name="_epoKey" value="${tabHierarchyEpoKey}"/>
</form>
</c:if>
</td>
<td>
<form action="editForm" method="get">
<input type="hidden" name="ChildId" value="${tab.tabId}">
<input type="hidden" name="controller" value="Tabs2Tabs"/>
<input type="submit" class="form-button" value="Add existing tab as parent tab"/>
</form>
</td>
</tr>
</c:when>
<c:otherwise>
<tr><td colspan="3" align="center">This is the highest level tab, so no links to higher tabs are possible.</td></tr>
</c:otherwise>
</c:choose>
<tr><td colspan="3"><hr/></td></tr>
<!-- _____________________________________ child tabs ___________________________________________ -->
<c:choose>
<c:when test="${tab.tabtypeId>SUBCOLLECTION_CATEGORY_TABTYPE}">
<tr valign="bottom">
<td colspan="2" valign="bottom">
<c:if test="${!empty epo.formObject.checkboxLists['childTabs']}">
<form action="doTabHierarchyOperation" method="get">
<ul>
<c:forEach var="cb" items="${epo.formObject.checkboxLists['childTabs']}">
<li style="list-style-type:none"><input name="ChildId" type="checkbox" value="${cb.value}"/>${cb.body}</li>
</c:forEach>
</ul>
<input type="hidden" name="ParentId" value="${tab.tabId}"/>
<input type="submit" class="form-button" value="Remove checked child tabs"/>
<input type="hidden" name="primaryAction" value="_remove"/>
<input type="hidden" name="_epoKey" value="${tabHierarchyEpoKey}"/>
</form>
</c:if>
</td>
<td>
<form action="editForm" method="get">
<input type="hidden" name="ParentId" value="${tab.tabId}">
<input type="hidden" name="controller" value="Tabs2Tabs">
<input type="submit" class="form-button" value="Add existing tab as child tab"/>
</form>
</td>
</tr>
</c:when>
<c:otherwise>
<tr><td colspan="3" align="center">This is the lowest level tab, so no links to lower tabs are possible.</td></tr>
</c:otherwise>
</c:choose>
<tr><td colspan="3"><hr/></td></tr>
<!-- ________________________________________________ vClasses __________________________________________________ -->
<c:choose>
<c:when test="${tab.entityLinkMethod eq 'auto' || tab.entityLinkMethod eq 'mixed'}">
<tr valign="bottom" align="center">
<td colspan="2" valign="bottom" align="left">
<c:if test="${!empty affilTypes}">
<form action="tabs2TypesOp" method="get">
<ul style="list-style-type:none;">
<c:forEach var="type" items="${affilTypes}">
<li style="list-style-type:none;"><input type="checkbox" name="TypeURI" value="${type.URI}">${type.name}</input></li>
</c:forEach>
</ul>
<input type="hidden" name="TabId" value="${tab.tabId}"/>
<input type="hidden" name="operation" value="remove"/>
<input type="hidden" name="_epoKey" value="${epoKey}"/>
<input type="submit" class="form-button" value="Remove Checked Class Autolinks"/>
</form>
</c:if>
</td>
<td>
<form action="editForm" method="get">
<input type="hidden" name="TabId" value="${tab.tabId}"/>
<input type="hidden" name="controller" value="Tabs2Types"/>
<input type="submit" class="form-button" value="Add Class Autolink"/>
</form>
</td>
</tr>
<tr><td colspan="3"><hr/></td></tr>
</c:when>
<c:otherwise><tr><td colspan="3" align="center">This tab is set for manual links to individuals only. Auto-affiliation with a type is not possible.</td></tr><tr><td colspan="3"><hr/></td></tr></c:otherwise>
</c:choose>
<!-- _______________________________________ entities ___________________________________________________ -->
<c:choose>
<c:when test="${tab.entityLinkMethod eq 'manual' || tab.entityLinkMethod eq 'mixed'}">
<tr valign="bottom" align="center">
<td colspan="2" valign="bottom" align="left">
<c:if test="${!empty epo.formObject.checkboxLists['affilEnts']}">
<form action="tabIndividualRelationOp" method="get">
<ul style="list-style-type:none;">
<c:forEach var="cb" items="${epo.formObject.checkboxLists['affilEnts']}">
<li style="list-style-type:none;"><input type="checkbox" name="TirURI" value="${cb.value}" class="form-item"/>${cb.body}</li>
</c:forEach>
</ul>
<input type="hidden" name="TabId" value="${tab.tabId}"/>
<input type="hidden" name="operation" value="remove"/>
<input type="hidden" name="_epoKey" value="${epoKey}"/>
<input type="submit" class="form-button" value="Remove Checked Individuals"/>
</form>
</c:if>
</td>
<td>
<form action="editForm" method="get">
<select name="VClassUri" class="form-item">
<form:option name="VClassURI"/>
</select><br/>
<p>Select class of individual</p>
<input type="hidden" name="TabId" value="${tab.tabId}"/>
<input type="hidden" name="controller" value="Tabs2Ents"/>
<input type="submit" class="form-button" value="Add an individual to this tab"/>
</form>
</td>
</tr>
</c:when>
<c:otherwise><tr><td colspan="3" align="center">This tab is set for tab-type relationships only; direct links to individuals are not possible</td></tr></c:otherwise>
</c:choose>
</table>
</div>
</div>

View file

@ -17,14 +17,10 @@
<li><a href="${siteConfig.urls.menuN3Editor}">Menu management</a></li>
</#if>
<#if siteConfig.urls.tabs??>
<li><a href="${siteConfig.urls.tabs}">Tab management</a></li>
</#if>
<#if siteConfig.urls.users??>
<li><a href="${siteConfig.urls.users}">User accounts</a></li>
</#if>
</ul>
</div>
</#if>
</#if>

View file

@ -1,44 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Tab" %>
<%@page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page errorPage="/error.jsp"%>
<% /***********************************************
Displays the little group of things at the bottom of the page
for administrators and editors.
request.attributes:
an Tab object with the name "leadingTab"
request.parameters:
None, should only work with requestScope attributes for security reasons.
Consider sticking < % = MiscWebUtils.getReqInfo(request) % > in the html output
for debugging info.
bdc34 2006-01-22 created
**********************************************/
Tab leadingTab = (Tab) request.getAttribute("leadingTab");
if (leadingTab == null) {
String e = "tabAdmin.jsp expects that request attribute 'leadingTab' be set to a TabBean object";
throw new JspException(e);
}
%>
<% if ( LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.EDITOR)) { %>
<c:set var='tab' value='${requestScope.leadingTab}'/><%/* just moving this into page scope for easy use */ %>
<div class='admin bottom'>
<c:url var="editHref" value="tabEdit">
<c:param name="controller" value="Tab"/>
<c:param name="id" value="${tab.tabId}"/>
</c:url>
<c:set var="editHref">
<c:out value="${editHref}" escapeXml="true"/>
</c:set>
<a href="${editHref}">edit tab: <em>${tab.title}</em></a>
</div>
<% } %>

View file

@ -1,134 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page errorPage="/error.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.TabWebUtil" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Tab" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %>
<%@ page import="java.util.Collection" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Link" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page import="org.joda.time.format.DateTimeFormatter" %>
<%@ page import="org.joda.time.format.ISODateTimeFormat" %>
<%@ page import="org.joda.time.DateTime" %>
<%
/******************************
Takes tab and populates Atom feed with:
requested tab and its description
entities associated with this tab
immediate children of this tab and their descriptions
******************************/
response.setContentType("application/atom+xml");
Tab leadingTab = (Tab) request.getAttribute("leadingTab");
if (leadingTab == null) {
String e = "tabprimary expects that request attribute 'leadingTab' be set to a TabBean object";
throw new JspException(e);
}
Collection<Individual> individuals = leadingTab.getRelatedEntities();
Collection<Tab> tabs = leadingTab.getChildTabs();
int portalId = 1;
DateTime dt = new DateTime();
DateTimeFormatter dtf = ISODateTimeFormat.basicDateTimeNoMillis();
String time = dtf.print(dt.getMillis());
time = time.substring(0,4)+"-"+time.substring(4,6)+"-"+time.substring(6,11)+":"+time.substring(11,13)+":"+time.substring(13,15)+"Z";
%>
<%!
public String forURL(String frag)
{
String result = null;
try
{
result = URLEncoder.encode(frag, "UTF-8");
} catch (Exception ex) {
throw new RuntimeException("UTF-8 not supported", ex);
}
return result;
}
public String escapeEntity(String frag)
{
if(frag.contains("&")) frag = replaceAll(frag, "&", "&amp;");
if(frag.contains("'")) frag = replaceAll(frag, "'", "&apos;");
if(frag.contains("\"")) frag = replaceAll(frag, "\"", "&quot;");
if(frag.contains(">")) frag = replaceAll(frag, ">", "&gt;");
if(frag.contains("<")) frag = replaceAll(frag, "<", "&lt;");
return frag;
}
public String replaceAll(String original, String match, String replace)
{
int index1 = original.indexOf(match);
int index2 = original.indexOf(replace);
if(index1 == index2 && index1 != -1)
{
original = original.substring(0, index1+replace.length()+1)+replaceAll(original.substring(index1+replace.length()+1), match, replace);
return original;
}
if(index1 == -1) return original;
String before = original.substring(0, index1) + replace;
return before + replaceAll(original.substring(index1+1), match, replace);
}
%>
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en" xml:base="http://<%= request.getServerName()+":"+request.getLocalPort() %>">
<title><%= escapeEntity(leadingTab.getTitle()) %></title>
<subtitle><%= leadingTab.getDescription() %></subtitle>
<link href="<%= "http://"+request.getServerName()+":"+request.getLocalPort()+request.getContextPath()+escapeEntity("/index.jsp?home="+portalId+"&"+leadingTab.getTabDepthName()+"="+leadingTab.getTabId()+"&view=atom") %>" rel="self" type="application/atom+xml" />
<link href="<%= "http://"+request.getServerName()+":"+request.getLocalPort()+request.getContextPath()+escapeEntity("/index.jsp?home="+portalId+"&"+leadingTab.getTabDepthName()+"="+leadingTab.getTabId()) %>" rel="alternate" type="text/html" />
<id><%= "http://"+request.getServerName()+":"+request.getLocalPort()+request.getContextPath()+escapeEntity("/index.jsp?home="+portalId+"&"+leadingTab.getTabDepthName()+"="+leadingTab.getTabId()) %></id>
<updated><%= time %></updated>
<author>
<name>Vivo</name>
<email>vivo@cornell.edu</email>
</author>
<% for(Individual i:individuals) { %>
<entry>
<title><%= escapeEntity(i.getName()) %></title>
<% if (i.getLinksList() == null) { %>
<% for(Link l: i.getLinksList()) { %>
<link href="<%= l.getUrl() %>" rel="alternate" type="text/html" />
<% } %>
<% } else { %>
<link href="<%= escapeEntity(request.getContextPath().substring(1)+"/entity?home="+portalId+"&uri="+forURL(i.getURI())) %>" rel="alternate" type="text/html" />
<% } %>
<id><%= i.getURI() %></id>
<updated><%= time %></updated>
<% if (i.getBlurb() != null) { %>
<% if (i.getBlurb().matches(".*<.*>.*")) { %>
<summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><%= i.getBlurb() %></div></summary>
<% } %>
<% else { %>
<summary type="text"><%= i.getBlurb() %></summary>
<% } %>
<% } %>
<% if (i.getDescription() != null) { %>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><%= i.getDescription() %></div></content>
<% } %>
</entry>
<% } %>
<% if (tabs != null) { %>
<% for(Tab t:tabs) { %>
<entry>
<title><%= escapeEntity(t.getTitle()) %></title>
<link href="<%= escapeEntity(request.getContextPath().substring(1)+"/index.jsp?home="+portalId+"&"+t.getTabDepthName()+"="+t.getTabId()) %>" rel="alternate" type="text/html" />
<id><%= "http://"+request.getServerName()+":"+request.getLocalPort()+request.getContextPath()+escapeEntity("/index.jsp?home="+portalId+"&"+t.getTabDepthName()+"="+t.getTabId()) %></id>
<updated><%= time %></updated>
<% if (t.getDescription() != null) { %>
<% if (t.getDescription().matches(".*<.*>.*")) { %>
<summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><%= t.getDescription() %></div></summary>
<% } %>
<% else { %>
<summary type="text"><%= t.getDescription() %></summary>
<% } %>
<% } %>
<% if (t.getBody() != null) { %>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><%= t.getBody() %></div></content>
<% } %>
</entry>
<% } %>
<% } %>
</feed>

View file

@ -1,138 +0,0 @@
<%-- $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.TabWebUtil" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Tab" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
<%@ page errorPage="/error.jsp"%>
<% /***********************************************
Display a single tab or subtab in the most basic fashion.
Note: most of the depth based control is in tabSub.jsp
tabSubAsList.jsp and tabEntities.jsp. The only depth based
control of what gets displayed that is in this code is
the tab.body, which is only displayed on depth 1.
request.attributes:
a Tab object with the name "tab3223" where 3223 is
the id of the tab to display. This can be added to the attribute
list using TabWebUtil.stashTabsInRequest which gets called
in tabprimary.jsp.
request.parameters:
"tabDepth" String that is the depth of the tab in the display
leadingTab = 1, child of leadingTab = 2, etc.
if tabDepth is not set it defaults to 1
"tabId" id of the tab to display, defaults to leadingTab.
"noDesc" if true then don't display the tab.description, default is false.
"noEntities" if true then don't display the associated entities for this tab.
"noContent" if true then don't display the primary content tabs.
"noSubtabs" if true then don't display the subtabs associated with this tab.
"subtabsAsList" if true then display just children (not grand children,etc) subtabs as a list.
Consider sticking < % = MiscWebUtils.getReqInfo(request) % > in the html
output for debugging info.
bdc34 2006-01-03 created
**********************************************/
String INACTIVE = "";
String DEFAULT_LABEL = null;
/***************************************************
nac26 2008-05-08 following brian's lead from menu.jsp to get the portalId so it can be added to the tab links */
final Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.web.tabBasic.jsp");
int portalId = 1;
/**************************************************/
String tabId = request.getParameter("tabId");
if (tabId == null) {
String e = "tabBasic expects that request parameter 'tabId' be set";
throw new JspException(e);
}
Tab tab = TabWebUtil.findStashedTab(tabId, request);
if (tab == null) {
String e = "tabBasic expects that request attribute 'leadingTab' will have the tab with tabId as a sub tab";
throw new JspException(e);
}
String obj = request.getParameter("tabDepth");
int depth = 1; //depth 1 represents primary tab level, 2 is secondary, etc.
if (obj == null) {
String e = "tabBasic expects that request parameter 'tabDepth' be set";
throw new JspException(e);
}
depth = Integer.parseInt((String) obj);
boolean entities = true;
if ("true".equalsIgnoreCase(request.getParameter("noEntities")))
entities = false;
boolean content = true;
if ("true".equalsIgnoreCase(request.getParameter("noContent")))
content = false;
boolean subtabs = true;
if ("true".equalsIgnoreCase(request.getParameter("noSubtabs")))
subtabs = false;
boolean subtabsAsList = false;
if ("true".equalsIgnoreCase(request.getParameter("subtabsAsList"))) {
subtabsAsList = true;
subtabs = false;
}
boolean noDesc = false;
if ("true".equalsIgnoreCase(request.getParameter("noDesc"))) {
noDesc = true;
}
String tabEntsController = Controllers.TAB_ENTITIES;
String titleLink = TabWebUtil.tab2TabAnchorElement(tab, request, depth, INACTIVE, DEFAULT_LABEL, portalId);
if (depth == 1)//don't make a link for root dispaly tab
titleLink = tab.getTitle();
Integer headingDepth = depth + 1;
String headingOpen = "<h" + headingDepth + ">";
String headingClose = "</h" + headingDepth + ">";
String tabDesc = "";
if (!noDesc && tab.getDescription() != null && !tab.getDescription().equals("&nbsp;"))
tabDesc = "<div class='tabDesc' >" + tab.getDescription() + "</div>";
String tabBody = "";
/* tab.body is only displayed for the depth 1 display tab */
if (depth <= 2 && tab.getBody() != null && !tab.getBody().equals("&nbsp;"))
tabBody = "<div class='tabBody'>" + tab.getBody() + "</div><!-- END div class='tabBody' -->";
%>
<div class="tab depth<%=depth%>" id="tab<%=tabId%>">
<%=headingOpen%><%=titleLink%><%=headingClose%>
<%=tabDesc%>
<%=tabBody%>
<% if( entities ){ %>
<jsp:include page="<%=tabEntsController%>" flush="true">
<jsp:param name="tabId" value="<%=tab.getTabId()%>"/>
<jsp:param name="tabDepth" value="<%=depth%>"/>
</jsp:include>
<% } %>
<% if( subtabs ) { %>
<jsp:include page="tabSub.jsp" flush="true">
<jsp:param name="tabId" value="<%=tab.getTabId()%>"/>
<jsp:param name="tabDepth" value="<%=depth%>"/>
</jsp:include>
<% }%>
<% if( subtabsAsList ) { %>
<jsp:include page="tabSubAsList.jsp" flush="true">
<jsp:param name="tabId" value="<%=tab.getTabId()%>"/>
<jsp:param name="tabDepth" value="<%=depth%>"/>
</jsp:include>
<% }%>
<% if(content) { %>
<jsp:include page="tabContent.jsp" flush="true">
<jsp:param name="tabId" value="<%=tab.getTabId()%>"/>
<jsp:param name="tabDepth" value="1" />
</jsp:include>
<% } %>
</div><!-- tab depth<%=depth%> -->

View file

@ -1,95 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Tab" %>
<%@ page import="java.util.Collection,java.util.Iterator" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.TabWebUtil" %>
<%@ page errorPage="/error.jsp"%>
<%
int CutOffDepth = 3;
/***********************************************
Tab Content is to display the sub tabs of type primaryTabContent
Primary Content Tabs will have:
tab heading,
tab description
request.attributes
"leadingTab" the tab that is at the top of the display hierarchy
"tabDepth" String that is the depth of the tab in the display
leadingTab = 1, child of leadingTab = 2, etc.
Here tabDepth does not default, it must be set
bdc34 2006-01-12 created
**********************************************/
Tab leadingTab =(Tab) request.getAttribute("leadingTab");
if(leadingTab== null ) {
String e="tabContent expects that request attribute 'leadingTab' be set";
throw new JspException(e);
}
String tabId = request.getParameter("tabId");
if( tabId == null ){
String e="tabContent expects that request parameter 'tabId' be set";
throw new JspException(e);
}
Tab tab = null;
tab = TabWebUtil.findStashedTab(tabId,request);
if( tab == null ){
String e="tabContent expects that request attribute 'leadingTab' will have the tab with tabId as a sub tab";
throw new JspException(e);
}
String obj= request.getParameter("tabDepth");
int depth = 1; //depth 1 represents primary tab level, 2 is secondary, etc.
if( obj == null ){
String e="tabContent expects that request parameter 'tabDepth' be set";
throw new JspException(e);
}
depth = Integer.parseInt((String)obj);
int childDepth = depth + 1;
Collection children = tab.filterChildrenForContentTabs();
if( depth < CutOffDepth && children!= null ){
Iterator childIter=children.iterator();
boolean hasChildren = childIter.hasNext();
int columnSize = children.size();
if( hasChildren ){ %>
<div id='tabContent'><!-- tabContent.jsp -->
<table><tr>
<% }
while( childIter.hasNext() ) {
Tab contentTab = (Tab)childIter.next();
TabWebUtil.stashTabsInRequest(contentTab, request); %>
<% if (columnSize==2) {%>
<td class="span-12">
<% } %>
<% else if (columnSize==3) {%>
<td class="span-8">
<% } %>
<% else if (columnSize==4) {%>
<td class="span-6">
<% } %>
<% else {%>
<td>
<% } %>
<jsp:include page='tabBasic.jsp'>
<jsp:param name='tabDepth' value='<%=childDepth%>' />
<jsp:param name='tabId' value='<%=contentTab.getTabId()%>' />
<jsp:param name='noContent' value='true'/>
<jsp:param name='noSubtabs' value='true'/>
</jsp:include>
</td>
<% }
if( hasChildren ){ %>
</tr></table>
</div><!-- end tabContent div-->
<%}%>
<% } %>

View file

@ -1,128 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="java.util.Collection" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Tab" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.TabWebUtil" %>
<%@ page import="java.util.Iterator" %>
<%@ page errorPage="/error.jsp"%>
<%
int CutOffDepth = 3; //tab depth at which subtabs stop being shown
int HorzSubTabCutOff = 8; //subtab count at which we switch to tabSubAsList.jsp
int EntsInDepth2TabsCutOff = 4; //subtab count at which entities stop being shown in depth 2 tabs.
int TabDescCutoffDepth = 3;//depth at which descriptions of subtabs stop being shown
/***********************************************
Display a set of subtabs for a tab
request.attributes
"leadingTab" the tab that is at the top of the display hierarchy
request.parameters
"tabId" id of the tab to do subtabs for
"noEntities" can be set to 'true' or 'false' and will control if
subtabs have entities. defaults to false/having entites;
"tabDepth" String that is the depth of the tab in the display
leadingTab = 1, child of leadingTab = 2, etc.
Here tabDepth does not default, it must be set
bdc34 2006-01-12 created
**********************************************/
Tab leadingTab = (Tab) request.getAttribute("leadingTab");
if (leadingTab == null) {
String e = "tabSub expects that request attribute 'leadingTab' be set";
throw new JspException(e);
}
String tabId = request.getParameter("tabId");
if (tabId == null) {
String e = "tabSub expects that request parameter 'tabId' be set";
throw new JspException(e);
}
Tab tab = null;
tab = TabWebUtil.findStashedTab(tabId, request);
if (tab == null) {
String e = "tabSub expects that request attribute 'leadingTab' will have the tab with tabId as a sub tab";
throw new JspException(e);
}
String obj = request.getParameter("tabDepth");
int depth = 1; //depth 1 represents primary tab level, 2 is secondary, etc.
if (obj == null) {
String e = "tabSub expects that request parameter 'tabDepth' be set";
throw new JspException(e);
}
depth = Integer.parseInt((String) obj);
int childDepth = depth + 1;
Collection children = tab.filterChildrenForSubtabs();
if (depth < CutOffDepth && children != null) {
if (children.size() >= HorzSubTabCutOff) { /* too many children, do tabSubAsList instead */ %>
<jsp:include page='tabSubAsList.jsp' >
<jsp:param name='tabDepth' value='<%=depth%>' />
<jsp:param name='tabId' value='<%=tabId%>' />
</jsp:include>
<% } else {
//here we figure out if these subtabs should have entities
//if we were passed a parameter, then maybe no entities
obj = request.getParameter("noEntities");
String noEntities = "true".equalsIgnoreCase(obj) ? "true" : "false";
//if we have more subtabs then the cutoff, no entities for the subtabs
noEntities = (children.size() >= EntsInDepth2TabsCutOff ? "true" : noEntities);
//if we are the first set of subtabs on a primary tab it seems there are no entities? sort of odd
noEntities = ((tab.PRIMARY_TAB == tab.getTabtypeId() && childDepth == 2) ? "true" : noEntities);
String noDesc = (childDepth >= TabDescCutoffDepth) ? "true" : "false";
Iterator childIter = children.iterator();
boolean hasChildren = childIter.hasNext();
int columnSize = children.size();
if (hasChildren) { %>
<div class='subtabs'><!-- tabSub.jsp -->
<table><tr>
<% }
while( childIter.hasNext() ) {
Tab subtab = (Tab)childIter.next();
TabWebUtil.stashTabsInRequest(subtab, request); %>
<% if (columnSize==1) {%>
<td class="span-24">
<% } %>
<% else if (columnSize==2) {%>
<td class="span-12">
<% } %>
<% else if (columnSize==3) {%>
<td class="span-8">
<% } %>
<% else if (columnSize==4) {%>
<td class="span-6">
<% } %>
<% else {%>
<td>
<% } %>
<jsp:include page='tabBasic.jsp'>
<jsp:param name='tabDepth' value='<%=childDepth%>' />
<jsp:param name='tabId' value='<%=subtab.getTabId()%>' />
<jsp:param name='noDesc' value='<%=noDesc%>'/>
<jsp:param name='noEntities' value='<%=noEntities%>'/>
<jsp:param name='noContent' value='true'/>
<jsp:param name='noSubtabs' value='true'/>
<jsp:param name='subtabsAsList' value='true'/>
</jsp:include>
</td>
<% }
if( hasChildren ){ %>
</tr></table>
</div><!-- end subtabs div-->
<%}
}
} %>

View file

@ -1,87 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="java.lang.Integer" %>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.TabWebUtil" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Tab" %>
<%@ page errorPage="/error.jsp"%>
<%
int CutOffDepth = 3; //tab depth at which subtabs stop being shown
int TabDescCutoffDepth = 3;//depth at which descriptions of subtabs stop being shown
/***********************************************
Display a set of subtabs for a Tab as a <UL></UL>
Based on tabSub.
This does not attempt to display any subtabs, entities, etc.
request.attributes
"leadingTab" the tab that is at the top of the display hierarchy
request.parameters
"tabId" id of the tab to do subtabs for
"tabDepth" String that is the depth of the tab in the display
leadingTab = 1, child of leadingTab = 2, etc.
Here tabDepth does not default, it must be set
bdc34 2006-01-18 created
**********************************************/
Tab leadingTab = (Tab) request.getAttribute("leadingTab");
if (leadingTab == null) {
String e = "tabSub expects that request attribute 'leadingTab' be set";
throw new JspException(e);
}
String tabId = request.getParameter("tabId");
if (tabId == null) {
String e = "tabSub expects that request parameter 'tabId' be set";
throw new JspException(e);
}
Tab tab = null;
tab = TabWebUtil.findStashedTab(tabId, request);
if (tab == null) {
String e = "tabSub expects that request attribute 'leadingTab' will have the tab with tabId as a sub tab";
throw new JspException(e);
}
String obj = request.getParameter("tabDepth");
int depth = 1; //depth 1 represents primary tab level, 2 is secondary, etc.
if (obj == null) {
String e = "tabSub expects that request parameter 'tabDepth' be set";
throw new JspException(e);
}
depth = Integer.parseInt((String) obj);
int childDepth = depth + 1;
String noDesc = (childDepth >= TabDescCutoffDepth) ? "true" : "false";
//noDesc = "true";
Collection children = tab.filterChildrenForSubtabs();
if (depth < CutOffDepth && children != null) {
Iterator childIter = children.iterator();
boolean hasChildren = childIter.hasNext();
if (hasChildren) { %>
<div class='subtabs'><!-- tabSub.jsp -->
<ul class='tabSubAsList'>
<% }
while( childIter.hasNext() ) {
Tab subtab = (Tab)childIter.next();
TabWebUtil.stashTabsInRequest(subtab,request); %>
<li>
<jsp:include page='tabBasic.jsp'>
<jsp:param name='tabDepth' value='<%=childDepth%>' />
<jsp:param name='tabId' value='<%=subtab.getTabId()%>' />
<jsp:param name='noDesc' value='<%=noDesc%>'/>
<jsp:param name='yesBody' value='false'/>
<jsp:param name='noEntities' value='true'/>
<jsp:param name='noContent' value='true'/>
<jsp:param name='noSubtabs' value='true'/>
</jsp:include>
</li>
<% }
if( hasChildren ){ %>
</ul>
</div><!-- end subtabs div-->
<%}%>
<% } %>

View file

@ -1,38 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page errorPage="/error.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.TabWebUtil" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Tab" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %>
<% /***********************************************
Display a primary tab.
A display of a primary tab will include:
primary tab heading,
the primary tab description,
the primary tab body,
the secondary tabs ,
the primary content tabs.
expected request.attributes:
'leadingTab' Tab to be desplayed as root of display hierarchy
bdc34 2006-01-03 created
**********************************************/
Tab leadingTab = (Tab) request.getAttribute("leadingTab");
if (leadingTab == null) {
String e = "tabprimary expects that request attribute 'leadingTab' be set to a TabBean object";
throw new JspException(e);
}
TabWebUtil.stashTabsInRequest(leadingTab, request); %>
<div id="content">
<div id='contents'>
<jsp:include page='/templates/tabs/tabBasic.jsp' flush='true'>
<jsp:param name='tabId' value='<%= leadingTab.getTabId() %>' />
<jsp:param name='tabDepth' value='1' />
</jsp:include>
<jsp:include page='/templates/tabs/tabAdmin.jsp' flush='true' />
</div> <!-- contents -->
</div><!-- content -->