Class UIExtensionManagerImpl

java.lang.Object
org.exoplatform.webui.ext.impl.UIExtensionManagerImpl
All Implemented Interfaces:
UIExtensionManager

public class UIExtensionManagerImpl extends Object implements UIExtensionManager
The default implementation of an extension manager Created by The eXo Platform SAS Author : eXoPlatform nicolas.filotto@exoplatform.com May 04, 2009
  • Constructor Details

    • UIExtensionManagerImpl

      public UIExtensionManagerImpl()
  • Method Details

    • accept

      public boolean accept(String extensionType, String extensionName, Map<String,Object> context)
      Checks if all the filters pass, if one filter doesn't pass the method UIExtension.onDeny will be called
      Specified by:
      accept in interface UIExtensionManager
      Parameters:
      extensionType - the type of the extension, usually it is the FQN of the component that displays the extension
      extensionName - the name of the extension to add
      context - the context to check
      Returns:
      true if all the filter could pass, false otherwise
    • addUIExtension

      public org.exoplatform.webui.core.UIComponent addUIExtension(String extensionType, String extensionName, Map<String,Object> context, org.exoplatform.webui.core.UIContainer parent) throws Exception
      First check if the given extension exists, if so it checks if the extension can be added according (all filters that are mandatory) to the given context, if so it adds the extension to the parent and returns the extension otherwise it returns null
      Specified by:
      addUIExtension in interface UIExtensionManager
      Parameters:
      extensionType - the type of the extension, usually it is the FQN of the component that displays the extension
      extensionName - the name of the extension to add
      context - the context to check in order to know if the extension can be added
      parent - the parent component to which the extension must be added
      Returns:
      the component related to the extension if it can be added, null otherwise
      Throws:
      Exception - if an error occurs
    • addUIExtension

      public org.exoplatform.webui.core.UIComponent addUIExtension(UIExtension extension, Map<String,Object> context, org.exoplatform.webui.core.UIContainer parent) throws Exception
      It checks if the extension can be added (all filters that are mandatory) according to the given context, if so it adds the extension to the parent and returns the extension otherwise it returns null
      Specified by:
      addUIExtension in interface UIExtensionManager
      Parameters:
      extension - the extension to add
      context - the context to check in order to know if the extension can be added
      parent - the parent component to which the extension must be added
      Returns:
      the component related to the extension if it can be added, null otherwise
      Throws:
      Exception - if an error occurs
    • registerUIExtensionPlugin

      public void registerUIExtensionPlugin(UIExtensionPlugin extensionPlugin)
      Register all the extensions defined into the UIExtensionPlugin
      Specified by:
      registerUIExtensionPlugin in interface UIExtensionManager
      Parameters:
      extensionPlugin - the plugin to treat
    • registerUIExtension

      public void registerUIExtension(UIExtension extension)
      Register a new extension
      Specified by:
      registerUIExtension in interface UIExtensionManager
      Parameters:
      extension - the extension to register
    • getUIExtensions

      public List<UIExtension> getUIExtensions(String type)
      Gives all the extensions related to the given type
      Specified by:
      getUIExtensions in interface UIExtensionManager
      Parameters:
      type - the type of the extension, usually it is the FQN of the component that displays the extension
      Returns:
      a list of all the extensions that belongs to the given owner
    • getUIExtension

      public UIExtension getUIExtension(String type, String name)
      Give the extension corresponding to the given criteria
      Specified by:
      getUIExtension in interface UIExtensionManager
      Parameters:
      type - the type of the extension, usually it is the FQN of the component that displays the extension
      name - the name of the extension to get
      Returns:
      the corresponding UIExtension if it exists, null otherwise
    • accept

      protected boolean accept(UIExtension extension, Map<String,Object> context, boolean checkOnly)
    • createComponentId

      protected String createComponentId(org.exoplatform.webui.core.UIContainer parent, String extensionName)