Feature #13288

Overhaul digitalobject:delete task and add new options to delete all digital objects associated with a repository, and limit to a specific media type

Added by Dan Gillean 6 months ago. Updated 5 months ago.

Status:VerifiedStart date:04/13/2020
Priority:MediumDue date:
Assignee:-% Done:

0%

Category:CLI toolsEstimated time:14.00 hours
Target version:Release 2.6.0
Google Code Legacy ID: Tested version:
Sponsored:Yes Requires documentation:

Description

AtoM has a command-line task that can be used to delete a digital object from the command-line, documented here:

This task accepts an information object slug as a parameter, and will remove an attached digital object (and its derivatives) when run. There is also currently an --and-descendants option that will also delete any DOs attached to descendant descriptions in an archival unit.

This feature enhancement will overhaul the task's implementation (which should see some performance improvements), and add two new options.

First, instead of providing a description slug, users can now provide the slug of an archival institution (AKA repository) record to delete all digital objects linked to descriptions associated with a particular archival institution. When this option is used, the existing --and-descendants option will be ignored - by default, providing a repository slug means that ALL associated digital objects at all levels will be deleted from the related descriptions.

Second, a new --media-type option will be included, that will allow users to limit the task's deletion to a specific type of digital object. Valid option parameters are:

  • audio
  • video
  • image
  • text
  • other

Example use: deleting all video files linked to descriptions associated with the Example repository:

php symfony digitalobject:delete --media-type="video" example-repository

History

#2 Updated by Steve Breker 6 months ago

New features:
- slug argument can now be either a repo or description
- added new '--dry-run' option - this will allow the CLI task to be run without updating the DB to test what will be modified
- added new '--media-type' option to restrict deletion to certain types.
- uses PDO DB queries instead of Propel ORM to get children. Also avoid loading all children as objects at once.
- add code to clear in memory objects when they are no longer needed.

Fixed:
- error when running this task in 2.6.x where not enough params are supplied to function: derivativesGeneratedFromExternalMaster()
- error when deleting DOs from a hierarchy where two images are exactly the same.

#3 Updated by Steve Breker 6 months ago

  • Status changed from New to Code Review

#4 Updated by Steve Breker 6 months ago

  • Status changed from Code Review to QA/Review
  • Assignee deleted (Steve Breker)

CR complete - ready for QA!

#5 Updated by Dan Gillean 6 months ago

  • Status changed from QA/Review to Verified

#6 Updated by Dan Gillean 5 months ago

  • Requires documentation deleted (Yes)

Also available in: Atom PDF