diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/BulkEditChange.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/BulkEditChange.java index 15305932ba..9f51266740 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/BulkEditChange.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/BulkEditChange.java @@ -51,6 +51,15 @@ public class BulkEditChange /** Is this a new item */ private boolean newItem; + /** Has this item been deleted? */ + private boolean deleted; + + /** Has this item been withdrawn? */ + private boolean withdrawn; + + /** Has this item been reinstated? */ + private boolean reinstated; + /** Have any changes actually been made? */ private boolean empty; @@ -326,6 +335,66 @@ public class BulkEditChange return newItem; } + /** + * Does this change object represent a deleted item? + * + * @return Whether or not this is for a deleted item + */ + public boolean isDeleted() + { + // Return the new item status + return deleted; + } + + /** + * Set that this item has been deleted + */ + public void setDeleted() { + // Store the setting + deleted = true; + empty = false; + } + + /** + * Does this change object represent a withdrawn item? + * + * @return Whether or not this is for a withdrawn item + */ + public boolean isWithdrawn() + { + // Return the new item status + return withdrawn; + } + + /** + * Set that this item has been withdrawn + */ + public void setWithdrawn() { + // Store the setting + withdrawn = true; + empty = false; + } + + /** + * Does this change object represent a reinstated item? + * + * @return Whether or not this is for a reinstated item + */ + public boolean isReinstated() + { + // Return the new item status + return reinstated; + } + + /** + * Set that this item has been deleted + */ + public void setReinstated() { + // Store the setting + reinstated = true; + empty = false; + } + /** * Have any changes actually been recorded, or is this empty? * diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java index c9c04abf29..400e041f3c 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java @@ -114,6 +114,12 @@ public class DSpaceCSV implements Serializable // Store the heading headings.add(element); } + // Store the action + else if ("action".equals(element)) + { + // Store the heading + headings.add(element); + } else if (!"id".equals(element)) { // Verify that the heading is valid in the metadata registry @@ -248,6 +254,21 @@ public class DSpaceCSV implements Serializable } } + /** + * Decide if this CSV file has an 'action' (case-dependent!) header. + * + * @return Whether or not there is an 'action' header + */ + public boolean hasActions() { + // Look for a heading called 'action' + for (String header : headings) { + if (header.equals("action")) { + return true; + } + } + return false; + } + /** * Set the value separator for multiple values stored in one csv value. * @@ -575,12 +596,6 @@ public class DSpaceCSV implements Serializable */ private final boolean okToExport(DCValue md) { - // First check the metadata format, and K all non DC elements - if (!"dc".equals(md.schema)) - { - return true; - } - // Now compare with the list to ignore String key = md.schema + "." + md.element; if (md.qualifier != null) diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java index 666fa3f3ae..88329e69ad 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java @@ -7,6 +7,7 @@ */ package org.dspace.app.bulkedit; +import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -18,7 +19,7 @@ import java.util.Set; * * @author Stuart Lewis */ -public class DSpaceCSVLine +public class DSpaceCSVLine implements Serializable { /** The item id of the item represented by this line. -1 is for a new item */ private int id; @@ -92,6 +93,22 @@ public class DSpaceCSVLine return items.get(key); } + /** + * Get any action associated with this line + * + * @return The action (may be blank, 'withdraw', 'reinstate' or 'delete') + */ + public String getAction() + { + if (items.containsKey("action")) { + ArrayList actions = items.get("action"); + if (actions.size() > 0) { + return ((String)actions.get(0)).trim(); + } + } + return ""; + } + /** * Get all the metadata keys that are represented in this line * diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java index 0ff7e675bb..fb161db922 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java @@ -39,6 +39,9 @@ public class MetadataImport /** The Context */ Context c; + /** The DSpaceCSV object we're processing */ + DSpaceCSV csv; + /** The lines to import */ List toImport; @@ -53,11 +56,12 @@ public class MetadataImport * @param c The context * @param toImport An array of CSV lines to examine */ - public MetadataImport(Context c, List toImport) + public MetadataImport(Context c, DSpaceCSV toImport) { // Store the import settings this.c = c; - this.toImport = toImport; + csv = toImport; + this.toImport = toImport.getCSVLines(); } /** @@ -89,6 +93,12 @@ public class MetadataImport // Get the DSpace item to compare with int id = line.getID(); + // Is there an action column? + if (csv.hasActions() && (!"".equals(line.getAction())) && (id == -1)) + { + throw new MetadataImportException("'action' not allowed for new items!"); + } + // Is this a new item? if (id != -1) { @@ -98,6 +108,8 @@ public class MetadataImport { throw new MetadataImportException("Unknown item ID " + id); } + + // Record changes BulkEditChange whatHasChanged = new BulkEditChange(item); // Has it moved collection? @@ -127,6 +139,63 @@ public class MetadataImport } } + if (csv.hasActions()) + { + // Perform the action + String action = line.getAction(); + if ("".equals(action)) + { + // Do nothing + } + else if ("expunge".equals(action)) + { + // Does the configuration allow deletes? + if (!ConfigurationManager.getBooleanProperty("bulkedit.allowexpunge", false)) + { + throw new MetadataImportException("'expunge' action denied by configuration"); + } + + // Remove the item + Collection[] owners = item.getCollections(); + for (Collection owner : owners) + { + if (change) + { + owner.removeItem(item); + } + } + whatHasChanged.setDeleted(); + } + else if ("withdraw".equals(action)) + { + // Withdraw the item + if (!item.isWithdrawn()) + { + if (change) + { + item.withdraw(); + } + whatHasChanged.setWithdrawn(); + } + } + else if ("reinstate".equals(action)) + { + // Reinstate the item + if (item.isWithdrawn()) + { + if (change) + { + item.reinstate(); + } + whatHasChanged.setReinstated(); + } + } + else { + // Unknown action! + throw new MetadataImportException("Unknown action: " + action); + } + } + // Only record if changes have been made if (whatHasChanged.hasChanges()) { @@ -164,7 +233,7 @@ public class MetadataImport { throw new MetadataImportException("New items must have a 'collection' assigned in the form of a handle"); } - + // Check collections are really collections ArrayList check = new ArrayList(); Collection collection; @@ -204,7 +273,7 @@ public class MetadataImport Collection extra = (Collection)HandleManager.resolveToObject(c, handle); if (first) { - whatHasChanged.setOwningCollection(extra); + whatHasChanged.setOwningCollection(extra); } else { @@ -227,7 +296,7 @@ public class MetadataImport { item.addMetadata(dcv.schema, dcv.element, - dcv.qualifier, + dcv.qualifier, dcv.language, dcv.value); } @@ -253,7 +322,7 @@ public class MetadataImport // Install the item InstallItem.installItem(c, wsItem); } - + // Add to extra collections if (line.get("collection").size() > 0) { @@ -313,8 +382,8 @@ public class MetadataImport log.debug(LogManager.getHeader(c, "metadata_import", "item_id=" + item.getID() + ",fromCSV=" + all)); - // Don't compare collections - if ("collection".equals(md)) + // Don't compare collections or actions + if (("collection".equals(md)) || ("action".equals(md))) { return; } @@ -633,8 +702,8 @@ public class MetadataImport private void add(String[] fromCSV, String md, BulkEditChange changes) throws SQLException, AuthorizeException { - // Don't add owning collection - if ("collection".equals(md)) + // Don't add owning collection or action + if (("collection".equals(md)) || ("action".equals(md))) { return; } @@ -759,7 +828,8 @@ public class MetadataImport List oldCollections = change.getOldMappedCollections(); if ((adds.size() > 0) || (removes.size() > 0) || (newCollections.size() > 0) || (oldCollections.size() > 0) || - (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null)) + (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null) || + (change.isDeleted()) || (change.isWithdrawn()) || (change.isReinstated())) { // Show the item Item i = change.getItem(); @@ -788,6 +858,41 @@ public class MetadataImport changeCounter++; } + // Show actions + if (change.isDeleted()) + { + if (changed) + { + System.out.println(" - EXPUNGED!"); + } + else + { + System.out.println(" - EXPUNGE!"); + } + } + if (change.isWithdrawn()) + { + if (changed) + { + System.out.println(" - WITHDRAWN!"); + } + else + { + System.out.println(" - WITHDRAW!"); + } + } + if (change.isReinstated()) + { + if (changed) + { + System.out.println(" - REINSTATED!"); + } + else + { + System.out.println(" - REINSTATE!"); + } + } + if (change.getNewOwningCollection() != null) { Collection c = change.getNewOwningCollection(); @@ -846,7 +951,7 @@ public class MetadataImport String cName = c.getName(); if (!changed) { - System.out.print(" + Um-map from collection (" + cHandle + "): "); + System.out.print(" + Un-map from collection (" + cHandle + "): "); } else { @@ -1040,7 +1145,7 @@ public class MetadataImport } // Perform the first import - just highlight differences - MetadataImport importer = new MetadataImport(c, csv.getCSVLines()); + MetadataImport importer = new MetadataImport(c, csv); List changes; if (!line.hasOption('s')) @@ -1126,7 +1231,7 @@ public class MetadataImport catch (Exception e) { c.abort(); - System.err.println("Error commiting changes to database: " + e.getMessage()); + System.err.println("Error committing changes to database: " + e.getMessage()); System.err.println("Aborting most recent changes."); System.exit(1); } diff --git a/dspace-api/src/main/resources/Messages.properties b/dspace-api/src/main/resources/Messages.properties index 26936bf479..23c8145477 100644 --- a/dspace-api/src/main/resources/Messages.properties +++ b/dspace-api/src/main/resources/Messages.properties @@ -312,6 +312,12 @@ jsp.dspace-admin.metadataimport.add = Add jsp.dspace-admin.metadataimport.added = Added jsp.dspace-admin.metadataimport.remove = Remove jsp.dspace-admin.metadataimport.removed = Removed +jsp.dspace-admin.metadataimport.delete = Expunge Item +jsp.dspace-admin.metadataimport.deleted = Item Expunged +jsp.dspace-admin.metadataimport.withdraw = Withdraw Item +jsp.dspace-admin.metadataimport.withdrawn = Item Withdrawn +jsp.dspace-admin.metadataimport.reinstate = Reinstate Item +jsp.dspace-admin.metadataimport.reinstated = Item Reinstated jsp.dspace-admin.metadataimport.toomany = There are too many changes. Please import fewer changes, adjust the limit, or perform the input directly on the server. jsp.dspace-admin.metadataimport.finished = {0} changes completed successfully. jsp.dspace-admin.index.heading = Administration Tools diff --git a/dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/servlet/MetadataImportServlet.java b/dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/servlet/MetadataImportServlet.java index 19888b8d1e..e9033921ec 100644 --- a/dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/servlet/MetadataImportServlet.java +++ b/dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/servlet/MetadataImportServlet.java @@ -126,7 +126,7 @@ public class MetadataImportServlet extends DSpaceServlet // Make the changes try { - MetadataImport mImport = new MetadataImport(context, csv.getCSVLines()); + MetadataImport mImport = new MetadataImport(context, csv); List changes = mImport.runImport(true, false, false, false); // Commit the changes @@ -204,7 +204,7 @@ public class MetadataImportServlet extends DSpaceServlet // Run the import DSpaceCSV csv = new DSpaceCSV(f, context); - MetadataImport mImport = new MetadataImport(context, csv.getCSVLines()); + MetadataImport mImport = new MetadataImport(context, csv); List changes = mImport.runImport(false, false, false, false); // Store the csv lines in the session diff --git a/dspace-jspui/dspace-jspui-webapp/src/main/webapp/dspace-admin/metadataimport-showchanges.jsp b/dspace-jspui/dspace-jspui-webapp/src/main/webapp/dspace-admin/metadataimport-showchanges.jsp index 77925099a0..43a2c06dc5 100644 --- a/dspace-jspui/dspace-jspui-webapp/src/main/webapp/dspace-admin/metadataimport-showchanges.jsp +++ b/dspace-jspui/dspace-jspui-webapp/src/main/webapp/dspace-admin/metadataimport-showchanges.jsp @@ -79,7 +79,8 @@ boolean first = false; if ((adds.size() > 0) || (removes.size() > 0) || (newCollections.size() > 0) || (oldCollections.size() > 0) || - (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null)) + (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null) || + (change.isDeleted()) || (change.isWithdrawn()) || (change.isReinstated())) { // Show the item if (!change.isNewItem()) @@ -95,6 +96,65 @@ first = true; } + // Show actions + if (change.isDeleted()) + { + if (!first) + { + %><% + } + else + { + first = false; + } + if (!changed) + { + %><% + } + else + { + %><% + } + } + if (change.isWithdrawn()) + { + if (!first) + { + %><% + } + else + { + first = false; + } + if (!changed) + { + %><% + } + else + { + %><% + } + } + if (change.isReinstated()) + { + if (!first) + { + %><% + } + else + { + first = false; + } + if (!changed) + { + %><% + } + else + { + %><% + } + } + // Show new owner collection if (change.getNewOwningCollection() != null) { @@ -113,11 +173,11 @@ } if (!changed) { - %>(<%= cHandle %>): <%= cName %><% + %>(<%= cHandle %>): <%= cName %><% } else { - %>(<%= cHandle %>): <%= cName %><% + %>(<%= cHandle %>): <%= cName %><% } } } @@ -140,11 +200,11 @@ } if (!changed) { - %>(<%= cHandle %>): <%= cName %><% + %>(<%= cHandle %>): <%= cName %><% } else { - %>(<%= cHandle %>): <%= cName %><% + %>(<%= cHandle %>): <%= cName %><% } } } @@ -164,11 +224,11 @@ } if (!changed) { - %>(<%= cHandle %>): <%= cName %><% + %>(<%= cHandle %>): <%= cName %><% } else { - %>(<%= cHandle %>): <%= cName %><% + %>(<%= cHandle %>): <%= cName %><% } } @@ -187,11 +247,11 @@ } if (!changed) { - %>(<%= cHandle %>): <%= cName %><% + %>(<%= cHandle %>): <%= cName %><% } else { - %>(<%= cHandle %>): <%= cName %><% + %>(<%= cHandle %>): <%= cName %><% } } @@ -217,11 +277,11 @@ } if (!changed) { - %> (<%= md %>)<%= dcv.value %><% + %> (<%= md %>)<%= dcv.value %><% } else { - %> (<%= md %>)<%= dcv.value %><% + %> (<%= md %>)<%= dcv.value %><% } } @@ -247,11 +307,11 @@ } if (!changed) { - %> (<%= md %>)<%= dcv.value %><% + %> (<%= md %>)<%= dcv.value %><% } else { - %> (<%= md %>)<%= dcv.value %><% + %> (<%= md %>)<%= dcv.value %><% } } } diff --git a/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowMetadataImportUtils.java b/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowMetadataImportUtils.java index f2acdb5d11..a6919c62cc 100644 --- a/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowMetadataImportUtils.java +++ b/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowMetadataImportUtils.java @@ -64,7 +64,7 @@ public class FlowMetadataImportUtils try { // Run the import - MetadataImport mImport = new MetadataImport(context, csv.getCSVLines()); + MetadataImport mImport = new MetadataImport(context, csv); List changes = mImport.runImport(true, false, false, false); // Commit the changes @@ -149,7 +149,7 @@ public class FlowMetadataImportUtils log.error("Unable to delete CSV file"); } - MetadataImport mImport = new MetadataImport(context, csv.getCSVLines()); + MetadataImport mImport = new MetadataImport(context, csv); List changes = mImport.runImport(false, false, false, false); log.debug(LogManager.getHeader(context, "metadataimport", changes.size() + " items with changes identified")); @@ -201,6 +201,7 @@ public class FlowMetadataImportUtils result.setContinue(false); result.setOutcome(false); result.setMessage(T_upload_failed); + result.setCharacters(e.getMessage()); log.debug(LogManager.getHeader(context, "metadataimport", "Error encountered while looking for changes - " + e.getMessage())); } } diff --git a/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/metadataimport/MetadataImportConfirm.java b/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/metadataimport/MetadataImportConfirm.java index 72d4e333e0..52a8c13774 100644 --- a/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/metadataimport/MetadataImportConfirm.java +++ b/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/metadataimport/MetadataImportConfirm.java @@ -61,7 +61,9 @@ public class MetadataImportConfirm extends AbstractDSpaceTransformer { private static final Message T_collection_oldowner = message("xmlui.administrative.metadataimport.MetadataImportConfirm.collection_oldowner"); private static final Message T_collection_mapped = message("xmlui.administrative.metadataimport.MetadataImportConfirm.collection_mapped"); private static final Message T_collection_unmapped = message("xmlui.administrative.metadataimport.MetadataImportConfirm.collection_unmapped"); - + private static final Message T_item_deleted = message("xmlui.administrative.metadataimport.MetadataImportConfirm.item_deleted"); + private static final Message T_item_withdrawn = message("xmlui.administrative.metadataimport.MetadataImportConfirm.item_withdrawn"); + private static final Message T_item_reinstated = message("xmlui.administrative.metadataimport.MetadataImportConfirm.item_reinstated"); public void addPageMeta(PageMeta pageMeta) throws WingException { @@ -111,7 +113,8 @@ public class MetadataImportConfirm extends AbstractDSpaceTransformer { if ((adds.size() > 0) || (removes.size() > 0) || (newCollections.size() > 0) || (oldCollections.size() > 0) || - (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null)) + (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null) || + (change.isDeleted()) || (change.isWithdrawn()) || (change.isReinstated())) { Row headerrow = mdchanges.addRow(Row.ROLE_HEADER); // Show the item @@ -129,6 +132,32 @@ public class MetadataImportConfirm extends AbstractDSpaceTransformer { headerrow.addCell(); } + // Show actions + if (change.isDeleted()) + { + Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-delete"); + + Cell cell = mdrow.addCell(); + cell.addContent(T_item_deleted); + mdrow.addCellContent(""); + } + if (change.isWithdrawn()) + { + Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-withdraw"); + + Cell cell = mdrow.addCell(); + cell.addContent(T_item_withdrawn); + mdrow.addCellContent(""); + } + if (change.isReinstated()) + { + Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-reinstate"); + + Cell cell = mdrow.addCell(); + cell.addContent(T_item_reinstated); + mdrow.addCellContent(""); + } + // Show new owning collection if (change.getNewOwningCollection() != null) { diff --git a/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/metadataimport/MetadataImportUpload.java b/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/metadataimport/MetadataImportUpload.java index 21b4c8d02e..575cd3ccf6 100644 --- a/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/metadataimport/MetadataImportUpload.java +++ b/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/metadataimport/MetadataImportUpload.java @@ -61,6 +61,9 @@ public class MetadataImportUpload extends AbstractDSpaceTransformer { private static final Message T_collection_oldowner = message("xmlui.administrative.metadataimport.MetadataImportUpload.collection_oldowner"); private static final Message T_collection_mapped = message("xmlui.administrative.metadataimport.MetadataImportUpload.collection_mapped"); private static final Message T_collection_unmapped = message("xmlui.administrative.metadataimport.MetadataImportUpload.collection_unmapped"); + private static final Message T_item_delete = message("xmlui.administrative.metadataimport.MetadataImportUpload.item_delete"); + private static final Message T_item_withdraw = message("xmlui.administrative.metadataimport.MetadataImportUpload.item_withdraw"); + private static final Message T_item_reinstate = message("xmlui.administrative.metadataimport.MetadataImportUpload.item_reinstate"); public void addPageMeta(PageMeta pageMeta) throws WingException { @@ -85,7 +88,6 @@ public class MetadataImportUpload extends AbstractDSpaceTransformer { num_changes = changes.size(); } - // DIVISION: metadata-import Division div = body.addInteractiveDivision("metadata-import",contextPath + "/admin/metadataimport", Division.METHOD_MULTIPART,"primary administrative"); div.setHead(T_head1); @@ -108,7 +110,8 @@ public class MetadataImportUpload extends AbstractDSpaceTransformer { if ((adds.size() > 0) || (removes.size() > 0) || (newCollections.size() > 0) || (oldCollections.size() > 0) || - (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null)) + (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null) || + (change.isDeleted()) || (change.isWithdrawn()) || (change.isReinstated())) { Row headerrow = mdchanges.addRow(Row.ROLE_HEADER); // Show the item @@ -127,6 +130,32 @@ public class MetadataImportUpload extends AbstractDSpaceTransformer { headerrow.addCell(); } + // Show actions + if (change.isDeleted()) + { + Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-delete"); + + Cell cell = mdrow.addCell(); + cell.addContent(T_item_delete); + mdrow.addCellContent(""); + } + if (change.isWithdrawn()) + { + Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-withdraw"); + + Cell cell = mdrow.addCell(); + cell.addContent(T_item_withdraw); + mdrow.addCellContent(""); + } + if (change.isReinstated()) + { + Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-reinstate"); + + Cell cell = mdrow.addCell(); + cell.addContent(T_item_reinstate); + mdrow.addCellContent(""); + } + // Show new owning collection if (change.getNewOwningCollection() != null) { diff --git a/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/MetadataExportReader.java b/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/MetadataExportReader.java index ddcbb121f8..bb685d92c8 100644 --- a/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/MetadataExportReader.java +++ b/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/MetadataExportReader.java @@ -117,13 +117,13 @@ public class MetadataExportReader extends AbstractReader implements Recyclable if(dso.getType() == Constants.ITEM) { itemmd.add(dso.getID()); - exporter = new MetadataExport(context, new ItemIterator(context, itemmd),true); + exporter = new MetadataExport(context, new ItemIterator(context, itemmd), false); } else if(dso.getType() == Constants.COLLECTION) { Collection collection = (Collection)dso; ItemIterator toExport = collection.getAllItems(); - exporter = new MetadataExport(context, toExport,true); + exporter = new MetadataExport(context, toExport, false); } else if(dso.getType() == Constants.COMMUNITY) { diff --git a/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/i18n/messages.xml b/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/i18n/messages.xml index 9067b9ba18..568067f3d1 100644 --- a/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/i18n/messages.xml +++ b/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/i18n/messages.xml @@ -1380,8 +1380,8 @@ New item Upload successful Upload failed - Unknown metadata schema in heading - Unknown metadata element in heading + Unknown metadata schema in heading + Unknown metadata element in heading Import successful Import failed Number of changes exceeds maximum allowed. Limit changes or alter bulkedit.gui-item-limit in dspace.cfg @@ -1398,6 +1398,9 @@ Removed from owning collection Mapped to collection Unmapped from collection + Item Expunged + Item Withdrawn + Item Reinstated Add: @@ -1409,6 +1412,9 @@ Changes pending for item Apply changes Pending changes are listed below for review + Expunge Item + Withdraw Item + Reinstate Item Item mapper diff --git a/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Classic/lib/style.css b/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Classic/lib/style.css index bde5b59454..0af49de999 100644 --- a/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Classic/lib/style.css +++ b/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Classic/lib/style.css @@ -515,6 +515,18 @@ tr.ds-table-row.metadata-addition td,tr.ds-table-row.metadata-deletion td { border-top: 1px solid black; } +tr.ds-table-row.item-delete { + background-color: #CC99FF; +} + +tr.ds-table-row.item-withdraw { + background-color: #CC99FF; +} + +tr.ds-table-row.item-reinstate { + background-color: #CC99FF; +} + /******************************* *********** forms *********** diff --git a/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Kubrick/lib/css/style.css b/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Kubrick/lib/css/style.css index 0cd40b3091..10ec98eac7 100644 --- a/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Kubrick/lib/css/style.css +++ b/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Kubrick/lib/css/style.css @@ -193,6 +193,17 @@ tr.ds-table-row.metadata-addition td,tr.ds-table-row.metadata-deletion td { border-top: 1px solid black; } +tr.ds-table-row.item-delete { + background-color: #CC99FF; +} + +tr.ds-table-row.item-withdraw { + background-color: #CC99FF; +} + +tr.ds-table-row.item-reinstate { + background-color: #CC99FF; +} .artifact-description { diff --git a/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Reference/lib/style.css b/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Reference/lib/style.css index 62437fe05b..befc04e490 100644 --- a/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Reference/lib/style.css +++ b/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Reference/lib/style.css @@ -504,6 +504,18 @@ tr.ds-table-row.metadata-deletion { background-color: #CCCCCC; } +tr.ds-table-row.item-delete { + background-color: #CC99FF; +} + +tr.ds-table-row.item-withdraw { + background-color: #CC99FF; +} + +tr.ds-table-row.item-reinstate { + background-color: #CC99FF; +} + tr.ds-table-row.metadata-addition td,tr.ds-table-row.metadata-deletion td { border-top: 1px solid black; } diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index 5993c9c8ed..4aa67b0b26 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -980,7 +980,7 @@ org.dspace.app.itemexport.max.size = 200 # The delimiter used to separate values within a single field (defaults to a double pipe ||) # bulkedit.valueseparator = || -# The delimiter used to serarate fields (defaults to a comma for CSV) +# The delimiter used to separate fields (defaults to a comma for CSV) # bulkedit.fieldseparator = , # A hard limit of the number of items allowed to be edited in one go in the UI @@ -992,6 +992,9 @@ org.dspace.app.itemexport.max.size = 200 # bulkedit.ignore-on-export = dc.date.accessioned, dc.date.available, \ # dc.date.updated, dc.description.provenance +# Should the 'action' column allow the 'expunge' method. By default this is set to false +# bulkedit.allowexpunge = false + #---------------------------------------------------------------# #--------------JSPUI & XMLUI CONFIGURATIONS---------------------#