Class DynamicPortalLayoutService

java.lang.Object
org.exoplatform.portal.config.DynamicPortalLayoutService
All Implemented Interfaces:
org.picocontainer.Startable

public class DynamicPortalLayoutService extends Object implements org.picocontainer.Startable
A Service to make displayed sites Portal Layout dynamic switch configurations. This service will be used in front-end services to make displayed site layout more dynamic and relying on stored site layout only.
  • Constructor Details

    • DynamicPortalLayoutService

      public DynamicPortalLayoutService(org.exoplatform.container.configuration.ConfigurationManager configurationManager, org.exoplatform.portal.mop.service.LayoutService dataStorage, org.exoplatform.container.xml.InitParams params)
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface org.picocontainer.Startable
    • stop

      public void stop()
      Specified by:
      stop in interface org.picocontainer.Startable
    • addDynamicLayoutMatcher

      public void addDynamicLayoutMatcher(DynamicPortalLayoutMatcherPlugin dynamicPortalLayoutMatcherPlugin)
      A method to inject DynamicPortalLayoutMatcherPlugin by IOC.
      Parameters:
      dynamicPortalLayoutMatcherPlugin - plugin of type ComponentPlugin to inject
    • getDynamicLayoutMatchers

      public List<DynamicPortalLayoutMatcherPlugin> getDynamicLayoutMatchers()
      Returns:
      unmodifiable List of DynamicPortalLayoutMatcherPlugin ordered by ComponentPlugin.getPriority()). The returned elements are unique using ComponentPlugin.getName()).
    • getPortalConfigWithDynamicLayout

      public org.exoplatform.portal.config.model.PortalConfig getPortalConfigWithDynamicLayout(org.exoplatform.portal.mop.SiteKey siteKey, String currentPortalSiteName) throws Exception
      Computes the Portal Layout container to use when displaying site designated with siteKey parameter. The Portal Layout container is computed using components plugins of type DynamicPortalLayoutMatcherPlugin that will use matchers inheriting from DynamicPortalLayoutMatcher to produce the portal layout to use for the currently diplaying siteKey.
      Parameters:
      siteKey - mandatory site key of site to display
      currentPortalSiteName - last displayed site of type PORTAL
      Returns:
      PortalConfig with modified dynamic layout if matching, else the stored PortalConfig of siteKey as it is.
      Throws:
      Exception - when an error occurs while retrieving PortalConfig of current portal site or current site designated by siteKey parameter.