mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
DS-1627 Ability to turn off TopCommunities list in site home page
This commit is contained in:
@@ -0,0 +1,58 @@
|
|||||||
|
/**
|
||||||
|
* 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/
|
||||||
|
*/
|
||||||
|
package org.dspace.app.webui.components;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.dspace.authorize.AuthorizeException;
|
||||||
|
import org.dspace.content.Community;
|
||||||
|
import org.dspace.core.Context;
|
||||||
|
import org.dspace.plugin.PluginException;
|
||||||
|
import org.dspace.plugin.SiteHomeProcessor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class add top communities object to the request attributes to use in
|
||||||
|
* the site home page implementing the SiteHomeProcessor.
|
||||||
|
*
|
||||||
|
* @author Andrea Bollini
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class TopCommunitiesSiteProcessor implements SiteHomeProcessor
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* blank constructor - does nothing.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public TopCommunitiesSiteProcessor()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void process(Context context, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) throws PluginException,
|
||||||
|
AuthorizeException
|
||||||
|
{
|
||||||
|
// Get the top communities to shows in the community list
|
||||||
|
Community[] communities;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
communities = Community.findAllTop(context);
|
||||||
|
}
|
||||||
|
catch (SQLException e)
|
||||||
|
{
|
||||||
|
throw new PluginException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
request.setAttribute("communities", communities);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -66,10 +66,6 @@
|
|||||||
throw new ServletException(e);
|
throw new ServletException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Home page shows community list
|
|
||||||
Community[] communities = Community.findAllTop(context);
|
|
||||||
request.setAttribute("communities", communities);
|
|
||||||
|
|
||||||
// Show home page JSP
|
// Show home page JSP
|
||||||
JSPManager.showJSP(request, response, "/home.jsp");
|
JSPManager.showJSP(request, response, "/home.jsp");
|
||||||
}
|
}
|
||||||
|
@@ -1160,6 +1160,7 @@ plugin.sequence.org.dspace.plugin.CollectionHomeProcessor = \
|
|||||||
# org.dspace.app.webui.components.RecentCollectionSubmissions,\
|
# org.dspace.app.webui.components.RecentCollectionSubmissions,\
|
||||||
|
|
||||||
plugin.sequence.org.dspace.plugin.SiteHomeProcessor = \
|
plugin.sequence.org.dspace.plugin.SiteHomeProcessor = \
|
||||||
|
org.dspace.app.webui.components.TopCommunitiesSiteProcessor,\
|
||||||
org.dspace.app.webui.components.RecentSiteSubmissions,\
|
org.dspace.app.webui.components.RecentSiteSubmissions,\
|
||||||
org.dspace.app.webui.discovery.SideBarFacetProcessor
|
org.dspace.app.webui.discovery.SideBarFacetProcessor
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user