Merged BRANCHES/V3.2 to HEAD:

18363: WCM clustering - ETHREEOH-3962 (duplicate root node entry)
   19091: Fix Part 1 ALF-726: v3.1.x Content Cleaner Job needs to be ported to v3.2
   19159: Fixed ALF-726: Migrate pre-3.2 content URLs to new format and pick up tag existing orphaned content
   19169: Fix fallout from 19159 for ALF-726: Migrate pre-3.2 content URLs to new format and pick up tag existing orphaned content
   19262: ALF-726 Multithreading for content URL conversion



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19267 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-03-12 19:11:12 +00:00
parent a2c2e215a8
commit fdc8f6f331
33 changed files with 2589 additions and 1175 deletions

View File

@@ -23,6 +23,7 @@ import java.util.List;
import org.alfresco.repo.domain.DbAccessControlList;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.transaction.TransactionService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -333,14 +334,17 @@ public class OrphanReaper
else if (node.getType() == AVMNodeType.PLAIN_FILE)
{
PlainFileNode file = (PlainFileNode)node;
if (!file.isLegacyContentData())
if (file.isLegacyContentData())
{
Long contentDataId = file.getContentDataId();
if (contentDataId != null)
{
// The ContentDataDAO will take care of dereferencing and cleanup
AVMDAOs.Instance().contentDataDAO.deleteContentData(contentDataId);
}
// We quickly convert the old ContentData to the new storage
ContentData contentData = file.getContentData();
file.setContentData(contentData);
}
Long contentDataId = file.getContentDataId();
if (contentDataId != null)
{
// The ContentDataDAO will take care of dereferencing and cleanup
AVMDAOs.Instance().contentDataDAO.deleteContentData(contentDataId);
}
}
// Finally, delete it

View File

@@ -28,7 +28,7 @@ import org.alfresco.repo.domain.contentdata.ContentDataDAO;
import org.alfresco.repo.security.permissions.ACLCopyMode;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.QName;
/**
* A plain old file. Contains a Content object.
@@ -67,7 +67,7 @@ public class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
public PlainFileNodeImpl()
{
}
/**
* Make one from just an AVMStore.
* This is the constructor used when a brand new plain file is being made.
@@ -76,7 +76,7 @@ public class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
public PlainFileNodeImpl(AVMStore store)
{
super(store);
setVersionID(1);
setVersionID(1);
}
/**
@@ -92,10 +92,10 @@ public class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
// layered files.
setContentData(other.getContentData(null));
setVersionID(other.getVersionID() + 1);
copyACLs(other, parentAcl, mode);
copyCreationAndOwnerBasicAttributes(other);
copyACLs(other, parentAcl, mode);
copyCreationAndOwnerBasicAttributes(other);
AVMDAOs.Instance().fAVMNodeDAO.save(this);
copyProperties(other);
@@ -114,8 +114,8 @@ public class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
public PlainFileNodeImpl(AVMStore store,
BasicAttributes attrs,
ContentData content,
Map<QName, PropertyValue> props,
Set<QName> aspects,
Map<QName, PropertyValue> props,
Set<QName> aspects,
DbAccessControlList acl,
int versionID, Long parentAcl, ACLCopyMode mode)
{
@@ -129,10 +129,10 @@ public class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
setAcl(acl.getCopy(parentAcl, mode));
}
AVMDAOs.Instance().fAVMNodeDAO.save(this);
addProperties(props);
setAspects(new HashSet<QName>(aspects));
AVMDAOs.Instance().fAVMNodeDAO.save(this);
addProperties(props);
setAspects(new HashSet<QName>(aspects));
}
/**
@@ -414,7 +414,14 @@ public class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
Long contentDataId = getContentDataId();
try
{
return AVMDAOs.Instance().contentDataDAO.getContentData(contentDataId).getSecond();
if (contentDataId == null)
{
return new ContentData(null, null, 0L, null);
}
else
{
return AVMDAOs.Instance().contentDataDAO.getContentData(contentDataId).getSecond();
}
}
catch (Throwable e)
{