mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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:
@@ -46,6 +46,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.repo.domain.AuditableProperties;
|
||||
import org.alfresco.repo.domain.ChildAssoc;
|
||||
import org.alfresco.repo.domain.ContentDataId;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.LocaleDAO;
|
||||
import org.alfresco.repo.domain.Node;
|
||||
@@ -4986,11 +4987,13 @@ public class HibernateNodeDaoServiceImpl
|
||||
" Value: " + value);
|
||||
}
|
||||
// Handle ContentData
|
||||
if (value instanceof ContentData && propertyTypeQName.equals(DataTypeDefinition.CONTENT))
|
||||
// We used to check the property type, but we now handle d:any ContentData as well
|
||||
if (value instanceof ContentData)
|
||||
{
|
||||
// Needs converting to an ID
|
||||
ContentData contentData = (ContentData) value;
|
||||
value = contentDataDAO.createContentData(contentData).getFirst();
|
||||
Long contentDataId = contentDataDAO.createContentData(contentData).getFirst();
|
||||
value = new ContentDataId(contentDataId);
|
||||
}
|
||||
// Handle MLText
|
||||
if (value instanceof MLText)
|
||||
@@ -5374,8 +5377,24 @@ public class HibernateNodeDaoServiceImpl
|
||||
{
|
||||
Serializable value = propertyValue.getValue(propertyTypeQName);
|
||||
// Handle conversions to and from ContentData
|
||||
if (propertyTypeQName.equals(DataTypeDefinition.CONTENT) && (value instanceof Long))
|
||||
if (value instanceof ContentDataId)
|
||||
{
|
||||
// ContentData used to be persisted
|
||||
Long contentDataId = ((ContentDataId) value).getId();
|
||||
Pair<Long, ContentData> contentDataPair = contentDataDAO.getContentData(contentDataId);
|
||||
if (contentDataPair == null)
|
||||
{
|
||||
// It is invalid
|
||||
value = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = contentDataPair.getSecond();
|
||||
}
|
||||
}
|
||||
else if (propertyTypeQName.equals(DataTypeDefinition.CONTENT) && (value instanceof Long))
|
||||
{
|
||||
// ContentData used to be persisted
|
||||
Pair<Long, ContentData> contentDataPair = contentDataDAO.getContentData((Long)value);
|
||||
if (contentDataPair == null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user