mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-16 17:55:15 +00:00
Merged V2.1 to HEAD
6413: ML copy code switches off the MLPropertyInterceptor whilst copying 6416: WCM-709 CIFS automount comment git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6422 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
7ffe085354
commit
cb7bfbec70
@ -37,6 +37,7 @@ import javax.transaction.SystemException;
|
|||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.i18n.I18NUtil;
|
import org.alfresco.i18n.I18NUtil;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.repo.node.MLPropertyInterceptor;
|
||||||
import org.alfresco.repo.policy.BehaviourFilter;
|
import org.alfresco.repo.policy.BehaviourFilter;
|
||||||
import org.alfresco.service.cmr.ml.ContentFilterLanguagesService;
|
import org.alfresco.service.cmr.ml.ContentFilterLanguagesService;
|
||||||
import org.alfresco.service.cmr.ml.MultilingualContentService;
|
import org.alfresco.service.cmr.ml.MultilingualContentService;
|
||||||
@ -790,6 +791,9 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
|
|||||||
*/
|
*/
|
||||||
public NodeRef copyTranslationContainer(NodeRef mlContainerNodeRef, NodeRef newParentRef, String prefixName) throws Exception
|
public NodeRef copyTranslationContainer(NodeRef mlContainerNodeRef, NodeRef newParentRef, String prefixName) throws Exception
|
||||||
{
|
{
|
||||||
|
// There is no need for the properties interceptor here
|
||||||
|
boolean wasMLAware = MLPropertyInterceptor.setMLAware(true);
|
||||||
|
|
||||||
if(!ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(nodeService.getType(mlContainerNodeRef)))
|
if(!ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(nodeService.getType(mlContainerNodeRef)))
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
@ -863,6 +867,10 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
|
|||||||
copyNodeRef,
|
copyNodeRef,
|
||||||
ContentModel.ASSOC_MULTILINGUAL_CHILD,
|
ContentModel.ASSOC_MULTILINGUAL_CHILD,
|
||||||
QNAME_ML_TRANSLATION);
|
QNAME_ML_TRANSLATION);
|
||||||
|
|
||||||
|
// Add the ML aspects back
|
||||||
|
nodeService.addAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT, null);
|
||||||
|
nodeService.addAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION, null);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@ -887,6 +895,9 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The rest of the transaction can have properties modified
|
||||||
|
MLPropertyInterceptor.setMLAware(wasMLAware);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
logger.debug("MLContainer copied: \n" +
|
logger.debug("MLContainer copied: \n" +
|
||||||
|
@ -88,10 +88,14 @@ public class MLPropertyInterceptor implements MethodInterceptor
|
|||||||
*
|
*
|
||||||
* @param mlAwareVal <tt>true</tt> if the current thread is able to handle
|
* @param mlAwareVal <tt>true</tt> if the current thread is able to handle
|
||||||
* {@link MLText d:mltext} property types, otherwise <tt>false</tt>.
|
* {@link MLText d:mltext} property types, otherwise <tt>false</tt>.
|
||||||
|
* @return
|
||||||
|
* <tt>true</tt> if the current transaction is ML aware
|
||||||
*/
|
*/
|
||||||
static public void setMLAware(boolean mlAwareVal)
|
static public boolean setMLAware(boolean mlAwareVal)
|
||||||
{
|
{
|
||||||
mlAware.set(new Boolean(mlAwareVal));
|
boolean wasMLAware = isMLAware();
|
||||||
|
mlAware.set(Boolean.valueOf(mlAwareVal));
|
||||||
|
return wasMLAware;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user