Class NewPortalConfigListener

java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.portal.config.NewPortalConfigListener
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin

public class NewPortalConfigListener extends org.exoplatform.container.component.BaseComponentPlugin
Created by The eXo Platform SARL Author : Tuan Nguyen tuan08@users.sourceforge.net May 22, 2006
  • Constructor Details

    • NewPortalConfigListener

      public NewPortalConfigListener(UserPortalConfigService owner, org.exoplatform.portal.mop.service.LayoutService layoutService, org.exoplatform.container.configuration.ConfigurationManager cmanager, org.exoplatform.container.xml.InitParams params, org.exoplatform.portal.mop.service.NavigationService navigationService, org.exoplatform.portal.mop.storage.DescriptionStorage descriptionStorage, UserACL userACL, org.exoplatform.services.resources.LocaleConfigService localeConfigService)
  • Method Details

    • run

      public void run() throws Exception
      Throws:
      Exception
    • getPortalConfig

      public NewPortalConfig getPortalConfig(String type, String name)
    • getPortalConfigs

      public List<NewPortalConfig> getPortalConfigs(String type, String name)
    • mergePlugin

      public void mergePlugin(NewPortalConfigListener other)
      This is used to merge an other NewPortalConfigListener to this one
      Parameters:
      other -
    • initPortalConfigDB

      public void initPortalConfigDB(NewPortalConfig ele, boolean prepareImport)
    • initPortalConfigDB

      public void initPortalConfigDB(NewPortalConfig ele, boolean prepareImport, Consumer<org.exoplatform.portal.config.model.PortalConfig> beforeImport)
      Parameters:
      ele - the sites configuration of an extension
      prepareImport - true to import the sites even when the configuration doesn't override them
      beforeImport - applied to each site configuration before it's imported, null to import it as is
    • initPortalConfigDB

      public void initPortalConfigDB(NewPortalConfig config)
    • initPageDB

      public void initPageDB(NewPortalConfig ele, boolean prepareImport)
    • initPageDB

      public void initPageDB(NewPortalConfig config)
    • initPageNavigationDB

      public void initPageNavigationDB(NewPortalConfig ele, boolean prepareImport)
    • initPageNavigationDB

      public void initPageNavigationDB(NewPortalConfig config)
    • importSiteLayout

      public void importSiteLayout(List<NewPortalConfig> configs, String owner, org.exoplatform.portal.mop.importer.ImportMode importMode, Consumer<org.exoplatform.portal.config.model.PortalConfig> beforeImport)
      Imports the site layout of each configuration of a site with the given import mode.
      Parameters:
      configs - the configurations of the site
      owner - the site name
      importMode - the import mode
      beforeImport - applied to each site configuration before it's imported, null to import it as is
    • importSitePages

      public void importSitePages(List<NewPortalConfig> configs, String owner, org.exoplatform.portal.mop.importer.ImportMode importMode)
      Imports the pages of each configuration of a site with the given import mode. An overwrite removes the pages that no configuration defines first, then the pages of each configuration are imported in place, so that a configuration doesn't remove the pages of the others, and the pages keep the navigation nodes of other sites that reference them. The pages are imported whether or not the site was imported at startup.
      Parameters:
      configs - the configurations of the site
      owner - the site name
      importMode - the import mode
    • importSiteNavigation

      public void importSiteNavigation(List<NewPortalConfig> configs, String owner, org.exoplatform.portal.mop.importer.ImportMode importMode)
      Imports the navigation of each configuration of a site with the given import mode. The navigation of each configuration is imported without removing any node, then the nodes that no configuration defines are removed as the import mode does, so that a configuration doesn't remove the nodes of the others.
      Parameters:
      configs - the configurations of the site
      owner - the site name
      importMode - the import mode
    • createPortalConfig

      public boolean createPortalConfig(NewPortalConfig config, String owner)
    • createPage

      public void createPage(NewPortalConfig config, String owner)
    • restorePage

      public boolean restorePage(NewPortalConfig config, String owner, String pageName, org.exoplatform.portal.mop.importer.ImportMode importMode)
      Restores a single page's layout from its packaged default configuration, leaving every other page and the navigation tree untouched.
      Parameters:
      config - the packaged config fragment to look up the default page in
      owner - the site owner name
      pageName - the name of the page to restore
      importMode - the import mode to apply to the matched page
      Returns:
      true if this fragment defines a default page named pageName and it was restored, false if this fragment doesn't define that page
    • hasDefaultPage

      public boolean hasDefaultPage(NewPortalConfig config, String owner, String pageName)
      Checks whether the given packaged config fragment defines a default page named pageName, without performing any import. This mirrors the lookup done by restorePage(NewPortalConfig, String, String, ImportMode) but leaves the page untouched.
      Parameters:
      config - the packaged config fragment to look up the default page in
      owner - the site owner name
      pageName - the name of the page to look up
      Returns:
      true if this fragment defines a default page named pageName
    • createPageNavigation

      public void createPageNavigation(NewPortalConfig config, String owner)
    • getConfig

      public <T> org.exoplatform.portal.config.model.UnmarshalledObject<T> getConfig(NewPortalConfig config, String portalName, String fileName, Class<T> objectType)
      Best effort to load and unmarshall a configuration.
      Type Parameters:
      T - the generic type to unmarshall to
      Parameters:
      config - the config object
      portalName - the owner
      fileName - the file name
      objectType - the type to unmarshall to
      Returns:
      the xml of the config or null
    • getConfig

      public <T> T getConfig(String portalType, String portalName, Class<T> objectType, String parentLocation)
    • getConfig

      public <T> org.exoplatform.portal.config.model.UnmarshalledObject<T> getConfig(String portalType, String portalName, Class<T> objectType, String fileName, String parentLocation)
    • getConfig

      public <T> org.exoplatform.portal.config.model.UnmarshalledObject<T> getConfig(String portalType, String portalName, Class<T> objectType, String fileName, String parentLocation, String templateName)
    • getConfig

      public <T> org.exoplatform.portal.config.model.UnmarshalledObject<T> getConfig(String portalName, String portalType, Class<T> objectType, String parentLocation, List<String> relativePaths)
    • getConfig

      public String getConfig(String location, String path)
    • getTemplateConfig

      @Deprecated(forRemoval=true, since="7.0") public String getTemplateConfig(String type, String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Site Templates has been changed to be stored in database to make it dynamically managed by UI rather than statis pages and navigation from source files
      Parameters:
      type -
      name -
      Returns:
    • getTemplateConfigs

      @Deprecated(forRemoval=true, since="7.0") public Set<String> getTemplateConfigs(String siteType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Site Templates has been changed to be stored in database to make it dynamically managed by UI rather than statis pages and navigation from source files
      Get all template configurations
      Parameters:
      siteType - (portal, group, user)
      Returns:
      set of template name