mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.0 to HEAD
12719: Merged V2.2 to V3.0 12709: Merged V2.1 to V2.2 12708: Fix for ALFCOM-2305 (against 2.1E original - to be merged forward) 12711: Fix for ETHREEOH-1110 (applied to 2.2 where original code is present) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12720 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -109,7 +109,7 @@ public class EditionServiceImpl implements EditionService
|
|||||||
|
|
||||||
// get the last edition and add it the Version Histories property to the version
|
// get the last edition and add it the Version Histories property to the version
|
||||||
Version currentEdition = versionService.getCurrentVersion(mlContainerToVersion);
|
Version currentEdition = versionService.getCurrentVersion(mlContainerToVersion);
|
||||||
addVersionHitoryProperty(currentEdition, childAssocRefs);
|
addVersionHistoryProperty(currentEdition, childAssocRefs);
|
||||||
|
|
||||||
if(versionProperties == null)
|
if(versionProperties == null)
|
||||||
{
|
{
|
||||||
@@ -264,19 +264,35 @@ public class EditionServiceImpl implements EditionService
|
|||||||
// Switch VersionStore depending on configured impl
|
// Switch VersionStore depending on configured impl
|
||||||
if (versionService.getVersionStoreReference().getIdentifier().equals(Version2Model.STORE_ID))
|
if (versionService.getVersionStoreReference().getIdentifier().equals(Version2Model.STORE_ID))
|
||||||
{
|
{
|
||||||
// V2 version store (eg. workspace://version2Store)
|
// V2 version store (eg. workspace://version2Store)
|
||||||
|
|
||||||
// get the serialisation of the version histories in the version properties
|
// get the serialisation of the version histories in the version properties
|
||||||
versionHistories = (List<VersionHistory>)
|
Object histories = properties.get(Version2Model.PROP_QNAME_TRANSLATION_VERSIONS);
|
||||||
properties.get(Version2Model.PROP_QNAME_TRANSLATION_VERSIONS);
|
if (histories instanceof List)
|
||||||
|
{
|
||||||
|
versionHistories = (List<VersionHistory>)histories;
|
||||||
|
}
|
||||||
|
else if (histories instanceof VersionHistory)
|
||||||
|
{
|
||||||
|
versionHistories = new ArrayList<VersionHistory>(1);
|
||||||
|
versionHistories.add((VersionHistory)histories);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (versionService.getVersionStoreReference().getIdentifier().equals(VersionModel.STORE_ID))
|
else if (versionService.getVersionStoreReference().getIdentifier().equals(VersionModel.STORE_ID))
|
||||||
{
|
{
|
||||||
// Deprecated V1 version store (eg. workspace://lightWeightVersionStore)
|
// Deprecated V1 version store (eg. workspace://lightWeightVersionStore)
|
||||||
|
|
||||||
// get the serialisation of the version histories in the version properties
|
// get the serialisation of the version histories in the version properties
|
||||||
versionHistories = (List<VersionHistory>)
|
Object histories = properties.get(VersionModel.PROP_QNAME_TRANSLATION_VERSIONS);
|
||||||
properties.get(VersionModel.PROP_QNAME_TRANSLATION_VERSIONS);
|
if (histories instanceof List)
|
||||||
|
{
|
||||||
|
versionHistories = (List<VersionHistory>)histories;
|
||||||
|
}
|
||||||
|
else if (histories instanceof VersionHistory)
|
||||||
|
{
|
||||||
|
versionHistories = new ArrayList<VersionHistory>(1);
|
||||||
|
versionHistories.add((VersionHistory)histories);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -303,7 +319,7 @@ public class EditionServiceImpl implements EditionService
|
|||||||
/**
|
/**
|
||||||
* Util method to add the version histories of translations as a property of the frozen mlContainer
|
* Util method to add the version histories of translations as a property of the frozen mlContainer
|
||||||
*/
|
*/
|
||||||
private void addVersionHitoryProperty(Version edition, List<ChildAssociationRef> childAssocRefs)
|
private void addVersionHistoryProperty(Version edition, List<ChildAssociationRef> childAssocRefs)
|
||||||
{
|
{
|
||||||
List<VersionHistory> translationVersionHistories = new ArrayList<VersionHistory>(childAssocRefs.size());
|
List<VersionHistory> translationVersionHistories = new ArrayList<VersionHistory>(childAssocRefs.size());
|
||||||
|
|
||||||
@@ -312,7 +328,6 @@ public class EditionServiceImpl implements EditionService
|
|||||||
NodeRef translation = ref.getChildRef();
|
NodeRef translation = ref.getChildRef();
|
||||||
|
|
||||||
translationVersionHistories.add(versionService.getVersionHistory(translation));
|
translationVersionHistories.add(versionService.getVersionHistory(translation));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// properties in which the version histories will be stored
|
// properties in which the version histories will be stored
|
||||||
@@ -348,7 +363,6 @@ public class EditionServiceImpl implements EditionService
|
|||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException("Unexpected versionstore: " + versionService.getVersionStoreReference().getIdentifier());
|
throw new AlfrescoRuntimeException("Unexpected versionstore: " + versionService.getVersionStoreReference().getIdentifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -55,6 +55,7 @@ import org.alfresco.repo.security.permissions.PermissionReference;
|
|||||||
import org.alfresco.repo.security.permissions.PermissionServiceSPI;
|
import org.alfresco.repo.security.permissions.PermissionServiceSPI;
|
||||||
import org.alfresco.repo.tenant.TenantService;
|
import org.alfresco.repo.tenant.TenantService;
|
||||||
import org.alfresco.repo.version.VersionModel;
|
import org.alfresco.repo.version.VersionModel;
|
||||||
|
import org.alfresco.repo.version.common.VersionUtil;
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
@@ -435,9 +436,9 @@ public class PermissionServiceImpl implements PermissionServiceSPI, Initializing
|
|||||||
|
|
||||||
// NOTE: maybe in future there will appear situation when changing Node permissions will be a cause for creating new Node version. In other words,
|
// NOTE: maybe in future there will appear situation when changing Node permissions will be a cause for creating new Node version. In other words,
|
||||||
// VersionedNodeRefs will contain their own permissions (whose, probably, will differ from version to version). In this case you should delete/comment this code!!!
|
// VersionedNodeRefs will contain their own permissions (whose, probably, will differ from version to version). In this case you should delete/comment this code!!!
|
||||||
if(isVersionedNodeRefInstance(passedNodeRef))
|
if (isVersionedNodeRefInstance(passedNodeRef))
|
||||||
{
|
{
|
||||||
passedNodeRef = convertVersionedNodeRefToFrozenNodeRef(passedNodeRef);
|
passedNodeRef = convertVersionedNodeRefToFrozenNodeRef(VersionUtil.convertNodeRef(passedNodeRef));
|
||||||
}
|
}
|
||||||
|
|
||||||
final NodeRef nodeRef = tenantService.getName(passedNodeRef);
|
final NodeRef nodeRef = tenantService.getName(passedNodeRef);
|
||||||
|
Reference in New Issue
Block a user