Class PageContainerBackgroundUpgradePlugin

java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.commons.upgrade.UpgradeProductPlugin
io.meeds.layout.plugin.upgrade.PageContainerBackgroundUpgradePlugin
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin

public class PageContainerBackgroundUpgradePlugin extends org.exoplatform.commons.upgrade.UpgradeProductPlugin
Removes a background color from the top-level containers of named pages, only where the stored color equals the one given in parameter, ignoring case. A page container color is painted over the page background set in Branding and Theme, so a color shipped by default on a page hides that branding setting. A stored color equal to the parameter cannot be told apart from the shipped one and is removed whoever set it; any other color is kept, and nested containers are not read. A page that changes is saved whole through LayoutService, which updates its existing containers and windows in place, keeping their ids.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class org.exoplatform.commons.upgrade.UpgradeProductPlugin

    asyncUpgradeExecution, executeOnlyOnce, OLD_PRODUCT_GROUP_ID, oldProductGroupId, PRODUCT_GROUP_ID, productGroupId, targetVersion, UPGRADE_COMPLETED_STATUS, UPGRADE_PLUGIN_ASYNC, UPGRADE_PLUGIN_ENABLE, UPGRADE_PLUGIN_EXECUTE_ONCE_PARAMETER, UPGRADE_PLUGIN_EXECUTION_ORDER, UPGRADE_PLUGIN_TARGET_PARAMETER

    Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin

    desc, name
  • Constructor Summary

    Constructors
    Constructor
    Description
    PageContainerBackgroundUpgradePlugin(org.exoplatform.commons.api.settings.SettingService settingService, org.exoplatform.portal.mop.service.LayoutService layoutService, org.exoplatform.container.xml.InitParams initParams)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    processUpgrade(String oldVersion, String newVersion)
     
    boolean
    shouldProceedToUpgrade(String newVersion, String previousVersion)
     
    boolean
    upgradePage(org.exoplatform.portal.mop.page.PageKey pageKey)
     

    Methods inherited from class org.exoplatform.commons.upgrade.UpgradeProductPlugin

    afterUpgrade, beforeUpgrade, equals, getPluginExecutionOrder, getProductGroupId, getTargetVersion, getValue, hashCode, isAsyncUpgradeExecution, isEnabled, isExecuteOnlyOnce, shouldProceedToUpgrade, storeValueForPlugin

    Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin

    getDescription, getName, setDescription, setName

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • PageContainerBackgroundUpgradePlugin

      public PageContainerBackgroundUpgradePlugin(org.exoplatform.commons.api.settings.SettingService settingService, org.exoplatform.portal.mop.service.LayoutService layoutService, org.exoplatform.container.xml.InitParams initParams)
  • Method Details

    • shouldProceedToUpgrade

      public boolean shouldProceedToUpgrade(String newVersion, String previousVersion)
      Overrides:
      shouldProceedToUpgrade in class org.exoplatform.commons.upgrade.UpgradeProductPlugin
    • processUpgrade

      public void processUpgrade(String oldVersion, String newVersion)
      Specified by:
      processUpgrade in class org.exoplatform.commons.upgrade.UpgradeProductPlugin
    • upgradePage

      public boolean upgradePage(org.exoplatform.portal.mop.page.PageKey pageKey)
      Parameters:
      pageKey - the page to upgrade
      Returns:
      true when the page was saved without its container background color