cancel
Showing results for 
Search instead for 
Did you mean: 

How to recursively unlock a hierarchy of documents?

martin_cowie
Champ in-the-making
Champ in-the-making
Having migrated some 8 thousand or so documents into our AlFresco instance, they are all locked (some side-effect of the JCR-based migration sofware I wrote I'm sure). Currently only the Admin or users with Coordinator rights can unlock them.

How can I unlock them all?

I've done some digging, and come up with nothing so far. Is there some "chmod -R …" analogue I'm missing?

I'll consider all approaches, web-service, JCR, Javascript actions (not that I've written one of them before), you name it.

Cheers,

M.
5 REPLIES 5

kvc
Champ in-the-making
Champ in-the-making
Martin:


Did you migrate these documents into a web project or a normal Alfresco space?

If migrated to a web project, assets can be written to the CIFS interface which does not enforce locking on assets upon create or modification.  If migrated to a web project view our APIs, you can create or modify files using  AVMService (does not enforce taking of locks; this is the service CIFS is mapped to and is useful for developers who may need to make concurrent modifications to assets, which is support server-side as we are a Subversion-style versioning repository) or AVMLockingAwareService, which wraps AVMService and enforces taking of locks (used by the web client, which is critical for business users to ensure that they never simultaneously modify the same asset as another user to avoid conflicts, merges, and overrides).  If you do use AVMLockingAwareService, you can either (a) change to use AVMService (b) use AVMLockingService to remove the locks or © submit the assets from the user sandbox in which they were created to the staging sandbox, where that promotion will automatically releases locks once that assets are committed and snapshotted in staging.

Hope that helps.


Kevin

martin_cowie
Champ in-the-making
Champ in-the-making
Hi Kevin

The documents have been migrated into a plain old AlFresco space. (I wasn't aware there other types before your email  :-).

I looks as though the AVMLockingService is the smart choice for removing all those locks. Via which API can I access it?

As an aside, a means of doing this through the JavaScript API would be very nice. It already allows me to detect locks & their owners, but not to remove or create one.

Cheers,

M. Smiley Very Happy

kvc
Champ in-the-making
Champ in-the-making
Martin:


AVMLockingService, etc. only works in the context of a web project, which implement a special repository type that extends the normal versioning model of a space to include directory-level versioning, repository snapshoting, file and directory-level branching, and composable repository views through something called layered files and folders.  Basicially it is a purpose-built repo designed to support a Subversion-style versioning model to manage development (including parallel development), test, and staging or a dynamic, interactive site that uses Alfresco as a backend content and content services provider. 

Whew.

If you are putting things into a normal space (which acts as a feed or library of data to be source into a web project), then forget all mention to Locking Service or all things AVM.  Those are as noted for a specific type of product usage.

Cheers!


Kevin

martin_cowie
Champ in-the-making
Champ in-the-making
So given that I'm not using the (appealing sounding) web project. Am I up a creek w/o a paddle?

M.

martin_cowie
Champ in-the-making
Champ in-the-making
I have taken to use the webservice org.alfresco.webservice.authoring.AuthoringWebService.unlock( Predicate, boolean unlockChildren) … although oddly it cannot be used on spaces, even with unlockChildren = true. It throws the exception "Access Denied.  You do not have the appropriate permissions to perform this operation." … even when connected as 'admin'

To the webservices forum! ….