Merged V2.2 to HEAD

8265: Added catch blocks for the permissions service access denied exception to various file/folder operations
   8286: Merged V2.1 to V2.2
      8256: Fix broken WCM workflow.
      8257: Partial fix for AWC-1850
      8283: Merged V2.1-A to V2.1
         8264: Fine-grained debug logging for exceptions causing transaction retries.
   8288: Should fix workflow problems. Hard to test since almost nothing works right now.
   8291: Added Peter's fixes to improve deployment start scripts
   8294: Update deploy script from Peter
   8298: Fix for WCM-1058:
   8300: Commented out admin dashlet (active_tasks)
   8359: Fix AR-1735: Customer-requested POI upgrade
   8367: Fix for AWC-1639
   8368: Fix for WCM-1102
   8389: Revert changes between r8072 and r8251 from Schema2XForms.java
   8401: Fix for WCM-1105
   8407: Minor typo fix


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8488 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-03-10 17:23:01 +00:00
parent c5edd151e9
commit 78c695fc0a
9 changed files with 160 additions and 81 deletions

View File

@@ -258,71 +258,81 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/
}
// Clear out the new nodes.
List<Long> allLayeredNodeIDs = AVMDAOs.Instance().fAVMNodeDAO.getNewLayeredInStoreIDs(me);
AVMDAOs.Instance().fAVMNodeDAO.clearNewInStore(me);
AVMDAOs.Instance().fAVMNodeDAO.clear();
List<Long> layeredNodeIDs = new ArrayList<Long>();
for (Long layeredID : allLayeredNodeIDs)
try
{
Layered layered = (Layered)AVMDAOs.Instance().fAVMNodeDAO.getByID(layeredID);
String indirection = layered.getIndirection();
if (indirection == null)
// attempt to clear only AVMNodes from cache, to allow direct batch update of them
AVMDAOs.Instance().fAVMNodeDAO.flush();
AVMDAOs.Instance().fAVMNodeDAO.noCache();
AVMDAOs.Instance().fAVMNodeDAO.clearNewInStore(me);
List<Long> allLayeredNodeIDs = AVMDAOs.Instance().fAVMNodeDAO.getNewLayeredInStoreIDs(me);
List<Long> layeredNodeIDs = new ArrayList<Long>();
for (Long layeredID : allLayeredNodeIDs)
{
continue;
}
layeredNodeIDs.add(layeredID);
String storeName = indirection.substring(0, indirection.indexOf(':'));
if (!snapShotMap.containsKey(storeName))
{
AVMStore store = AVMDAOs.Instance().fAVMStoreDAO.getByName(storeName);
if (store == null)
Layered layered = (Layered)AVMDAOs.Instance().fAVMNodeDAO.getByID(layeredID);
String indirection = layered.getIndirection();
if (indirection == null)
{
layered.setIndirectionVersion(-1);
continue;
}
layeredNodeIDs.add(layeredID);
String storeName = indirection.substring(0, indirection.indexOf(':'));
if (!snapShotMap.containsKey(storeName))
{
AVMStore store = AVMDAOs.Instance().fAVMStoreDAO.getByName(storeName);
if (store == null)
{
layered.setIndirectionVersion(-1);
}
else
{
store.createSnapshot(null, null, snapShotMap);
layered = (Layered)AVMDAOs.Instance().fAVMNodeDAO.getByID(layeredID);
layered.setIndirectionVersion(snapShotMap.get(storeName));
}
}
else
{
store.createSnapshot(null, null, snapShotMap);
layered = (Layered)AVMDAOs.Instance().fAVMNodeDAO.getByID(layeredID);
layered.setIndirectionVersion(snapShotMap.get(storeName));
}
}
else
AVMDAOs.Instance().fAVMNodeDAO.flush();
// Make up a new version record.
String user = RawServices.Instance().getAuthenticationComponent().getCurrentUserName();
if (user == null)
{
layered.setIndirectionVersion(snapShotMap.get(storeName));
user = RawServices.Instance().getAuthenticationComponent().getSystemUserName();
}
me = (AVMStoreImpl)AVMDAOs.Instance().fAVMStoreDAO.getByID(fID);
VersionRoot versionRoot = new VersionRootImpl(me,
me.fRoot,
me.fNextVersionID++,
System.currentTimeMillis(),
user,
tag,
description);
// Another embarassing flush needed.
AVMDAOs.Instance().fAVMNodeDAO.flush();
AVMDAOs.Instance().fVersionRootDAO.save(versionRoot);
for (Long nodeID : layeredNodeIDs)
{
AVMNode node = AVMDAOs.Instance().fAVMNodeDAO.getByID(nodeID);
List<String> paths = fAVMRepository.getVersionPaths(versionRoot, node);
for (String path : paths)
{
VersionLayeredNodeEntry entry =
new VersionLayeredNodeEntryImpl(versionRoot, path);
AVMDAOs.Instance().fVersionLayeredNodeEntryDAO.save(entry);
}
}
}
AVMDAOs.Instance().fAVMNodeDAO.flush();
// Make up a new version record.
String user = RawServices.Instance().getAuthenticationComponent().getCurrentUserName();
if (user == null)
finally
{
user = RawServices.Instance().getAuthenticationComponent().getSystemUserName();
}
me = (AVMStoreImpl)AVMDAOs.Instance().fAVMStoreDAO.getByID(fID);
VersionRoot versionRoot = new VersionRootImpl(me,
me.fRoot,
me.fNextVersionID++,
System.currentTimeMillis(),
user,
tag,
description);
// Another embarassing flush needed.
AVMDAOs.Instance().fAVMNodeDAO.flush();
AVMDAOs.Instance().fVersionRootDAO.save(versionRoot);
for (Long nodeID : layeredNodeIDs)
{
AVMNode node = AVMDAOs.Instance().fAVMNodeDAO.getByID(nodeID);
List<String> paths = fAVMRepository.getVersionPaths(versionRoot, node);
for (String path : paths)
{
VersionLayeredNodeEntry entry =
new VersionLayeredNodeEntryImpl(versionRoot, path);
AVMDAOs.Instance().fVersionLayeredNodeEntryDAO.save(entry);
}
AVMDAOs.Instance().fAVMNodeDAO.yesCache();
}
return snapShotMap;
}
/**
* Create a new directory.
* @param path The path to the containing directory.