Hi Joan, Thank you so much for the response. I tested the code below and it worked! I even modified it to also delete bundle:TEXT that have a description "Extracted text".
Thanks again for your help. Sincerely, Euler On Tuesday, June 9, 2020 at 11:18:23 PM UTC+8, Joan Caparros wrote: > > Hi Euler, > I will try to add some code like: > > if len(myBitstreams)>0: > for k in range(0,len(myBitstreams)): > if myBitstreams[k].getDescription() == 'IM Thumbnail': > print "DELETE "+myBitstreams[k].getDescription() > bitstreamService = > ContentServiceFactory.getInstance().getBitstreamService() > > bitstreamService.delete(Curator.curationContext(),myBitstreams[0]) > > > I didn't check it but the methods are there and it should work. > Bests > Joan > > El dimarts, 9 juny de 2020 11:25:43 UTC+2, euler va escriure: >> >> I found this thread [1] from the DSpace Community Mailing list. Thanks a >> lot for Joan Caparros for sharing his curation task code, now I can achieve >> my goal in deleting all thumbnails within a specific community/collection >> just by specifying the -i flag. I also created a curation task for deleting >> bitstreams in the TEXT bundle just by modifying his code replacing >> THUMBNAIL with TEXT. I'm happy that I don't have to do database >> manipulation. I wonder if it is possible to achieve my other todo task >> which is deleting thumbnails if it contains the description "IM Thumbnail" >> using Joan's curation task. >> >> [1] >> https://groups.google.com/d/msg/dspace-community/2sSQ0YixaG8/i_7prYj6BAAJ >> >> Thanks in advance! >> Euler >> >> On Tue, Jun 9, 2020 at 8:47 AM euler <[email protected]> wrote: >> >>> Dear All, >>> >>> I have posted this query in SO [1] but so far I have no responses so >>> I'll try my luck here. I would like to ask how to batch delete bitstreams >>> that are in the Bundle: THUMBNAIL. Would it also be possible to only limit >>> the deletion within a specific community or collection? Since there are >>> collections that I have manually added the thumbnails and I don't want them >>> to be deleted. In this regard, I am also asking if it is also possible to >>> limit the deletion only for those with the description: IM Thumbnail. >>> >>> So to recap, below are my specific conditions: >>> >>> >>> - Delete all thumbnails within a specific community/collection >>> - Delete all thumbnails within a specific community/collection only >>> if it contains the description "IM Thumbnail" >>> >>> Please note that I am aware of the --force flag in filter-media to >>> regenerate the thumbnail but this will not work for manually added >>> thumbnails. I have also items that have no ORIGINAL bundle but I have >>> manually added the thumbnail so the --force flag is not applicable. >>> >>> Thanks in advance and best regards, >>> Euler >>> >>> [1] https://stackoverflow.com/q/62231755/1919069 >>> >>> -- >>> All messages to this mailing list should adhere to the DuraSpace Code of >>> Conduct: https://duraspace.org/about/policies/code-of-conduct/ >>> --- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "DSpace Technical Support" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/dspace-tech/l92kk4nvotU/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/dspace-tech/0a177d5f-0778-4397-ae7e-4f02be4c9892o%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/dspace-tech/0a177d5f-0778-4397-ae7e-4f02be4c9892o%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/ --- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/48d190c2-b778-4a7a-911c-d22758b305ado%40googlegroups.com.
