Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

60598: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3)
      60375: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.2)
         60154: Merged DEV to V4.1-BUG-FIX (4.1.8)
            60062: MNT-9369 : Addition of the cm:versionable aspect through the Share UI sets the cm:autoVersionOnUpdateProp=true regardless of the aspect
            property being set to 'false' in the contentModel.xml
            Added loading of default properties from Dictionary for versionable aspect.
            60063: MNT-9369 : Addition of the cm:versionable aspect through the Share UI sets the cm:autoVersionOnUpdateProp=true regardless of the aspect
            property being set to 'false' in the contentModel.xml
            Added a test to simulate the issue.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62328 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-12 14:10:32 +00:00
parent 73fe0fb759
commit 05e0f93494
3 changed files with 1816 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2012 Alfresco Software Limited.
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -69,6 +69,7 @@ import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.cmr.lock.LockStatus;
import org.alfresco.service.cmr.model.FileExistsException;
import org.alfresco.service.cmr.model.FileFolderService;
@@ -2222,7 +2223,11 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
}
else
{
ensureVersioningEnabled(true, true);
// MNT-9369, read props from contentModel.xml, sets to false, false if there is no defaults.
Map<QName, PropertyDefinition> versionableProps = services.getDictionaryService().getAspect(ContentModel.ASPECT_VERSIONABLE).getProperties();
boolean autoVersion = Boolean.parseBoolean(versionableProps.get(ContentModel.PROP_AUTO_VERSION).getDefaultValue());
boolean autoVersionProps = Boolean.parseBoolean(versionableProps.get(ContentModel.PROP_AUTO_VERSION_PROPS).getDefaultValue());
ensureVersioningEnabled(autoVersion, autoVersionProps);
}
}
else