mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
more locking related ui work
- unlocking files on submit - unlocking file on revert - adding AVMLockingAwareService to serviceregistry - locking renditions (using the lockingawareservice) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6040 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -4,16 +4,20 @@
|
||||
package org.alfresco.repo.avm.actions;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
@@ -36,11 +40,21 @@ public class AVMUndoSandboxListAction extends ActionExecuterAbstractBase
|
||||
* The AVM Service reference.
|
||||
*/
|
||||
private AVMService fAVMService;
|
||||
|
||||
/**
|
||||
* The AVM Locking Service reference.
|
||||
*/
|
||||
private AVMLockingService fAVMLockingService;
|
||||
|
||||
public void setAvmService(AVMService service)
|
||||
{
|
||||
fAVMService = service;
|
||||
}
|
||||
|
||||
public void setAvmLockingService(AVMLockingService service)
|
||||
{
|
||||
fAVMLockingService = service;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
@@ -65,8 +79,26 @@ public class AVMUndoSandboxListAction extends ActionExecuterAbstractBase
|
||||
AVMNodeDescriptor parent = fAVMService.lookup(-1, parentChild[0], true);
|
||||
if (parent.isLayeredDirectory())
|
||||
{
|
||||
if (fgLogger.isDebugEnabled())
|
||||
fgLogger.debug("reverting " + parentChild[1] + " in " + parentChild[0]);
|
||||
fAVMService.makeTransparent(parentChild[0], parentChild[1]);
|
||||
}
|
||||
|
||||
final Map<QName, PropertyValue> dnsProperties = fAVMService.queryStorePropertyKey(item.getSecond().split(":")[0], QName.createQName(null, ".dns%"));
|
||||
String webProject = dnsProperties.keySet().iterator().next().getLocalName();
|
||||
webProject = webProject.substring(webProject.lastIndexOf('.') + 1, webProject.length());
|
||||
String path = item.getSecond().substring(item.getSecond().indexOf(":") + 1);
|
||||
if (fgLogger.isDebugEnabled())
|
||||
fgLogger.debug("unlocking file " + path + " in web project " + webProject);
|
||||
|
||||
if (fAVMLockingService.getLock(webProject, path) != null)
|
||||
{
|
||||
fAVMLockingService.removeLock(webProject, path);
|
||||
}
|
||||
else
|
||||
{
|
||||
fgLogger.warn("expected file " + path + " in " + webProject + " to be locked");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user