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:
Derek Hulley
2007-09-10 23:30:53 +00:00
parent 1b272d6766
commit d0e64d06b4
14 changed files with 2599 additions and 41 deletions

View File

@@ -41,9 +41,9 @@ public class AVMCrawlTestP extends AVMServiceTestBase
*/
public void testCrawl()
{
int n = 3; // Number of Threads.
int m = 10; // How many multiples of content to start with.
long runTime = 18000000; // 6 hours.
int n = 4; // Number of Threads.
int m = 2; // How many multiples of content to start with.
long runTime = 3600000; // 1 Hour. .
fService.purgeStore("main");
BulkLoader loader = new BulkLoader();
loader.setAvmService(fService);

View File

@@ -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");
}
}
}
}
}

View File

@@ -708,14 +708,7 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
{
return true;
}
try
{
return fAVMService.hasAspect(version, path, aspectTypeQName);
}
catch (AVMNotFoundException e)
{
throw new InvalidNodeRefException(nodeRef);
}
return fAVMService.hasAspect(version, path, aspectTypeQName);
}
private static QName [] fgBuiltinAspects = new QName[] { ContentModel.ASPECT_AUDITABLE,

View File

@@ -101,6 +101,21 @@ import org.alfresco.util.Pair;
*/
public class AVMServiceTest extends AVMServiceTestBase
{
public void testSpacesInStoreNames()
{
try
{
fService.createStore("I have spaces");
fService.createFile("I have spaces:/", "in my name.txt").close();
assertNotNull(fService.lookup(-1, "I have spaces:/in my name.txt"));
}
catch (Exception e)
{
e.printStackTrace();
fail();
}
}
public void testHeadPathsInLayers()
{
try

View File

@@ -291,11 +291,13 @@ public class AVMStoreImpl implements AVMStore, Serializable
}
VersionRoot versionRoot = new VersionRootImpl(this,
fRoot,
fNextVersionID,
fNextVersionID++,
System.currentTimeMillis(),
user,
tag,
description);
// Another embarassing flush needed.
AVMDAOs.Instance().fAVMNodeDAO.flush();
AVMDAOs.Instance().fVersionRootDAO.save(versionRoot);
for (AVMNode node : layeredNodes)
{
@@ -308,7 +310,6 @@ public class AVMStoreImpl implements AVMStore, Serializable
}
}
// Increment the version id.
fNextVersionID++;
return snapShotMap;
}
@@ -462,6 +463,8 @@ public class AVMStoreImpl implements AVMStore, Serializable
RawServices.Instance().getMimetypeService().guessMimetype(name),
-1,
"UTF-8"));
// Yet another flush.
AVMDAOs.Instance().fAVMNodeDAO.flush();
ContentWriter writer = createContentWriter(AVMNodeConverter.ExtendAVMPath(path, name));
writer.putContent(data);
}