Hi Carolyn,
I can answer the second part of your post better than the first, but let's see where we get along the way.
So first: AtoM tasks do use elements of the Symfony framework (and Symfony does come with some CLI tasks in place if I recall correctly), but yes, we have developed most of them ourselves using the Symfony framework as scaffolding. Per the
introduction provided in this slide deck (image below is from slide 10 of 28), each task has a type namespace first:
You can find AtoM's CLI tasks in the code repository, or in your local codebase, in lib/task - from there, there are subdirectories that correspond to the type namespace of the task. See:
Here is the tools:delete-drafts task, as an example:
Now as to your question:
There's not an easy way to delete all other descendants, but leave a fonds and its series intact. My best high-level suggestions would be:
- Using an export, then an import
- Export the fonds as CSV, delete everything except the levels you want to keep, delete the original fonds, import the cleaned up CSV as new
- Using SQL
- You'd probably need to find the object IDs of all the records, and then target those you want deleted
- Or perhaps you could look up the ID of the level of description terms and then do a join to add a WHERE clause to the query...? (needs further thought)
- This sounds painful to me, tbh
- Changing pub status, and then using the delete-drafts task
- Make sure that EVERYTHING else in your AtoM installation is Published (unless you want it deleted!)
- Set the whole fonds to Draft
- Manually set the top level and the series back to published (without inheritance, so the descendants stay in Draft mode
- Use the delete-drafts task,
- Modify one of the existing CLI tasks to better suit your needs
- For example, figuring out how to copy the repository parameter from the delete-descriptions task to delete drafts
- Then you could do as above, but not have to worry about other Draft records in your installation
- Instead, you could create a new temporary repository record, and move the fonds there, then update pub status as above, use the modified task limited by repository, etc
In ALL of these above examples, I strongly recommend you make a data backup first! These are just ideas off the top of my head, and may have unintended side effects. In any case, I hope they inspire some ideas!
Cheers,
Dan Gillean
, MAS, MLIS