11-25-2012 10:46 AM
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException
{
String resUnlock;
AuthenticationUtils.startSession("admin", "admin");
SiteInfo siteInfo = site.getSite("site1");
NodeRef docLib = site.getContainer(siteInfo.getShortName(), "documentlibrary");
List<ChildAssociationRef> children = nodeService.getChildAssocs(docLib);
for (ChildAssociationRef childAssoc : children)
{
NodeRef childNodeRef = childAssoc.getChildRef();
try
{
lockService.unlock(childNodeRef, true);
}
catch (UnableToReleaseLockException exception)
{
System.out.println(exception.getMessage());
}
}
}
11-26-2012 08:59 AM
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException
{
RunAsWork<Object> actionRunAs = new RunAsWork<Object>() {
public Object doWork() {
SiteInfo siteInfo = site.getSite("site1");
NodeRef docLib = site.getContainer(siteInfo.getShortName(), "documentlibrary");
List<ChildAssociationRef> children = nodeService.getChildAssocs(docLib);
for (ChildAssociationRef childAssoc : children)
{
NodeRef childNodeRef = childAssoc.getChildRef();
try
{
lockService.unlock(childNodeRef, true);
}
catch (UnableToReleaseLockException exception)
{
System.out.println(exception.getMessage());
}
}
return null;
};
AuthenticationUtil.runAs(actionRunAs, AuthenticationUtil.getSystemUserName());
}
11-27-2012 07:25 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.