<%-- - edit-item-form.jsp - - Version: $Revision$ - - Date: $Date$ - - Copyright (c) 2002, Hewlett-Packard Company and Massachusetts - Institute of Technology. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Hewlett-Packard Company nor the name of the - Massachusetts Institute of Technology nor the names of their - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. --%> <%-- - Show form allowing edit of collection metadata - - Attributes: - item - item to edit - collections - collections the item is in, if any - handle - item's Handle, if any (String) - dc.types - DCType[] - all DC types in the registry --%> <%@ 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="java.util.Date" %> <%@ page import="java.util.HashMap" %> <%@ page import="java.util.Map" %> <%@ page import="org.dspace.administer.DCType" %> <%@ page import="org.dspace.app.webui.servlet.admin.AuthorizeAdminServlet" %> <%@ page import="org.dspace.app.webui.servlet.admin.EditItemServlet" %> <%@ page import="org.dspace.content.Bitstream" %> <%@ page import="org.dspace.content.BitstreamFormat" %> <%@ page import="org.dspace.content.Bundle" %> <%@ page import="org.dspace.content.Collection" %> <%@ page import="org.dspace.content.DCDate" %> <%@ page import="org.dspace.content.DCValue" %> <%@ page import="org.dspace.content.Item" %> <%@ page import="org.dspace.core.ConfigurationManager" %> <% Item item = (Item) request.getAttribute("item"); String handle = (String) request.getAttribute("handle"); Collection[] collections = (Collection[]) request.getAttribute("collections"); DCType[] dcTypes = (DCType[]) request.getAttribute("dc.types"); %> <%--

Edit Item

--%>

<%--

PLEASE NOTE: These changes are not validated in any way. You are responsible for entering the data in the correct format. If you are not sure what the format is, please do NOT make changes.

--%>

<%--

More help...

--%>

<%-- --%> <%-- --%> <%-- --%> <%-- --%> <%-- --%> <%-- =========================================================== Edit item's policies =========================================================== --%> <%-- --%>
Item internal ID: <%= item.getID() %> <% if (!item.isWithdrawn()) { %>
<%-- --%> "/>
<% } else { %>
<%-- --%> "/>
<% } %>
<%-- --%> "/>
Handle: <%= (handle == null ? "None" : handle) %>
Last modified:
In Collections: <% for (int i = 0; i < collections.length; i++) { %> <%= collections[i].getMetadata("name") %>
<% } %>
Item page: <% if (handle == null) { %> <% } else { String url = ConfigurationManager.getProperty("dspace.url") + "/handle/" + handle; %> <%= url %> <% } %>
Item's Authorizations:
" /> <%-- --%> "/>
<% if (item.isWithdrawn()) { %> <%--

This item was withdrawn from DSpace

--%>

<% } %>

 

<%-- --%> <% DCValue[] dcv = item.getDC(Item.ANY, Item.ANY, Item.ANY); String row = "even"; // Keep a count of the number of values of each element+qualifier // key is "element" or "element_qualifier" (String) // values are Integers - number of values that element/qualifier so far Map dcCounter = new HashMap(); for (int i = 0; i < dcv.length; i++) { // Find out how many values with this element/qualifier we've found String key = dcv[i].element + (dcv[i].qualifier == null ? "" : "_" + dcv[i].qualifier); Integer count = (Integer) dcCounter.get(key); if (count == null) { count = new Integer(0); } // Increment counter in map dcCounter.put(key, new Integer(count.intValue() + 1)); // We will use two digits to represent the counter number in the parameter names. // This means a string sort can be used to put things in the correct order even // if there are >= 10 values for a particular element/qualifier. Increase this to // 3 digits if there are ever >= 100 for a single element/qualifer! :) String sequenceNumber = count.toString(); while (sequenceNumber.length() < 2) { sequenceNumber = "0" + sequenceNumber; } %> <% row = (row.equals("odd") ? "even" : "odd"); } %>
Element Qualifier Value Language  
<%= dcv[i].element %>   <%= (dcv[i].qualifier == null ? "" : dcv[i].qualifier) %> " size="5"/> <%-- --%> "/>
 
<%-- --%> "/>

 

<%--

Bitstreams

--%>

<%--

Note: Changes to the bitstreams will not be automatically reflected in the Dublin Core metadata above (e.g. format.extent, format.mimetype). You will need to update this by hand.

--%>

<%--

Also note that if the "user format description" field isn't empty, the format will always be set to "Unknown", so clear the user format description before changing the format field.

--%>

<%-- --%> <% Bundle[] bundles = item.getBundles(); row = "even"; for (int i = 0; i < bundles.length; i++) { Bitstream[] bitstreams = bundles[i].getBitstreams(); for (int j = 0; j < bitstreams.length; j++) { // Parameter names will include the bundle and bitstream ID // e.g. "bitstream_14_18_desc" is the description of bitstream 18 in bundle 14 String key = bundles[i].getID() + "_" + bitstreams[j].getID(); BitstreamFormat bf = bitstreams[j].getFormat(); %> <% if (bundles[i].getName().equals("ORIGINAL")) { %> <% } else { %> <% } %> <% row = (row.equals("odd") ? "even" : "odd"); } } %>
Primary
Bitstream
Name Source Description Format User Format Description  
checked="<%="checked" %>" <% } %> /> "/> "/> "/> (<%= bf.getShortDescription() %>) "/> <%-- View  --%>  " />
<%--

--%>

"/>

 

<%-- --%> " /> <%-- --%> " />