<%-- 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/ --%> <%-- - Community home JSP - - Attributes required: - community - Community to render home page for - collections - array of Collections in this community - subcommunities - array of Sub-communities in this community - last.submitted.titles - String[] of titles of recently submitted items - last.submitted.urls - String[] of URLs of recently submitted items - admin_button - Boolean, show admin 'edit' button --%> <%@page import="org.dspace.content.service.CollectionService"%> <%@page import="org.dspace.content.factory.ContentServiceFactory"%> <%@page import="org.dspace.content.service.CommunityService"%> <%@ 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.ItemCounter" %> <%@ page import="org.dspace.content.*" %> <%@ page import="org.dspace.core.Utils" %> <%@ page import="org.dspace.services.ConfigurationService" %> <%@ page import="org.dspace.services.factory.DSpaceServicesFactory" %> <%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %> <% // Retrieve attributes Community community = (Community) request.getAttribute( "community" ); List collections = (List) request.getAttribute("collections"); List subcommunities = (List) request.getAttribute("subcommunities"); RecentSubmissions rs = (RecentSubmissions) request.getAttribute("recently.submitted"); Boolean editor_b = (Boolean)request.getAttribute("editor_button"); boolean editor_button = (editor_b == null ? false : editor_b.booleanValue()); Boolean add_b = (Boolean)request.getAttribute("add_button"); boolean add_button = (add_b == null ? false : add_b.booleanValue()); Boolean remove_b = (Boolean)request.getAttribute("remove_button"); boolean remove_button = (remove_b == null ? false : remove_b.booleanValue()); // get the browse indices BrowseIndex[] bis = BrowseIndex.getBrowseIndices(); CommunityService comServ = ContentServiceFactory.getInstance().getCommunityService(); CollectionService colServ = ContentServiceFactory.getInstance().getCollectionService(); // Put the metadata values into guaranteed non-null variables String name = comServ.getMetadata(community, "name"); String intro = comServ.getMetadata(community, "introductory_text"); String copyright = comServ.getMetadata(community, "copyright_text"); String sidebar = comServ.getMetadata(community, "side_bar_text"); Bitstream logo = community.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 = "comm:" + allFormats; } ItemCounter ic = new ItemCounter(UIUtil.obtainContext(request)); %> <%@page import="org.dspace.app.webui.servlet.MyDSpaceServlet"%>

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

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

<%= copyright %>

<% if (rs != null && rs.count() > 0) { %>
<% } %>
<%-- Browse --%>
<%-- Insert the dynamic list of browse options --%> <% for (int i = 0; i < bis.length; i++) { String key = "browse.menu." + bis[i].getName(); %>
<%-- --%> "/>"/>
<% } %>
<%@ include file="discovery/static-tagcloud-facet.jsp" %>
<% boolean showLogos = configurationService.getBooleanProperty("jspui.community-home.logos", true); if (subcommunities.size() != 0) { %>

<% for (int j = 0; j < subcommunities.size(); j++) { %>
<% Bitstream logoCom = subcommunities.get(j).getLogo(); if (showLogos && logoCom != null) { %>
Logo
<% } else { %>
<% } %>

<%= subcommunities.get(j).getName() %> <% if (configurationService.getBooleanProperty("webui.strengths.show")) { %> [<%= ic.getCount(subcommunities.get(j)) %>] <% } %> <% if (remove_button) { %>
<% } %>

<%= comServ.getMetadata(subcommunities.get(j), "short_description") %>

<% } %>
<% } %> <% if (collections.size() != 0) { %>
<%--

Collections in this community

--%>

<% for (int i = 0; i < collections.size(); i++) { %>
<% Bitstream logoCol = collections.get(i).getLogo(); if (showLogos && logoCol != null) { %>
Logo
<% } else { %>
<% } %>

<%= collections.get(i).getName() %> <% if(configurationService.getBooleanProperty("webui.strengths.show")) { %> [<%= ic.getCount(collections.get(i)) %>] <% } %> <% if (remove_button) { %>
<% } %>

<%= colServ.getMetadata(collections.get(i), "short_description") %>

<% } %>
<% } %>
<% if(editor_button || add_button) // edit button(s) { %>
">
<% if(editor_button) { %>
<%----%> " />
<% } %> <% if(add_button) { %>
" />
<%----%> " />
<% } %> <% if( editor_button ) { %>
" />
" />
" />
<% } %>
<% } %> <%= sidebar %> <% int discovery_panel_cols = 12; int discovery_facet_cols = 12; %> <%@ include file="discovery/static-sidebar-facet.jsp" %>