Merged V3.1 to HEAD

13625: Fix ETHREEOH-1644
   13634: Merged V2.2 to V3.1
      13632: Preparation for fix of ETHREEOH-1663: ML Document Editions Broken by Upgrade to 3.1
   13636: Fixed ETHREEOH-1663: ML Document Editions Broken by Upgrade to 3.1
   13638: Fixed ETHREEOH-1665: Copy/pasting a Specialised Folder changes the assoc qname
   13639: Fixed ETHREEOH-1663: ML Document Editions Broken by Upgrade to 3.1
   13640: Fixed ETHREEOH-1672: Manage Multilingual Content JSP breaks when viewing all Related Content
   13641: Fixed ETHREEOH-1657: Manage Multilingual Content fails with NPE when document was previously versionable
   13774: Fix for ETHREEOH-1629
   13775: Fix for ETHREEOH-1645
   13784: SchemaBootstrap now auto-generates a mostly-canonical schema description on new DB and on upgrades
   13804: Added option to finish schema bootstrap, dump schema structure and exit
   13807: Further pretty formatting of schema dump
   ___________________________________________________________________
   Modified: svn:mergeinfo
      Merged /alfresco/BRANCHES/V2.2:r13632
      Merged /alfresco/BRANCHES/V3.1:r13625,13634,13636,13638-13641,13774-13775,13784,13804,13807


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13912 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-04-09 13:54:02 +00:00
parent e6567f6428
commit 0b57c06ad3
21 changed files with 476 additions and 153 deletions

View File

@@ -51,6 +51,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.cmr.version.VersionService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
@@ -89,6 +90,7 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
private PermissionService permissionService;
private ContentFilterLanguagesService contentFilterLanguagesService;
private FileFolderService fileFolderService;
private VersionService versionService;
private BehaviourFilter policyBehaviourFilter;
@@ -259,6 +261,11 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
private NodeRef makeTranslationImpl(NodeRef mlContainerNodeRef, NodeRef contentNodeRef, Locale locale)
{
// Previous versions of the document are not compatible with the versioning requirements
// dictated by the aspects about to be added. A version has to be forced if the aspect
// already exists.
// https://issues.alfresco.com/jira/browse/ETHREEOH-1657
boolean forceNewVersion = nodeService.hasAspect(contentNodeRef, ContentModel.ASPECT_VERSIONABLE);
// Add the aspect using the given locale, of necessary
if (!nodeService.hasAspect(contentNodeRef, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT))
{
@@ -272,6 +279,11 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
// The aspect is present, so just ensure that the locale is correct
nodeService.setProperty(contentNodeRef, ContentModel.PROP_LOCALE, locale);
}
if (forceNewVersion)
{
versionService.createVersion(contentNodeRef, null);
}
// Do we make use of an existing container?
if (mlContainerNodeRef == null)
@@ -963,6 +975,11 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
this.fileFolderService = fileFolderService;
}
public void setVersionService(VersionService versionService)
{
this.versionService = versionService;
}
public void setPolicyBehaviourFilter(BehaviourFilter policyBehaviourFilter)
{
this.policyBehaviourFilter = policyBehaviourFilter;