mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.1 to HEAD
6500: Office 2003 Add-ins: Fix for AWC-1505 6501: Fix for AWC-1361 6502: Fixes for locking issues regrading expired content 6503: Fix for AR-1615 6504: WCM-444, WCM-288, WCM-735, WCM-480 6505: WCM-498 wasn't fully fixed 6506: Fix for AWC-1462 6507: Fix for WCM-741 (link validation report for staging sandbox can get stuck) 6508: AR-1650: WS Unit tests fail 6509: Fix for WCM-751 which also solves WCM-570 - also fixed issue to allow deletion of any "broken" webprojects created due to either of those bugs. 6510: Fix for WCM-546 (workflow history panel should be expanded by default) 6511: Fix AWC-1128 6512: Fixes to several to a couple of bugs found under concurrent load. 6513: Build fix for test using an invalid noderef (now stripped out as it does not exist) 6514: Add support for the QueryFile transact request to the IPC$ named pipe handler. Fix for AR-1687. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6740 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -48,6 +48,7 @@ import org.alfresco.sandbox.SandboxConstants;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
|
||||
import org.alfresco.service.cmr.avm.locking.AVMLock;
|
||||
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
|
||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
@@ -88,6 +89,7 @@ public class AVMExpiredContentProcessor
|
||||
protected AVMService avmService;
|
||||
protected AVMSyncService avmSyncService;
|
||||
protected AVMService avmLockingAwareService;
|
||||
protected AVMLockingService avmLockingService;
|
||||
protected NodeService nodeService;
|
||||
protected WorkflowService workflowService;
|
||||
protected PersonService personService;
|
||||
@@ -120,6 +122,11 @@ public class AVMExpiredContentProcessor
|
||||
this.avmService = avmService;
|
||||
}
|
||||
|
||||
public void setAvmLockingService(AVMLockingService avmLockingService)
|
||||
{
|
||||
this.avmLockingService = avmLockingService;
|
||||
}
|
||||
|
||||
public void setAvmSyncService(AVMSyncService avmSyncService)
|
||||
{
|
||||
this.avmSyncService = avmSyncService;
|
||||
@@ -321,35 +328,53 @@ public class AVMExpiredContentProcessor
|
||||
|
||||
if (expirationDate != null && expirationDate.before(now))
|
||||
{
|
||||
// get the map of expired content for the store
|
||||
Map<String, List<String>> storeExpiredContent = this.expiredContent.get(storeName);
|
||||
if (storeExpiredContent == null)
|
||||
{
|
||||
storeExpiredContent = new HashMap<String, List<String>>(4);
|
||||
this.expiredContent.put(storeName, storeExpiredContent);
|
||||
}
|
||||
|
||||
// get the list of expired content for the last modifier of the node
|
||||
String modifier = node.getLastModifier();
|
||||
List<String> userExpiredContent = storeExpiredContent.get(modifier);
|
||||
if (userExpiredContent == null)
|
||||
{
|
||||
userExpiredContent = new ArrayList<String>(4);
|
||||
storeExpiredContent.put(modifier, userExpiredContent);
|
||||
}
|
||||
|
||||
// add the content to the user's list for the current store
|
||||
userExpiredContent.add(nodePath);
|
||||
|
||||
// before doing anything else see whether the item is locked by any user,
|
||||
// if it is then just log a warning messge and wait until the next time around
|
||||
String[] splitPath = nodePath.split(":");
|
||||
AVMLock lock = this.avmLockingService.getLock(storeName, splitPath[1]);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Added " + nodePath + " to " + modifier + "'s list of expired content");
|
||||
logger.debug("lock details for '" + nodePath + "': " + lock);
|
||||
|
||||
if (lock == null)
|
||||
{
|
||||
// get the map of expired content for the store
|
||||
Map<String, List<String>> storeExpiredContent = this.expiredContent.get(storeName);
|
||||
if (storeExpiredContent == null)
|
||||
{
|
||||
storeExpiredContent = new HashMap<String, List<String>>(4);
|
||||
this.expiredContent.put(storeName, storeExpiredContent);
|
||||
}
|
||||
|
||||
// reset the expiration date
|
||||
this.avmService.setNodeProperty(nodePath, WCMAppModel.PROP_EXPIRATIONDATE,
|
||||
new PropertyValue(DataTypeDefinition.DATETIME, null));
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Reset expiration date for: " + nodePath);
|
||||
// get the list of expired content for the last modifier of the node
|
||||
String modifier = node.getLastModifier();
|
||||
List<String> userExpiredContent = storeExpiredContent.get(modifier);
|
||||
if (userExpiredContent == null)
|
||||
{
|
||||
userExpiredContent = new ArrayList<String>(4);
|
||||
storeExpiredContent.put(modifier, userExpiredContent);
|
||||
}
|
||||
|
||||
// add the content to the user's list for the current store
|
||||
userExpiredContent.add(nodePath);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Added " + nodePath + " to " + modifier + "'s list of expired content");
|
||||
|
||||
// reset the expiration date
|
||||
this.avmService.setNodeProperty(nodePath, WCMAppModel.PROP_EXPIRATIONDATE,
|
||||
new PropertyValue(DataTypeDefinition.DATETIME, null));
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Reset expiration date for: " + nodePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn("ignoring '" + nodePath + "', although it has expired, it's currently locked");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user