<%-- 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/ --%> <%@page import="org.apache.commons.lang.time.DateFormatUtils"%> <%-- - policy editor - for new or existing policies - - Attributes: - policy - a ResourcePolicy to be edited - groups - Group [] of groups to choose from - epeople - EPerson [] of epeople to choose from (unused in first version) - edit_title - title of the page ("Collection 13", etc. - id_name - name of string to put in hidden arg (collection_id, etc.) - id - ID of the object policy relates to (collection.getID(), etc.) - newpolicy - set to some string value if this is a new policy - Returns: - save_policy - user wants to save a policy - cancel_policy - user wants to cancel, and return to policy list - "id_name" - name/value passed in from id_name/id above - group_id - set if user selected a group - eperson_id - set if user selected an eperson - start_date - start date of a policy (e.g. for embargo feature) - end_date - end date of a policy - action_id - set to whatever user chose - (new policy) - set to a the string passed in above if policy is a new one --%> <%@ 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="javax.servlet.jsp.jstl.fmt.LocaleSupport" %> <%@ page import="org.dspace.authorize.ResourcePolicy" %> <%@ page import="org.dspace.content.Collection" %> <%@ page import="org.dspace.core.Constants" %> <%@ page import="org.dspace.eperson.EPerson" %> <%@ page import="org.dspace.eperson.Group" %> <%@ page import="java.util.List" %> <% ResourcePolicy policy = (ResourcePolicy) request.getAttribute("policy" ); List groups = (List) request.getAttribute("groups" ); List epeople = (List) request.getAttribute("epeople" ); String edit_title = (String ) request.getAttribute("edit_title"); String id_name = (String ) request.getAttribute("id_name" ); String id = (String ) request.getAttribute("id" ); String newpolicy = (String ) request.getAttribute("newpolicy" ); // calculate the resource type and its relevance ID // to check what actions to present int resourceType = policy.getdSpaceObject().getType(); int resourceRelevance = 1 << resourceType; request.setAttribute("LanguageSwitch", "hide"); // 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"; } %> <%--

Edit Policy for <%= edit_title %>:

--%>

<%= edit_title %> ">

<%-- Group: --%> <%-- Action: --%> <% // start and end dates are used for Items and Bitstreams only. if (resourceType == Constants.ITEM || resourceType == Constants.BITSTREAM) { %> " /> " /> <%} // if Item||Bitstream%>
<% if( newpolicy != null ) { %> <% } %>
<%-- --%> " /> <%-- --%> " />