Class DSpaceObjectMetadataRemoveOperation<R extends org.dspace.content.DSpaceObject>


  • @Component
    public class DSpaceObjectMetadataRemoveOperation<R extends org.dspace.content.DSpaceObject>
    extends PatchOperation<R>
    Class for PATCH REMOVE operations on Dspace Objects' metadata Usage: (can be done on other dso than Item also): - REMOVE metadata (with schema.identifier.qualifier) value of a dso (here: Item) > Without index: removes all md values of that schema.identifier.qualifier type > With index: removes only that select md value curl -X PATCH http://${dspace.server.url}/api/core/items/<:id-item> -H " Content-Type: application/json" -d '[{ "op": "remove", "path": "/metadata/schema.identifier.qualifier(/indexOfSpecificMdToRemove)"}]'
    Author:
    Maria Verdonck (Atmire) on 18/11/2019
    • Constructor Detail

      • DSpaceObjectMetadataRemoveOperation

        public DSpaceObjectMetadataRemoveOperation()
    • Method Detail

      • perform

        public R perform​(org.dspace.core.Context context,
                         R resource,
                         Operation operation)
                  throws SQLException
        Description copied from class: PatchOperation
        Updates the rest model by applying the patch operation.
        Specified by:
        perform in class PatchOperation<R extends org.dspace.content.DSpaceObject>
        Parameters:
        context - context of patch operation
        resource - the dso.
        operation - the patch operation.
        Returns:
        the patched dso
        Throws:
        SQLException
      • supports

        public boolean supports​(Object objectToMatch,
                                Operation operation)
        Description copied from class: PatchOperation
        Determines whether or not this Patch Operation can do this patch (Object of operation and path gets checked)
        Specified by:
        supports in class PatchOperation<R extends org.dspace.content.DSpaceObject>
        Parameters:
        objectToMatch - Object whose class must be instance of type object for which this PatchOperation was created
        operation - Operation of the patch, should match this type of Patch Operation
        Returns:
        True if this PatchOperation class can do the patch for this given dso type and Path