<%-- 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 collection metadata - - Attributes: - community - community to create new collection in, if creating one - collection - collection to edit, if editing an existing one. If this - is null, we are creating one. --%> <%@ page contentType="text/html;charset=UTF-8" %> <%@ page import="org.dspace.app.webui.servlet.admin.EditCommunitiesServlet" %> <%@ page import="org.dspace.content.Bitstream" %> <%@ page import="org.dspace.content.Collection" %> <%@ page import="org.dspace.content.Community" %> <%@ page import="org.dspace.content.Item" %> <%@ page import="org.dspace.core.Utils" %> <%@ page import="org.dspace.eperson.Group" %> <%@ page import="org.dspace.harvest.HarvestedCollection" %> <%@ page import="org.dspace.core.ConfigurationManager" %> <%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %> <%@ page import="java.util.Enumeration" %> <%@ page import="org.dspace.content.service.CollectionService" %> <%@ page import="org.dspace.content.factory.ContentServiceFactory" %> <%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <% Collection collection = (Collection) request.getAttribute("collection"); Community community = (Community) request.getAttribute("community"); Boolean adminCollection = (Boolean)request.getAttribute("admin_collection"); boolean bAdminCollection = (adminCollection == null ? false : adminCollection.booleanValue()); 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 workflowsButton = (Boolean)request.getAttribute("workflows_button"); boolean bWorkflowsButton = (workflowsButton == null ? false : workflowsButton.booleanValue()); Boolean submittersButton = (Boolean)request.getAttribute("submitters_button"); boolean bSubmittersButton = (submittersButton == null ? false : submittersButton.booleanValue()); Boolean templateButton = (Boolean)request.getAttribute("template_button"); boolean bTemplateButton = (templateButton == null ? false : templateButton.booleanValue()); Boolean policyButton = (Boolean)request.getAttribute("policy_button"); boolean bPolicyButton = (policyButton == null ? false : policyButton.booleanValue()); Boolean deleteButton = (Boolean)request.getAttribute("delete_button"); boolean bDeleteButton = (deleteButton == null ? false : deleteButton.booleanValue()); // 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"; } HarvestedCollection hc = (HarvestedCollection) request.getAttribute("harvestInstance"); String name = ""; String shortDesc = ""; String intro = ""; String copy = ""; String side = ""; String license = ""; String provenance = ""; String oaiProviderValue= ""; String oaiSetIdValue= ""; String metadataFormatValue= ""; String lastHarvestMsg= ""; int harvestLevelValue=0; int harvestStatus= 0; Group[] wfGroups = new Group[3]; wfGroups[0] = null; wfGroups[1] = null; wfGroups[2] = null; Group admins = null; Group submitters = null; Item template = null; Bitstream logo = null; CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService(); if (collection != null) { name = collectionService.getMetadata(collection, "name"); shortDesc = collectionService.getMetadata(collection, "short_description"); intro = collectionService.getMetadata(collection, "introductory_text"); copy = collectionService.getMetadata(collection, "copyright_text"); side = collectionService.getMetadata(collection, "side_bar_text"); provenance = collectionService.getMetadata(collection, "provenance_description"); if (collectionService.hasCustomLicense(collection)) { license = collectionService.getLicense(collection); } wfGroups[0] = collection.getWorkflowStep1(); wfGroups[1] = collection.getWorkflowStep2(); wfGroups[2] = collection.getWorkflowStep3(); admins = collection.getAdministrators(); submitters = collection.getSubmitters(); template = collection.getTemplateItem(); logo = collection.getLogo(); /* Harvesting stuff */ if (hc != null) { oaiProviderValue = hc.getOaiSource(); oaiSetIdValue = hc.getOaiSetId(); metadataFormatValue = hc.getHarvestMetadataConfig(); harvestLevelValue = hc.getHarvestType(); lastHarvestMsg= hc.getHarvestMessage(); harvestStatus = hc.getHarvestStatus(); } } %>

<% if (collection == null) { %> <% } else { %> <%= collection.getHandle() %> <% } %>

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







<%-- =========================================================== Logo =========================================================== --%>
<% if (logo != null) { %> collection logo " /> " /> <% } else { %> " /> <% } %>
<% if(bSubmittersButton || bWorkflowsButton || bAdminCreateGroup || (admins != null && bAdminRemoveGroup)) { %>
<% } if(bSubmittersButton) { %> <%-- =========================================================== Collection Submitters =========================================================== --%>
<% if (submitters == null) {%> " /> <% } else { %> " /> " /> <% } %>

<% } %> <% if(bWorkflowsButton) { %> <%-- =========================================================== Workflow groups =========================================================== --%> <% String[] roleTexts = { LocaleSupport.getLocalizedMessage(pageContext, "jsp.tools.edit-collection.wf-role1"), LocaleSupport.getLocalizedMessage(pageContext, "jsp.tools.edit-collection.wf-role2"), LocaleSupport.getLocalizedMessage(pageContext, "jsp.tools.edit-collection.wf-role3") }; for (int i = 0; i<3; i++) { %>
<% if (wfGroups[i] == null) { %> " /> <% } else { %> " /> " /> <% } %>

<% } %> <% } %> <% if(bAdminCreateGroup || (admins != null && bAdminRemoveGroup)) { %> <%-- =========================================================== Collection Administrators =========================================================== --%>
<% if (admins == null) { if (bAdminCreateGroup) { %> " /> <% } } else { if (bAdminCreateGroup) { %> " /> <% } if (bAdminRemoveGroup) { %> " /> <% } } %>
<% } %>
<% if(bTemplateButton) { %>
<%-- =========================================================== Item template =========================================================== --%> <% if (template == null) {%> " /> <% } else { %> " /> " /> <% } %>

<% } %> <% if(bPolicyButton) { %> <%-- =========================================================== Edit collection's policies =========================================================== --%>
" />

<% } %> <% if(bAdminCollection) { %> <%-- =========================================================== Curate collection =========================================================== --%>
" />
<% } %>
<% if(bAdminCollection) { %> <%-- =========================================================== Harvesting Settings =========================================================== --%>
<%-- oaiProviderValue = hc.getOaiSource(); oaiSetIdValue = hc.getOaiSetId(); metadataFormatValue = hc.getHarvestMetadataConfig(); harvestLevelValue = hc.getHarvestType(); String lastHarvestMsg= hc.getHarvestMessage(); int harvestStatus = hc.getHarvestStatus(); if (lastHarvestMsg == null) lastHarvestMsg = "none"; --%>
checked="checked" <% } %> name="source" /> 0) { %> checked="checked" <% } %> name="source" />




checked="checked" <% } %> name="harvest_level" />
checked="checked" <% } %> name="harvest_level" />
checked="checked" <% } %> name="harvest_level" />

<%= lastHarvestMsg %>
<% } %>
<% if (collection == null) { %> " /> <% } else { %> " /> <% } %> " />