Re: [dspace-community] Removing Thumbnails in DSpace 5

2016-09-26 Thread Joan Caparros
For those who have been following this thread I want to share my work,

Here you will find a working curation task for DSpace-6_x that can delete 
all files in a bundle (in this example THUMBNAILS), and also will delete 
empty Bundles (orphan):

https://github.com/kerojohan/curation_taks/blob/master/ctscripts/deletingTHUMBNAILS.py

Have fun.
Bests
Joan Caparrós



El dimarts, 20 setembre de 2016 10:08:57 UTC+2, Joan Caparros va escriure:
>
> Any help? can anyone try it?
>
> i will appreciate it
>
> Thank you
> Joan
>
> El divendres, 16 setembre de 2016 13:05:26 UTC+2, Joan Caparros va 
> escriure:
>>
>> Thank you for all your help, I've tried almost all, now with the 
>> BitstreamService I think that is the correct way but I'm getting an error 
>> of ConcurrentModificationException, I'm completely lost, I'm not modifying 
>> my ArrayList...
>>
>> initializing with Jython
>> perform on dso 
>> Item '10- Façana posterior' (10687/35746)
>> DELETE aplan_436-A_1266_00010.tif
>> Exception: null
>> java.util.ConcurrentModificationException
>> at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
>> at java.util.ArrayList$Itr.next(ArrayList.java:831)
>> at 
>> org.hibernate.collection.internal.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:810)
>> at org.python.core.JavaIterator.__iternext__(JavaIterator.java:18)
>> at org.python.pycode._pyx0.performDso$3(

Re: [dspace-community] Removing Thumbnails in DSpace 5

2016-09-20 Thread Joan Caparros
Any help? can anyone try it?

i will appreciate it

Thank you
Joan

El divendres, 16 setembre de 2016 13:05:26 UTC+2, Joan Caparros va escriure:
>
> Thank you for all your help, I've tried almost all, now with the 
> BitstreamService I think that is the correct way but I'm getting an error 
> of ConcurrentModificationException, I'm completely lost, I'm not modifying 
> my ArrayList...
>
> initializing with Jython
> perform on dso 
> Item '10- Façana posterior' (10687/35746)
> DELETE aplan_436-A_1266_00010.tif
> Exception: null
> java.util.ConcurrentModificationException
> at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
> at java.util.ArrayList$Itr.next(ArrayList.java:831)
> at 
> org.hibernate.collection.internal.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:810)
> at org.python.core.JavaIterator.__iternext__(JavaIterator.java:18)
> at org.python.pycode._pyx0.performDso$3(

Re: [dspace-community] Removing Thumbnails in DSpace 5

2016-09-16 Thread Joan Caparros
Thank you for all your help, I've tried almost all, now with the 
BitstreamService I think that is the correct way but I'm getting an error 
of ConcurrentModificationException, I'm completely lost, I'm not modifying 
my ArrayList...

initializing with Jython
perform on dso 
Item '10- Façana posterior' (10687/35746)
DELETE aplan_436-A_1266_00010.tif
Exception: null
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
at java.util.ArrayList$Itr.next(ArrayList.java:831)
at 
org.hibernate.collection.internal.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:810)
at org.python.core.JavaIterator.__iternext__(JavaIterator.java:18)
at org.python.pycode._pyx0.performDso$3(

Re: [dspace-community] Removing Thumbnails in DSpace 5

2016-09-15 Thread Terry Brady
You will need to use the BitstreamService

https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/content/service/BitstreamService.java#L26

This inherits from DSpaceObjectService

https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/content/service/DSpaceObjectService.java#L393

Terry

On Thu, Sep 15, 2016 at 10:08 AM, Joan Caparros 
wrote:

> Thank you Terry, I think that in DSpace could work but not in DSpace 6,
> Bitstream doesn't have this method
>
> https://github.com/DSpace/DSpace/blob/master/dspace-api/
> src/main/java/org/dspace/content/Bitstream.java
>
> El dijous, 15 setembre de 2016 18:21:21 UTC+2, Terry Brady va escriure:
>>
>> Would this method do what you need?
>>
>> https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace-api/
>> src/main/java/org/dspace/content/Bitstream.java#L513
>>
>> On Thu, Sep 15, 2016 at 8:57 AM, Joan Caparros 
>> wrote:
>>
>>> I'm trying to figure out how I can delete a bitstream, now I have this
>>> curtation task but I'm not able to delete the file, I can not discover how
>>> I have to call a delete or remove method from this file, do you know how I
>>> can delete it?
>>>
>>>
>>> class MyTask(ScriptedTask):
>>> def init(self, curator, taskName):
>>> print "initializing with Jython"
>>>
>>> def performDso(self, dso):
>>> print "perform on dso "
>>> if dso.getType()==2:
>>> print "Item '" + dso.getName() + "'
>>> ("+dso.getHandle()+")"
>>> myBundles = dso.itemService.getBundles(dso
>>> ,"THUMBNAIL")
>>> for i in myBundles:
>>> myBitstreams = i.getBitstreams()
>>> for k in myBitstreams:
>>> print "I WANT TO DELETE THIS
>>> FILE "+k.getName()
>>> return 0
>>>
>>> def performId(self, context, id):
>>> print "perform on id %s" % (id)
>>> return 0
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> El dimarts, 1 març de 2016 0:19:41 UTC+1, Andrea Schweer va escriure:
>>>
 Hi Jeffrey,

 On 01/03/16 12:02, Jeffrey Sheldon wrote:
 > 1. I'd like to remove a large number of thumbnail bitstreams that
 were generated for various bitstream types (JPEG, PDF, text, etc.).  I'm
 doing this to simply fall back on a generic icon view for various bitstream
 types and be more selective about which types have generated thumbnails.

 The "right" way to do this is probably via a curation task, assuming
 you
 have Java skills available locally. The documentation is here:
 https://wiki.duraspace.org/display/DSDOC5x/Curation+System#
 CurationSystem-Writingyourowntasks
 -- there is also an option to use Jython (a python flavour) if that's
 more convenient:
 https://wiki.duraspace.org/display/DSDOC5x/Curation+tasks+in+Jython

 I have a script on github that removes PNG thumbnails for bitstreams
 that also have a JPG thumbnail:
 https://github.com/UoW-IRRs/DSpace-Scripts/blob/master/src/
 main/java/nz/ac/waikato/its/irr/scripts/RemovePNGThumbnailsForPDFs.java
 We had custom thumbnails for a while and switched back to DSpace
 default
 when we upgraded to 5.x; the script was used as a one-off during the
 upgrade. It's a command-line script, to be invoked via dsrun after
 dropping the jar file into [dspace]/lib. I believe I went that route
 (instead of writing a curation task) because it was faster to write
 this
 way and we were confident that it really only would run once. It should
 be easy enough to rip out the processItem method and toss it into a
 curation task.

 cheers,
 Andrea

 --
 Dr Andrea Schweer
 Lead Software Developer, ITS Information Systems
 The University of Waikato, Hamilton, New Zealand
 +64-7-837 9120

 --
>>> You received this message because you are subscribed to the Google
>>> Groups "DSpace Community" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to dspace-communi...@googlegroups.com.
>>> To post to this group, send email to dspace-c...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/dspace-community.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Terry Brady
>> Applications Programmer Analyst
>> Georgetown University Library Information Technology
>> http://georgetown-university-libraries.github.io/
>> 
>> 425-298-5498 (Seattle, WA)
>>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-community+unsubscr...@googlegroups.com.
> To post to this group, send email to dsp

Re: [dspace-community] Removing Thumbnails in DSpace 5

2016-09-15 Thread Joan Caparros
Thank you Terry, I think that in DSpace could work but not in DSpace 6, 
Bitstream doesn't have this method

https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/content/Bitstream.java

El dijous, 15 setembre de 2016 18:21:21 UTC+2, Terry Brady va escriure:
>
> Would this method do what you need?
>
>
> https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace-api/src/main/java/org/dspace/content/Bitstream.java#L513
>
> On Thu, Sep 15, 2016 at 8:57 AM, Joan Caparros  > wrote:
>
>> I'm trying to figure out how I can delete a bitstream, now I have this 
>> curtation task but I'm not able to delete the file, I can not discover how 
>> I have to call a delete or remove method from this file, do you know how I 
>> can delete it?
>>
>>
>> class MyTask(ScriptedTask):
>> def init(self, curator, taskName):
>> print "initializing with Jython"
>>
>> def performDso(self, dso):
>> print "perform on dso "
>> if dso.getType()==2:
>> print "Item '" + dso.getName() + "' 
>> ("+dso.getHandle()+")"
>> myBundles = 
>> dso.itemService.getBundles(dso,"THUMBNAIL")
>> for i in myBundles:
>> myBitstreams = i.getBitstreams()
>> for k in myBitstreams:
>> print "I WANT TO DELETE THIS FILE 
>> "+k.getName()
>> return 0
>> 
>> def performId(self, context, id):
>> print "perform on id %s" % (id)
>> return 0
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> El dimarts, 1 març de 2016 0:19:41 UTC+1, Andrea Schweer va escriure:
>>
>>> Hi Jeffrey, 
>>>
>>> On 01/03/16 12:02, Jeffrey Sheldon wrote: 
>>> > 1. I'd like to remove a large number of thumbnail bitstreams that were 
>>> generated for various bitstream types (JPEG, PDF, text, etc.).  I'm doing 
>>> this to simply fall back on a generic icon view for various bitstream types 
>>> and be more selective about which types have generated thumbnails. 
>>>
>>> The "right" way to do this is probably via a curation task, assuming you 
>>> have Java skills available locally. The documentation is here: 
>>>
>>> https://wiki.duraspace.org/display/DSDOC5x/Curation+System#CurationSystem-Writingyourowntasks
>>>  
>>> -- there is also an option to use Jython (a python flavour) if that's 
>>> more convenient: 
>>> https://wiki.duraspace.org/display/DSDOC5x/Curation+tasks+in+Jython 
>>>
>>> I have a script on github that removes PNG thumbnails for bitstreams 
>>> that also have a JPG thumbnail: 
>>>
>>> https://github.com/UoW-IRRs/DSpace-Scripts/blob/master/src/main/java/nz/ac/waikato/its/irr/scripts/RemovePNGThumbnailsForPDFs.java
>>>  
>>> We had custom thumbnails for a while and switched back to DSpace default 
>>> when we upgraded to 5.x; the script was used as a one-off during the 
>>> upgrade. It's a command-line script, to be invoked via dsrun after 
>>> dropping the jar file into [dspace]/lib. I believe I went that route 
>>> (instead of writing a curation task) because it was faster to write this 
>>> way and we were confident that it really only would run once. It should 
>>> be easy enough to rip out the processItem method and toss it into a 
>>> curation task. 
>>>
>>> cheers, 
>>> Andrea 
>>>
>>> -- 
>>> Dr Andrea Schweer 
>>> Lead Software Developer, ITS Information Systems 
>>> The University of Waikato, Hamilton, New Zealand 
>>> +64-7-837 9120 
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "DSpace Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to dspace-communi...@googlegroups.com .
>> To post to this group, send email to dspace-c...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/dspace-community.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Terry Brady
> Applications Programmer Analyst
> Georgetown University Library Information Technology
> http://georgetown-university-libraries.github.io/ 
> 
> 425-298-5498 (Seattle, WA)
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-community+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-community@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-community.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-community] Removing Thumbnails in DSpace 5

2016-09-15 Thread helix84
You can also refer to here:

http://demo.dspace.org/javadocs/


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


On Thu, Sep 15, 2016 at 6:20 PM, Terry Brady  wrote:
> Would this method do what you need?
>
> https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace-api/src/main/java/org/dspace/content/Bitstream.java#L513
>
> On Thu, Sep 15, 2016 at 8:57 AM, Joan Caparros 
> wrote:
>>
>> I'm trying to figure out how I can delete a bitstream, now I have this
>> curtation task but I'm not able to delete the file, I can not discover how I
>> have to call a delete or remove method from this file, do you know how I can
>> delete it?
>>
>>
>> class MyTask(ScriptedTask):
>> def init(self, curator, taskName):
>> print "initializing with Jython"
>>
>> def performDso(self, dso):
>> print "perform on dso "
>> if dso.getType()==2:
>> print "Item '" + dso.getName() + "'
>> ("+dso.getHandle()+")"
>> myBundles =
>> dso.itemService.getBundles(dso,"THUMBNAIL")
>> for i in myBundles:
>> myBitstreams = i.getBitstreams()
>> for k in myBitstreams:
>> print "I WANT TO DELETE THIS FILE
>> "+k.getName()
>> return 0
>>
>> def performId(self, context, id):
>> print "perform on id %s" % (id)
>> return 0
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> El dimarts, 1 març de 2016 0:19:41 UTC+1, Andrea Schweer va escriure:
>>>
>>> Hi Jeffrey,
>>>
>>> On 01/03/16 12:02, Jeffrey Sheldon wrote:
>>> > 1. I'd like to remove a large number of thumbnail bitstreams that were
>>> > generated for various bitstream types (JPEG, PDF, text, etc.).  I'm doing
>>> > this to simply fall back on a generic icon view for various bitstream 
>>> > types
>>> > and be more selective about which types have generated thumbnails.
>>>
>>> The "right" way to do this is probably via a curation task, assuming you
>>> have Java skills available locally. The documentation is here:
>>>
>>> https://wiki.duraspace.org/display/DSDOC5x/Curation+System#CurationSystem-Writingyourowntasks
>>> -- there is also an option to use Jython (a python flavour) if that's
>>> more convenient:
>>> https://wiki.duraspace.org/display/DSDOC5x/Curation+tasks+in+Jython
>>>
>>> I have a script on github that removes PNG thumbnails for bitstreams
>>> that also have a JPG thumbnail:
>>>
>>> https://github.com/UoW-IRRs/DSpace-Scripts/blob/master/src/main/java/nz/ac/waikato/its/irr/scripts/RemovePNGThumbnailsForPDFs.java
>>> We had custom thumbnails for a while and switched back to DSpace default
>>> when we upgraded to 5.x; the script was used as a one-off during the
>>> upgrade. It's a command-line script, to be invoked via dsrun after
>>> dropping the jar file into [dspace]/lib. I believe I went that route
>>> (instead of writing a curation task) because it was faster to write this
>>> way and we were confident that it really only would run once. It should
>>> be easy enough to rip out the processItem method and toss it into a
>>> curation task.
>>>
>>> cheers,
>>> Andrea
>>>
>>> --
>>> Dr Andrea Schweer
>>> Lead Software Developer, ITS Information Systems
>>> The University of Waikato, Hamilton, New Zealand
>>> +64-7-837 9120
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "DSpace Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to dspace-community+unsubscr...@googlegroups.com.
>> To post to this group, send email to dspace-community@googlegroups.com.
>> Visit this group at https://groups.google.com/group/dspace-community.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Terry Brady
> Applications Programmer Analyst
> Georgetown University Library Information Technology
> http://georgetown-university-libraries.github.io/
> 425-298-5498 (Seattle, WA)
>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-community+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-community@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-community.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-community+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-community@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-community.
For more options, visit https://groups.google.

Re: [dspace-community] Removing Thumbnails in DSpace 5

2016-09-15 Thread Terry Brady
Would this method do what you need?

https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace-api/src/main/java/org/dspace/content/Bitstream.java#L513

On Thu, Sep 15, 2016 at 8:57 AM, Joan Caparros 
wrote:

> I'm trying to figure out how I can delete a bitstream, now I have this
> curtation task but I'm not able to delete the file, I can not discover how
> I have to call a delete or remove method from this file, do you know how I
> can delete it?
>
>
> class MyTask(ScriptedTask):
> def init(self, curator, taskName):
> print "initializing with Jython"
>
> def performDso(self, dso):
> print "perform on dso "
> if dso.getType()==2:
> print "Item '" + dso.getName() + "'
> ("+dso.getHandle()+")"
> myBundles = dso.itemService.getBundles(
> dso,"THUMBNAIL")
> for i in myBundles:
> myBitstreams = i.getBitstreams()
> for k in myBitstreams:
> print "I WANT TO DELETE THIS FILE
> "+k.getName()
> return 0
>
> def performId(self, context, id):
> print "perform on id %s" % (id)
> return 0
>
>
>
>
>
>
>
>
>
>
> El dimarts, 1 març de 2016 0:19:41 UTC+1, Andrea Schweer va escriure:
>
>> Hi Jeffrey,
>>
>> On 01/03/16 12:02, Jeffrey Sheldon wrote:
>> > 1. I'd like to remove a large number of thumbnail bitstreams that were
>> generated for various bitstream types (JPEG, PDF, text, etc.).  I'm doing
>> this to simply fall back on a generic icon view for various bitstream types
>> and be more selective about which types have generated thumbnails.
>>
>> The "right" way to do this is probably via a curation task, assuming you
>> have Java skills available locally. The documentation is here:
>> https://wiki.duraspace.org/display/DSDOC5x/Curation+System#
>> CurationSystem-Writingyourowntasks
>> -- there is also an option to use Jython (a python flavour) if that's
>> more convenient:
>> https://wiki.duraspace.org/display/DSDOC5x/Curation+tasks+in+Jython
>>
>> I have a script on github that removes PNG thumbnails for bitstreams
>> that also have a JPG thumbnail:
>> https://github.com/UoW-IRRs/DSpace-Scripts/blob/master/src/
>> main/java/nz/ac/waikato/its/irr/scripts/RemovePNGThumbnailsForPDFs.java
>> We had custom thumbnails for a while and switched back to DSpace default
>> when we upgraded to 5.x; the script was used as a one-off during the
>> upgrade. It's a command-line script, to be invoked via dsrun after
>> dropping the jar file into [dspace]/lib. I believe I went that route
>> (instead of writing a curation task) because it was faster to write this
>> way and we were confident that it really only would run once. It should
>> be easy enough to rip out the processItem method and toss it into a
>> curation task.
>>
>> cheers,
>> Andrea
>>
>> --
>> Dr Andrea Schweer
>> Lead Software Developer, ITS Information Systems
>> The University of Waikato, Hamilton, New Zealand
>> +64-7-837 9120
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-community+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-community@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-community.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
http://georgetown-university-libraries.github.io/

425-298-5498 (Seattle, WA)

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-community+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-community@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-community.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-community] Removing Thumbnails in DSpace 5

2016-09-15 Thread Joan Caparros
I'm trying to figure out how I can delete a bitstream, now I have this 
curtation task but I'm not able to delete the file, I can not discover how 
I have to call a delete or remove method from this file, do you know how I 
can delete it?


class MyTask(ScriptedTask):
def init(self, curator, taskName):
print "initializing with Jython"

def performDso(self, dso):
print "perform on dso "
if dso.getType()==2:
print "Item '" + dso.getName() + "' 
("+dso.getHandle()+")"
myBundles = 
dso.itemService.getBundles(dso,"THUMBNAIL")
for i in myBundles:
myBitstreams = i.getBitstreams()
for k in myBitstreams:
print "I WANT TO DELETE THIS FILE 
"+k.getName()
return 0

def performId(self, context, id):
print "perform on id %s" % (id)
return 0










El dimarts, 1 març de 2016 0:19:41 UTC+1, Andrea Schweer va escriure:
>
> Hi Jeffrey, 
>
> On 01/03/16 12:02, Jeffrey Sheldon wrote: 
> > 1. I'd like to remove a large number of thumbnail bitstreams that were 
> generated for various bitstream types (JPEG, PDF, text, etc.).  I'm doing 
> this to simply fall back on a generic icon view for various bitstream types 
> and be more selective about which types have generated thumbnails. 
>
> The "right" way to do this is probably via a curation task, assuming you 
> have Java skills available locally. The documentation is here: 
>
> https://wiki.duraspace.org/display/DSDOC5x/Curation+System#CurationSystem-Writingyourowntasks
>  
> -- there is also an option to use Jython (a python flavour) if that's 
> more convenient: 
> https://wiki.duraspace.org/display/DSDOC5x/Curation+tasks+in+Jython 
>
> I have a script on github that removes PNG thumbnails for bitstreams 
> that also have a JPG thumbnail: 
>
> https://github.com/UoW-IRRs/DSpace-Scripts/blob/master/src/main/java/nz/ac/waikato/its/irr/scripts/RemovePNGThumbnailsForPDFs.java
>  
> We had custom thumbnails for a while and switched back to DSpace default 
> when we upgraded to 5.x; the script was used as a one-off during the 
> upgrade. It's a command-line script, to be invoked via dsrun after 
> dropping the jar file into [dspace]/lib. I believe I went that route 
> (instead of writing a curation task) because it was faster to write this 
> way and we were confident that it really only would run once. It should 
> be easy enough to rip out the processItem method and toss it into a 
> curation task. 
>
> cheers, 
> Andrea 
>
> -- 
> Dr Andrea Schweer 
> Lead Software Developer, ITS Information Systems 
> The University of Waikato, Hamilton, New Zealand 
> +64-7-837 9120 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-community+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-community@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-community.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-community] Removing Thumbnails in DSpace 5

2016-02-29 Thread Andrea Schweer

Hi Jeffrey,

On 01/03/16 12:02, Jeffrey Sheldon wrote:

1. I'd like to remove a large number of thumbnail bitstreams that were 
generated for various bitstream types (JPEG, PDF, text, etc.).  I'm doing this 
to simply fall back on a generic icon view for various bitstream types and be 
more selective about which types have generated thumbnails.


The "right" way to do this is probably via a curation task, assuming you 
have Java skills available locally. The documentation is here: 
https://wiki.duraspace.org/display/DSDOC5x/Curation+System#CurationSystem-Writingyourowntasks 
-- there is also an option to use Jython (a python flavour) if that's 
more convenient: 
https://wiki.duraspace.org/display/DSDOC5x/Curation+tasks+in+Jython


I have a script on github that removes PNG thumbnails for bitstreams 
that also have a JPG thumbnail:

https://github.com/UoW-IRRs/DSpace-Scripts/blob/master/src/main/java/nz/ac/waikato/its/irr/scripts/RemovePNGThumbnailsForPDFs.java
We had custom thumbnails for a while and switched back to DSpace default 
when we upgraded to 5.x; the script was used as a one-off during the 
upgrade. It's a command-line script, to be invoked via dsrun after 
dropping the jar file into [dspace]/lib. I believe I went that route 
(instead of writing a curation task) because it was faster to write this 
way and we were confident that it really only would run once. It should 
be easy enough to rip out the processItem method and toss it into a 
curation task.


cheers,
Andrea

--
Dr Andrea Schweer
Lead Software Developer, ITS Information Systems
The University of Waikato, Hamilton, New Zealand
+64-7-837 9120

--
You received this message because you are subscribed to the Google Groups "DSpace 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-community+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-community@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-community.
For more options, visit https://groups.google.com/d/optout.