org.alfresco.repo.node
Class MLPropertyInterceptor

java.lang.Object
  extended by 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.MethodInterceptor

Interceptor 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 text has been passed in, this will be allowed to pass.

See Also:
org.alfresco.service.cmr.repository.MLText#getContextLocale(), NodeService.getProperty(NodeRef, QName), NodeService.getProperties(NodeRef), NodeService.setProperty(NodeRef, QName, Serializable), NodeService.setProperties(NodeRef, Map)

Constructor Summary
MLPropertyInterceptor()
           
 
Method Summary
 java.util.Locale getClosestLocale(java.util.Collection collection, java.util.Locale locale)
           
 java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
           
static boolean isMLAware()
           
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
static boolean setMLAware(boolean mlAwareVal)
          Change the filtering behaviour of this interceptor on the curren thread.
 void setMultilingualContentService(MultilingualContentService multilingualContentService)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService bean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MLPropertyInterceptor

public MLPropertyInterceptor()
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 handle d:mltext property 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:mltext types 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:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
java.lang.Throwable

getClosestLocale

public java.util.Locale getClosestLocale(java.util.Collection collection,
                                         java.util.Locale locale)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.