<%-- 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/ --%> <%-- - Collection home JSP - - Attributes required: - collection - Collection to render home page for - community - Community this collection is in - last.submitted.titles - String[], titles of recent submissions - last.submitted.urls - String[], corresponding URLs - logged.in - Boolean, true if a user is logged in - subscribed - Boolean, true if user is subscribed to this collection - admin_button - Boolean, show admin 'edit' button - editor_button - Boolean, show collection editor (edit submitters, item mapping) buttons - show.items - Boolean, show item list - browse.info - BrowseInfo, item 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.apache.commons.lang.StringUtils" %> <%@ page import="org.dspace.app.webui.components.RecentSubmissions" %> <%@ page import="org.dspace.app.webui.servlet.admin.EditCommunitiesServlet" %> <%@ page import="org.dspace.app.webui.util.UIUtil" %> <%@ page import="org.dspace.browse.BrowseIndex" %> <%@ page import="org.dspace.browse.BrowseInfo" %> <%@ page import="org.dspace.browse.ItemCounter"%> <%@ page import="org.dspace.content.*"%> <%@ page import="org.dspace.core.Utils" %> <%@ page import="org.dspace.eperson.Group" %> <%@ page import="org.dspace.services.ConfigurationService" %> <%@ page import="org.dspace.services.factory.DSpaceServicesFactory" %> <%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %> <% // Retrieve attributes Collection collection = (Collection) request.getAttribute("collection"); Community community = (Community) request.getAttribute("community"); Group submitters = (Group) request.getAttribute("submitters"); RecentSubmissions rs = (RecentSubmissions) request.getAttribute("recently.submitted"); boolean loggedIn = ((Boolean) request.getAttribute("logged.in")).booleanValue(); boolean subscribed = ((Boolean) request.getAttribute("subscribed")).booleanValue(); Boolean admin_b = (Boolean)request.getAttribute("admin_button"); boolean admin_button = (admin_b == null ? false : admin_b.booleanValue()); Boolean editor_b = (Boolean)request.getAttribute("editor_button"); boolean editor_button = (editor_b == null ? false : editor_b.booleanValue()); Boolean submit_b = (Boolean)request.getAttribute("can_submit_button"); boolean submit_button = (submit_b == null ? false : submit_b.booleanValue()); // get the browse indices BrowseIndex[] bis = BrowseIndex.getBrowseIndices(); CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService(); // Put the metadata values into guaranteed non-null variables String name = collectionService.getMetadata(collection, "name"); String intro = collectionService.getMetadata(collection, "introductory_text"); if (intro == null) { intro = ""; } String copyright = collectionService.getMetadata(collection, "copyright_text"); if (copyright == null) { copyright = ""; } String sidebar = collectionService.getMetadata(collection, "side_bar_text"); if(sidebar == null) { sidebar = ""; } String communityName = collectionService.getMetadata(collection, "name"); String communityLink = "/handle/" + community.getHandle(); Bitstream logo = collection.getLogo(); ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); boolean feedEnabled = configurationService.getBooleanProperty("webui.feed.enable"); String feedData = "NONE"; if (feedEnabled) { // FeedData is expected to be a comma separated list String[] formats = configurationService.getArrayProperty("webui.feed.formats"); String allFormats = StringUtils.join(formats, ","); feedData = "coll:" + allFormats; } ItemCounter ic = new ItemCounter(UIUtil.obtainContext(request)); Boolean showItems = (Boolean)request.getAttribute("show.items"); boolean show_items = showItems != null ? showItems.booleanValue() : false; %> <%@page import="org.dspace.app.webui.servlet.MyDSpaceServlet"%> <%@ page import="org.dspace.content.factory.ContentServiceFactory" %> <%@ page import="org.dspace.content.service.CollectionService" %> <%@ page import="org.dspace.content.service.ItemService" %>

<%= name %> <% if(configurationService.getBooleanProperty("webui.strengths.show")) { %> : [<%= ic.getCount(collection) %>] <% } %>

<% if (logo != null) { %>
Logo
<% } %>
<% if (StringUtils.isNotBlank(intro)) { %> <%= intro %> <% } %>

<%= copyright %>

<%-- Browse --%>
<%-- Insert the dynamic list of browse options --%> <% for (int i = 0; i < bis.length; i++) { String key = "browse.menu." + bis[i].getName(); %>
<%-- --%> "/>"/>
<% } %>
<% if (submit_button) { %>
" />
<% } %>
<% if (loggedIn && subscribed) { %> " /> <% } else { %> " /> <% } if(feedEnabled) { %> <% String[] fmts = feedData.substring(5).split(","); String icon = null; int width = 0; for (int j = 0; j < fmts.length; j++) { if ("rss_1.0".equals(fmts[j])) { icon = "rss1.gif"; width = 80; } else if ("rss_2.0".equals(fmts[j])) { icon = "rss2.gif"; width = 80; } else { icon = "rss.gif"; width = 36; } %> RSS Feed <% } %> <% } %>
<%@ include file="discovery/static-tagcloud-facet.jsp" %>
<% if (show_items) { BrowseInfo bi = (BrowseInfo) request.getAttribute("browse.info"); BrowseIndex bix = bi.getBrowseIndex(); // prepare the next and previous links String linkBase = request.getContextPath() + "/handle/" + collection.getHandle(); String next = linkBase; String prev = linkBase; if (bi.hasNextPage()) { next = next + "?offset=" + bi.getNextOffset(); } if (bi.hasPrevPage()) { prev = prev + "?offset=" + bi.getPrevOffset(); } String bi_name_key = "browse.menu." + bi.getSortOption().getName(); String so_name_key = "browse.order." + (bi.isAscending() ? "asc" : "desc"); %> <%-- give us the top report on what we are looking at --%>
<%-- do the top previous and next page links --%> <%-- output the results using the browselist tag --%> <% if (bix.isMetadataIndex()) { %> <% } else { %> <% } %> <%-- give us the bottom report on what we are looking at --%>
<%-- do the bottom previous and next page links --%> <% } // end of if (show_title) %> <% if(admin_button || editor_button ) { %>
">
<% if( editor_button ) { %>
" />
<% } %> <% if( admin_button ) { %>
" />
<% if(submitters != null) { %>
" />
<% } %> <% if( editor_button || admin_button) { %>
" />
" />
" />
<% } %> <% } %> <% } %> <% if (rs != null && rs.count() > 0) { %>

<% ItemService itemService = ContentServiceFactory.getInstance().getItemService(); List items = rs.getRecentSubmissions(); for (int i = 0; i < items.size(); i++) { List dcv = itemService.getMetadata(items.get(i), "dc", "title", null, Item.ANY); String displayTitle = "Untitled"; if (dcv != null) { if (dcv.size() > 0) { displayTitle = Utils.addEntities(dcv.get(0).getValue()); } } %>

<%= displayTitle %>

<% } %>

 

<% } %> <%= sidebar %> <% int discovery_panel_cols = 12; int discovery_facet_cols = 12; %> <%@ include file="discovery/static-sidebar-facet.jsp" %>