<%-- 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/ --%> <%-- - Show form allowing edit of community metadata - - Attributes: - community - community to edit, if editing an existing one. If this - is null, we are creating one. --%> <%@page import="org.dspace.content.factory.ContentServiceFactory"%> <%@page import="org.dspace.content.service.CommunityService"%> <%@ page contentType="text/html;charset=UTF-8" %> <%@ page import="java.util.UUID" %> <%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %> <%@ page import="org.dspace.app.webui.servlet.admin.EditCommunitiesServlet" %> <%@ page import="org.dspace.content.Bitstream" %> <%@ page import="org.dspace.content.Community" %> <%@ page import="org.dspace.eperson.Group" %> <%@ page import="org.dspace.app.webui.util.UIUtil" %> <%@ page import="org.dspace.core.Utils" %> <%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <% CommunityService comServ = ContentServiceFactory.getInstance().getCommunityService(); Community community = (Community) request.getAttribute("community"); Community parentCommunity = (Community) request.getAttribute("parent"); UUID parentID = (parentCommunity != null ? parentCommunity.getID() : null); // 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()); String naviAdmin = "admin"; String link = "/dspace-admin"; if(!isAdmin && (isCommunityAdmin || isCollectionAdmin)) { naviAdmin = "community-or-collection-admin"; link = "/tools"; } Boolean adminCreateGroup = (Boolean)request.getAttribute("admin_create_button"); boolean bAdminCreateGroup = (adminCreateGroup == null ? false : adminCreateGroup.booleanValue()); Boolean adminRemoveGroup = (Boolean)request.getAttribute("admin_remove_button"); boolean bAdminRemoveGroup = (adminRemoveGroup == null ? false : adminRemoveGroup.booleanValue()); Boolean policy = (Boolean)request.getAttribute("policy_button"); boolean bPolicy = (policy == null ? false : policy.booleanValue()); Boolean delete = (Boolean)request.getAttribute("delete_button"); boolean bDelete = (delete == null ? false : delete.booleanValue()); Boolean adminCommunity = (Boolean)request.getAttribute("admin_community"); boolean bAdminCommunity = (adminCommunity == null ? false : adminCommunity.booleanValue()); String name = ""; String shortDesc = ""; String intro = ""; String copy = ""; String side = ""; Group admins = null; Bitstream logo = null; if (community != null) { name = comServ.getMetadata(community, "name"); shortDesc = comServ.getMetadata(community, "short_description"); intro = comServ.getMetadata(community, "introductory_text"); copy = comServ.getMetadata(community, "copyright_text"); side = comServ.getMetadata(community, "side_bar_text"); logo = community.getLogo(); admins = community.getAdministrators(); } %>
<% if (community == null) { %>

">

<% } else { %>

<%= community.getHandle() %> ">

<% if(bDelete) { %>
" />
<% } %> <% } %>
">
<%-- =========================================================== Basic metadata =========================================================== --%>





<%-- =========================================================== Logo =========================================================== --%>
<% if (logo != null) { %> logo " /> " /> <% } else { %> " /> <% } %>
<% if (community != null) { %>
<% if(bAdminCreateGroup || (admins != null && bAdminRemoveGroup)) { %> <%-- =========================================================== Community Administrators =========================================================== --%>
<% if (admins == null) { if (bAdminCreateGroup) { %> " /> <% } } else { if (bAdminCreateGroup) { %> " /> <% } if (bAdminRemoveGroup) { %> " /> <% } } %>
<% } if (bPolicy) { %> <%-- =========================================================== Edit community's policies =========================================================== --%>
" />
<% } if (bAdminCommunity) { %> <%-- =========================================================== Curate Community =========================================================== --%>
" />
<% } %>
<% } %>
<% if (community == null) { %> " /> " /> <% } else { %> " /> " /> <% } %>