Merged V3.1 to HEAD

- incl. taking Hibernate libs from 3.1 and adding missing file from earlier merge
   13321: Fix ETHREEOH-1407: System error occur during "Undo Selected" action if no items are selected
   13322: ETHREEOH-1206: Throwing Alfresco Exception on OnUpdateProperties behaviour resets Encoding field to Big (first entry)
   13326: (RECORD ONLY) Removed 'dev' from version label.
   13330: Fix ETHREEOH-1408: Incorrect button name at "Manage Task: Submitted" page
   13337: Fix for ETHREEOH-1409 and further fix for ETHREEOH-1408
   13338: Removed svn:mergeinfo
   13346: Make startup bat script check JAVA can be found.
   13351: ETHREEOH-1386 validate ASR and FSR hostname.
   13359: ETHREEOH-1435: Share doesn't extract document metadata correctly
   13360: Fix ETHREEOH-821: SDK dependencies
   13369: Fixed distribute-sdk target for when it's run locally
   13382: ETHREEOH-1437: Container creation induces an unexpected permission allocation in Share
   13391: Shutdown backstop continues if logging throws errors.
   13394: Fix ETHREEOH-1457 - MT coci issue with bootstrap (eg. data dictionary) content
   13400: Activate JAWS-223: Adobe LC Hibernate Dialect Loading
   13401: Support for JAWS-215, mysql and oracle
   13413: Fix ETHREEOH-1458 - MT delete->archive
   ___________________________________________________________________
   Modified: svn:mergeinfo
      Merged /alfresco/BRANCHES/V3.1:r
                           13321-13322,13326-13327,13330,13337-13339,13341-13347,13351,13354-13355,13358-13363,
                           13365,13367,13369,13382,13385-13392,13394,13400-13403,13405-13406,13413


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13617 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-03-13 00:51:43 +00:00
parent 9d65d8feec
commit fec1149d8c
18 changed files with 297 additions and 117 deletions

View File

@@ -28,6 +28,7 @@ import java.util.HashMap;
import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.cmr.repository.StoreRef;
/**
@@ -39,14 +40,16 @@ public class StoreArchiveMap
{
private Map<StoreRef, StoreRef> storeArchiveMap;
private TenantService tenantService;
public StoreArchiveMap()
{
storeArchiveMap = new HashMap<StoreRef, StoreRef>(0);
}
public Map<StoreRef, StoreRef> getArchiveMap()
public void setTenantService(TenantService tenantService)
{
return storeArchiveMap;
this.tenantService = tenantService;
}
public void setArchiveMap(Map<String, String> archiveMap)
@@ -70,4 +73,26 @@ public class StoreArchiveMap
storeArchiveMap.put(storeRefKey, storeRefValue);
}
}
public StoreRef get(StoreRef storeRef)
{
if (tenantService.isEnabled())
{
return tenantService.getName(storeArchiveMap.get(tenantService.getBaseName(storeRef)));
}
else
{
return storeArchiveMap.get(storeRef);
}
}
public void put(StoreRef workStoreRef, StoreRef archiveStoreRef)
{
storeArchiveMap.put(workStoreRef, archiveStoreRef);
}
public void clear()
{
storeArchiveMap.clear();
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -141,7 +141,7 @@ public class ArchiveAndRestoreTest extends TestCase
// Map the work store to the archive store. This will already be wired into the NodeService.
StoreArchiveMap archiveMap = (StoreArchiveMap) ctx.getBean("storeArchiveMap");
archiveMap.getArchiveMap().put(workStoreRef, archiveStoreRef);
archiveMap.put(workStoreRef, archiveStoreRef);
TestWithUserUtils.createUser(USER_A, USER_A, workStoreRootNodeRef, nodeService, authenticationService);
TestWithUserUtils.createUser(USER_B, USER_B, workStoreRootNodeRef, nodeService, authenticationService);
@@ -508,7 +508,7 @@ public class ArchiveAndRestoreTest extends TestCase
// Now force full deletions and creations
StoreArchiveMap archiveMap = (StoreArchiveMap) ctx.getBean("storeArchiveMap");
archiveMap.getArchiveMap().clear();
archiveMap.clear();
long cumulatedDeleteTimeNs = 0;
long cumulatedCreateTimeNs = 0;
for (int i = 0; i < iterations; i++)

View File

@@ -748,7 +748,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
else
{
StoreRef storeRef = nodeRef.getStoreRef();
archiveStoreRef = storeArchiveMap.getArchiveMap().get(storeRef);
archiveStoreRef = storeArchiveMap.get(storeRef);
// get the type and check if we need archiving
TypeDefinition typeDef = dictionaryService.getType(nodeTypeQName);
if (typeDef == null || !typeDef.isArchive() || archiveStoreRef == null)
@@ -2202,7 +2202,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
public NodeRef getStoreArchiveNode(StoreRef storeRef)
{
StoreRef archiveStoreRef = storeArchiveMap.getArchiveMap().get(storeRef);
StoreRef archiveStoreRef = storeArchiveMap.get(storeRef);
if (archiveStoreRef == null)
{
// no mapping for the given store

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -37,7 +37,6 @@ import javax.transaction.UserTransaction;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.domain.Store;
import org.alfresco.repo.node.BaseNodeServiceTest;
import org.alfresco.repo.node.StoreArchiveMap;
import org.alfresco.repo.node.cleanup.NodeCleanupRegistry;
@@ -465,7 +464,7 @@ public class DbNodeServiceImplTest extends BaseNodeServiceTest
// Ensure that the archive feature is enabled
StoreRef archiveStoreRef = ns.createStore("test", getName() + "-" + System.currentTimeMillis());
storeArchiveMap.getArchiveMap().put(parentNodeRef.getStoreRef(), archiveStoreRef);
storeArchiveMap.put(parentNodeRef.getStoreRef(), archiveStoreRef);
// Delete parent. Cascade is OFF, so children should be left in their current store.
ns.deleteNode(parentNodeRef);