Package org.alfresco.repo.node
Class MLPropertyInterceptor
- java.lang.Object
-
- org.alfresco.repo.node.MLPropertyInterceptor
-
- All Implemented Interfaces:
org.aopalliance.aop.Advice,org.aopalliance.intercept.Interceptor,org.aopalliance.intercept.MethodInterceptor
public class MLPropertyInterceptor extends java.lang.Object implements org.aopalliance.intercept.MethodInterceptorInterceptor to filter out multilingual text properties from getter methods and transform to multilingual text for setter methods.This interceptor ensures that all multilingual (ML) text is transformed to the locale chosen for the request for getters and transformed to the default locale type for setters.
Where
ML texthas been passed in, this will be allowed to pass.- Author:
- Derek Hulley, Philippe Dubois
- See Also:
NodeService.getProperty(NodeRef, QName),NodeService.getProperties(NodeRef),NodeService.setProperty(NodeRef, QName, Serializable),NodeService.setProperties(NodeRef, Map)
-
-
Constructor Summary
Constructors Constructor Description MLPropertyInterceptor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.LocalegetClosestLocale(java.util.Collection<?> collection)java.lang.Objectinvoke(org.aopalliance.intercept.MethodInvocation invocation)static booleanisMLAware()voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)static booleansetMLAware(boolean mlAwareVal)Change the filtering behaviour of this interceptor on the curren thread.voidsetMultilingualContentService(MultilingualContentService multilingualContentService)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService bean)
-
-
-
Method Detail
-
setMLAware
public static boolean setMLAware(boolean mlAwareVal)
Change the filtering behaviour of this interceptor on the curren thread. Use this to switch off the filtering and just pass out properties as handed out of the node service.- Parameters:
mlAwareVal- true if the current thread is able to handled:mltextproperty types, otherwise false.- Returns:
- true if the current transaction is ML aware
-
isMLAware
public static boolean isMLAware()
- Returns:
- Returns true if the current thread has marked itself
as being able to handle
d:mltexttypes properly.
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService bean)
-
setMultilingualContentService
public void setMultilingualContentService(MultilingualContentService multilingualContentService)
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
-
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws java.lang.Throwable- Specified by:
invokein interfaceorg.aopalliance.intercept.MethodInterceptor- Throws:
java.lang.Throwable
-
getClosestLocale
public java.util.Locale getClosestLocale(java.util.Collection<?> collection)
-
-