<%-- The contents of this file are subject to the license and copyright detailed in the LICENSE and NOTICE files at the root of the source tree and available online at http://www.dspace.org/license/ --%> <%-- - Display the results of browsing a full hit list --%> <%@ page contentType="text/html;charset=UTF-8" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %> <%@ page import="org.dspace.browse.BrowseInfo" %> <%@ page import="org.dspace.sort.SortOption" %> <%@ page import="org.dspace.content.Collection" %> <%@ page import="org.dspace.content.Community" %> <%@ page import="org.dspace.browse.BrowseIndex" %> <%@ page import="org.dspace.core.ConfigurationManager" %> <%@ page import="java.net.URLEncoder" %> <%@ page import="org.dspace.content.DCDate" %> <%@ page import="org.dspace.app.webui.util.UIUtil" %> <% request.setAttribute("LanguageSwitch", "hide"); String urlFragment = "browse"; String layoutNavbar = "default"; boolean withdrawn = false; boolean privateitems = false; // Is the logged in user an admin or community admin or collection admin Boolean admin = (Boolean)request.getAttribute("is.admin"); boolean isAdmin = (admin == null ? false : admin.booleanValue()); Boolean communityAdmin = (Boolean)request.getAttribute("is.communityAdmin"); boolean isCommunityAdmin = (communityAdmin == null ? false : communityAdmin.booleanValue()); Boolean collectionAdmin = (Boolean)request.getAttribute("is.collectionAdmin"); boolean isCollectionAdmin = (collectionAdmin == null ? false : collectionAdmin.booleanValue()); if (request.getAttribute("browseWithdrawn") != null) { layoutNavbar = "admin"; urlFragment = "dspace-admin/withdrawn"; withdrawn = true; if(!isAdmin && (isCommunityAdmin || isCollectionAdmin)) { layoutNavbar = "community-or-collection-admin"; } } else if (request.getAttribute("browsePrivate") != null) { layoutNavbar = "admin"; urlFragment = "dspace-admin/privateitems"; privateitems = true; if(!isAdmin && (isCommunityAdmin || isCollectionAdmin)) { layoutNavbar = "community-or-collection-admin"; } } // First, get the browse info object BrowseInfo bi = (BrowseInfo) request.getAttribute("browse.info"); BrowseIndex bix = bi.getBrowseIndex(); SortOption so = bi.getSortOption(); // values used by the header String scope = ""; String type = ""; String value = ""; Community community = null; Collection collection = null; if (bi.inCommunity()) { community = (Community) bi.getBrowseContainer(); } if (bi.inCollection()) { collection = (Collection) bi.getBrowseContainer(); } if (community != null) { scope = "\"" + community.getName() + "\""; } if (collection != null) { scope = "\"" + collection.getName() + "\""; } type = bix.getName(); // next and previous links are of the form: // [handle///]browse?type=&sort_by=&order=[&value=][&rpp=][&[focus=|vfocus=] // prepare the next and previous links String linkBase = request.getContextPath() + "/"; if (collection != null) { linkBase = linkBase + "handle/" + collection.getHandle() + "/"; } if (community != null) { linkBase = linkBase + "handle/" + community.getHandle() + "/"; } String direction = (bi.isAscending() ? "ASC" : "DESC"); String argument = null; if (bi.hasAuthority()) { value = bi.getAuthority(); argument = "authority"; } else if (bi.hasValue()) { value = bi.getValue(); argument = "value"; } String valueString = ""; if (value!=null) { valueString = "&" + argument + "=" + URLEncoder.encode(value, "UTF-8"); } String sharedLink = linkBase + urlFragment + "?"; if (bix.getName() != null) sharedLink += "type=" + URLEncoder.encode(bix.getName(), "UTF-8"); sharedLink += "&sort_by=" + URLEncoder.encode(Integer.toString(so.getNumber()), "UTF-8") + "&order=" + URLEncoder.encode(direction, "UTF-8") + "&rpp=" + URLEncoder.encode(Integer.toString(bi.getResultsPerPage()), "UTF-8") + "&etal=" + URLEncoder.encode(Integer.toString(bi.getEtAl()), "UTF-8") + valueString; String next = sharedLink; String prev = sharedLink; if (bi.hasNextPage()) { next = next + "&offset=" + bi.getNextOffset(); } if (bi.hasPrevPage()) { prev = prev + "&offset=" + bi.getPrevOffset(); } // prepare a url for use by form actions String formaction = request.getContextPath() + "/"; if (collection != null) { formaction = formaction + "handle/" + collection.getHandle() + "/"; } if (community != null) { formaction = formaction + "handle/" + community.getHandle() + "/"; } formaction = formaction + urlFragment; // prepare the known information about sorting, ordering and results per page String sortedBy = so.getName(); String ascSelected = (bi.isAscending() ? "selected=\"selected\"" : ""); String descSelected = (bi.isAscending() ? "" : "selected=\"selected\""); int rpp = bi.getResultsPerPage(); // the message key for the type String typeKey; if (bix.isMetadataIndex()) typeKey = "browse.type.metadata." + bix.getName(); else if (bi.getSortOption() != null) typeKey = "browse.type.item." + bi.getSortOption().getName(); else typeKey = "browse.type.item." + bix.getSortOption().getName(); // Admin user or not Boolean admin_b = (Boolean)request.getAttribute("admin_button"); boolean admin_button = (admin_b == null ? false : admin_b.booleanValue()); %> <%-- OK, so here we start to develop the various components we will use in the UI --%> <%@page import="java.util.Set"%> <%-- Build the header (careful use of spacing) --%>

<%= value %>

<%-- Include the main navigation for all the browse pages --%> <%-- This first part is where we render the standard bits required by both possibly navigations --%>
<% if (bi.hasAuthority()) { %><% } else if (bi.hasValue()) { %><% } %> <%-- If we are browsing by a date, or sorting by a date, render the date selection header --%> <% if (so.isDate() || (bix.isDate() && so.isDefault())) { %> " />
<% } // If we are not browsing by a date, render the string selection header // else { %> 0-9 <% for (char c = 'A'; c <= 'Z'; c++) { %> <%= c %> <% } %>
 " /> <% } %>
<%-- End of Navigation Headers --%> <%-- Include a component for modifying sort by, order, results per page, and et-al limit --%>
<% if (bi.hasAuthority()) { %><% } else if (bi.hasValue()) { %><% } %> <%-- The following code can be used to force the browse around the current focus. Without it the browse will revert to page 1 of the results each time a change is made --%> <%-- if (!bi.hasItemFocus() && bi.hasFocus()) { %><% } --%> <%-- if (bi.hasItemFocus()) { %><% } --%> <% Set sortOptions = SortOption.getSortOptions(); if (sortOptions.size() > 1) // && bi.getBrowseLevel() > 0 { %> <% } %> "/> <% if (admin_button && !withdrawn && !privateitems) { %>" /><% } %>
<%-- give us the top report on what we are looking at --%>
<%-- do the top previous and next page links --%> <% if (bi.hasPrevPage()) { %>   <% } %> <% if (bi.hasNextPage()) { %>   <% } %>
<%-- output the results using the browselist tag --%> <% if (bix.isMetadataIndex()) { %> <% } else if (withdrawn || privateitems) { %> <% } else { %> <% } %> <%-- give us the bottom report on what we are looking at --%>
<%-- dump the results for debug (uncomment to enable) --%> <%-- --%>