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 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.

Author:
Derek Hulley, Philippe Dubois
See Also:
  • Constructor Details

    • MLPropertyInterceptor

      public MLPropertyInterceptor()
  • Method Details

    • 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(NodeService bean)
    • setMultilingualContentService

      public void setMultilingualContentService(MultilingualContentService multilingualContentService)
    • setDictionaryService

      public void setDictionaryService(DictionaryService dictionaryService)
    • invoke

      public Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
      Specified by:
      invoke in interface org.aopalliance.intercept.MethodInterceptor
      Throws:
      Throwable
    • getClosestLocale

      public Locale getClosestLocale(Collection<?> collection)