<%-- 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 an item browse - - Attributes to pass in: - - items - sorted Map of mapped Items to display - collection - Collection we're mapping into - collections - Map of Collections mapped into this one, keyed by collection_id - browsetext - text to display at the top (name of collection we are mapping from) - browsetype - "Add" or "Remove" --%> <%@page import="org.dspace.app.webui.util.UIUtil"%> <%@ page contentType="text/html;charset=UTF-8" %> <%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ page import="java.net.URLEncoder" %> <%@ page import="java.util.Iterator" %> <%@ page import="java.util.Map" %> <%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %> <%@ page import="org.dspace.content.Collection" %> <%@ page import="org.dspace.content.Item" %> <%@ page import="org.dspace.content.MetadataValue" %> <%@ page import="org.dspace.content.service.ItemService" %> <%@ page import="org.dspace.content.factory.ContentServiceFactory" %> <%@ page import="java.util.List" %> <% Collection collection = (Collection)request.getAttribute("collection"); Map items = (Map)request.getAttribute("items"); Map collections = (Map)request.getAttribute("collections"); String index = request.getParameter("index"); String query = request.getParameter("query"); String browsetext = (String)request.getAttribute("browsetext"); Boolean showcollection = new Boolean(false); String browsetype = (String)request.getAttribute("browsetype"); // Only "Add" and "Remove" are handled properly Boolean more = (Boolean) request.getAttribute("more"); boolean bMore = more != null?more:false; int pageResult = (Integer) request.getAttribute("page") != null ? (Integer) request .getAttribute("page") : 1; %> <%--

Browse <%=browsetext%>

--%>

<% if (browsetype.equals("Add")) { %> <%= browsetext %> <% } else if (browsetype.equals("Remove")) { %> <%= browsetext %> <%= collection.getName() %> <% } %>

<%--

Check the box next to items you wish to add or remove, and choose 'add' or 'remove'.

--%> <% if (browsetype.equals("Add")){ %>

<%= collection.getName() %>

<% }%> <% if (browsetype.equals("Remove")){ %>

<%= collection.getName() %>

<% } %> <%-- %>p>
<% if (browsetype.equals("Add")) { %> " /> <% } else if (browsetype.equals("Remove")) { %> " /> <% } %> " />
<% if(showcollection.booleanValue()) { %> <% } else { %> <% } %> <% String row = "even"; Iterator i = items.keySet().iterator(); ItemService itemService = ContentServiceFactory.getInstance().getItemService(); while( i.hasNext() ) { Item item = (Item)items.get(i.next()); // get the metadata or placeholders to display for date, contributor and title String date = LocaleSupport.getLocalizedMessage(pageContext, "jsp.general.without-date"); List dates = itemService.getMetadata(item, "dc", "date", "issued", Item.ANY); if (dates.size() >= 1) { date = dates.get(0).getValue(); } else { // do nothing the date is already set to "without date" } String contributor = LocaleSupport.getLocalizedMessage(pageContext, "jsp.general.without-contributor"); List contributors = itemService.getMetadata(item, "dc", "contributor", Item.ANY, Item.ANY); if (contributors.size() >= 1) { contributor = contributors.get(0).getValue(); } else { // do nothing the contributor is already set to anonymous } String title = LocaleSupport.getLocalizedMessage(pageContext, "jsp.general.untitled"); List titles = itemService.getMetadata(item, "dc", "title", null, Item.ANY); if (titles.size() >= 1) { title = titles.get(0).getValue(); } else { // do nothing the title is already set to untitled } %> <% if( showcollection.booleanValue() ) { %> <%-- not currently implemented --%> <% } else { %> <% } row = (row.equals("odd") ? "even" : "odd"); %> <% } %>
<% if (browsetype.equals("Add")) { %> " /> <% } else if (browsetype.equals("Remove")) { %> " /> <% } %>
<%= date %> <%= contributor %> <%= title %> <%= collection.getID() %> <%= title %>
<% if (browsetype.equals("Add")) { %> " /> <% } else if (browsetype.equals("Remove")) { %> " /> <% } %> " />
<% if (bMore || pageResult > 1) { %>

<% if (pageResult > 1) { %>
"/>
<% } if (bMore) { %>
"/>
<% } %>
<% } %>