Hi Joseph:
Thanks for your expressions of interest in the curation task system. A few
remarks inline below.
Richard R
On Jul 13, 2011, at 3:24 PM, Joseph wrote:
Hi Kim,
Thanks for the email. That got me going in the right direction.
Is it likely that the media filters will get transferred over to curation
tasks? It seems like a natural place for them.
Yes, this is quite likely. We have done some work in this direction at MIT and
might have it ready for 1.8; if not, soon thereafter.
I saw that currently the distribute function walks sequentially over
communities and collections; I could see a version in the future that does this
in parallel.
Absolutely, a good idea.
Stuart pointed me towards Bill Hays' talk at OR2011. I saw that Curation
tools can handle scripted tasks in Groovy, Jython, etc. Is this available in
1.7.2 or is it something forthcoming in 1.8.0?
This work is still maturing (so not in 1.7.2), but we are having some success
with JRuby and Groovy - less so with Jython , javascript, Clojure, etc. Do you
think it would still be worthwhile to release it, even with a few limitations?
I can see a lot of applications for curation tasks. I'd like to see them take
off.
What can I do to help?
I do as well. I think the biggest way to help is to share ideas and/or code for
useful tasks. As Kim observed, we don't really have a 'baked'
distribution/deployment model, but this should not prevent us from moving
forward in informal ways as we work towards that.
Thank You again,
Joseph
On Tue, Jul 12, 2011 at 19:47, Kim Shepherd
<[email protected]<mailto:[email protected]>> wrote:
Hi Joseph,
Here's an example of a private method I use with a curation task that
sets policies based on item metadata.
This method would be called by the perform() method that each curation
task overrides from AbstractCurationTask.
I've simplified it here, so all it's doing is removing ANONYMOUS: READ
from the item, the item's bundles, and bitstreams in those bundles.
You could choose to remove ALL group policies rather than just
anonymous, and you could choose to add more policies afterwards. The
Javadoc for AuthorizeManager is probably your best bet if you want to
get into more detail.
private static void applyClosedAccess(Item item) throws
SQLException, AuthorizeException
{
String handle = item.getHandle();
Bundle[] bundles = {};
results = "";
for(String bundleName : bundlesToCurate)
{
bundles = item.getBundles(bundleName);
for (Bundle bundle : bundles)
{
// Remove all existing policies related to Anonymous actions
log.debug(handle + ": Removing Anonymous READ from
bundle " + bundleName);
AuthorizeManager.removeGroupPolicies(c, bundle, anon);
for (Bitstream bs : bundle.getBitstreams())
{
AuthorizeManager.removeGroupPolicies(c, bs, anon);
}
}
results += handle + ": Successfully applied Closed Access
policies on " + bundleName + " and its bitstreams\n";
}
}
"anon" is a Group I get by doing a findGroupByName.
"c" is context
"bundlesToCurate" is just a string[] set in config, so my repo admins
can choose which bundles to apply policies to
You're right about needing context -- that shouldn't be too much of a
problem, just declare it in your task class
private static Context c;
And then initialize it in your overridden init() method. Something like:
try {
c = new Context();
} catch(Exception e) {
status = Curator.CURATE_ERROR;
String results = "Could not obtain context: " +
e.getLocalizedMessage();
setResult(results);
report(results);
return;
}
To keep tasks over large sets of items running smoothly, and to make
sure successful 'perform' operations are committed, I also do this at
the end of perform(), just before the return statement
try {
c.commit();
} catch(Exception e) {
status = Curator.CURATE_ERROR;
results = "Could not commit context: " + e.getLocalizedMessage();
setResult(results);
report(results);
return status;
}
Let me know if any of this doesn't make sense.
I have a pile of curation tasks to share, once we figure out the best
place to publish / distribute / review them...
Cheers!
Kim
On 13 July 2011 07:46, Joseph
<[email protected]<mailto:[email protected]>> wrote:
> Hi Stewart,
> I think a curation task will do just the trick.
> I've created one that is able to identify the appropriate items. Now I'm
> trying to set their policies.
> Is it appropriate do do this through the Authorization Manager or directly
> through the Item.
> In either case, I think I need to obtain the context to be able to do this,
> but I am unsure how to do so.
> You said that you have classes that change policies; how did you accomplish
> this?
> Thank You for your help.
> -Joseph
>
>
>
>
>
> On Thu, Jul 7, 2011 at 17:08, Stuart Lewis
> <[email protected]<mailto:[email protected]>> wrote:
>>
>> Hi Joseph,
>>
>> > I am developing an archive for an archaeology lab where some of the
>> > items are deemed "sensitive" by the collection owner. (Usually if they
>> > contain pictures of human remains or artifacts involved in burial
>> > ceremonies.)
>> >
>> > It is usually very clear in the metadata if an item should be declared
>> > "sensitive".
>> > I'm looking for someplace to insert a boolean check that would then
>> > change the item policies such that only members of the "Sensitive Data
>> > Viewer" group could see the item.
>>
>> We do this using the 'curation' system which was introduced in DSpace 1.7.
>> See:
>>
>> - http://www.dspace.org/1_7_1Documentation/Curation%20System.html
>>
>> This allows you to write classes that can perform tests and make changes
>> to applicable items (their metadata / permissions / bitstreams etc). They
>> can either be run automatically at certain points such as during the
>> workflow, by hand in the XMLUI interface, or as a scheduled cron job.
>>
>> We have a lot of quite specialised curation tasks to perform jobs such as
>> changing bitstream authorizations, making derivative bitstreams, and
>> enhancing metadata.
>>
>> There were some good sessions about this at the recent Open Repositories
>> conference:
>>
>> - https://conferences.tdl.org/or/OR2011/OR2011main/paper/viewFile/431/102
>> -
>> https://www.facebook.com/notes/mire/curation-tasks-in-dspace-an-open-repositories-2011-workshop-report/10150208313003768
>>
>> Thanks,
>>
>>
>> Stuart Lewis
>> Digital Development Manager
>> Te Tumu Herenga The University of Auckland Library
>> Auckland Mail Centre, Private Bag 92019, Auckland 1142, New Zealand
>> Ph: +64 (0)9 373 7599 x81928<tel:%2B64%20%280%299%20373%207599%20x81928>
>>
>
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> Dspace-devel mailing list
> [email protected]<mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/dspace-devel
>
>
<ATT00001..c><ATT00002..c>
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel