Package org.exoplatform.portal.config
Class DynamicPortalLayoutMatcherPlugin
java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.portal.config.DynamicPortalLayoutMatcherPlugin
- All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
public class DynamicPortalLayoutMatcherPlugin
extends org.exoplatform.container.component.BaseComponentPlugin
A
ComponentPlugin to inject by IOC in order to customize site layout
to display in UI switch site properties.-
Field Summary
Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name -
Constructor Summary
ConstructorsConstructorDescriptionDynamicPortalLayoutMatcherPlugin(org.exoplatform.container.xml.InitParams params) -
Method Summary
Modifier and TypeMethodDescriptionorg.exoplatform.portal.config.model.Containerorg.exoplatform.portal.config.model.PortalConfiggetPortalConfigWithDynamicLayout(org.exoplatform.portal.mop.SiteKey siteKey, org.exoplatform.portal.config.model.PortalConfig sitePortalConfig, org.exoplatform.portal.config.model.PortalConfig currentSitePortalConfig) ReturnPortalConfigof siteKey parameter.voidinit(org.exoplatform.container.configuration.ConfigurationManager configurationManager) Retrieves layout to use for displaying site layout from configured file path using configured parameter layoutTemplatePath.booleanbooleanbooleanvoidsetDynamicLayoutMatcher(DynamicPortalLayoutMatcher dynamicLayoutMatcher) voidsetEnabled(boolean enabled) enables/disables pluginvoidsetLayoutTemplate(org.exoplatform.portal.config.model.Container layoutTemplatePortalConfig) voidsetUseCurrentPortalLayout(boolean useCurrentPortalLayout) Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
Constructor Details
-
DynamicPortalLayoutMatcherPlugin
public DynamicPortalLayoutMatcherPlugin(org.exoplatform.container.xml.InitParams params)
-
-
Method Details
-
getPortalConfigWithDynamicLayout
public org.exoplatform.portal.config.model.PortalConfig getPortalConfigWithDynamicLayout(org.exoplatform.portal.mop.SiteKey siteKey, org.exoplatform.portal.config.model.PortalConfig sitePortalConfig, org.exoplatform.portal.config.model.PortalConfig currentSitePortalConfig) ReturnPortalConfigof siteKey parameter. The portal layout of corresponding sitePortalConfig parameter will be changed switch configured matcher plugins.- Parameters:
siteKey- siteKey of currently displaying sitesitePortalConfig- site PortalConfig of currently displaying sitecurrentSitePortalConfig- used site PortalConfig of TYPE 'PORTAL' to use in layout computing- Returns:
PortalConfigwith modified portalLayout switch dynamic matchers. If not modified, return null.
-
init
public void init(org.exoplatform.container.configuration.ConfigurationManager configurationManager) Retrieves layout to use for displaying site layout from configured file path using configured parameter layoutTemplatePath. If no file path is configured, no specific layout will be used. If the file wasn't found or an error occurs while parsing or retrieving file content, the plugin will be disabled to avoid incoherent behavior.- Parameters:
configurationManager- used to retrieve files with Kernel path pattern (war:/..., jar:/...)
-
isInitialized
public boolean isInitialized()- Returns:
- true if init method has been called at least once, else false
-
isEnabled
public boolean isEnabled()- Returns:
- true if plugin is enabled
-
setEnabled
public void setEnabled(boolean enabled) enables/disables plugin- Parameters:
enabled- true to enabled, else false
-
isUseCurrentPortalLayout
public boolean isUseCurrentPortalLayout()- Returns:
- true if last displayed site of type PORTAL should be used to retrieve its layout
-
setUseCurrentPortalLayout
public void setUseCurrentPortalLayout(boolean useCurrentPortalLayout) - Parameters:
useCurrentPortalLayout- true to enabled using last displayed site layout of type PORTAL
-
getLayoutTemplatePath
- Returns:
- template
-
setLayoutTemplate
public void setLayoutTemplate(org.exoplatform.portal.config.model.Container layoutTemplatePortalConfig) -
getDynamicLayoutMatcher
-
setDynamicLayoutMatcher
-
getLayoutTemplate
public org.exoplatform.portal.config.model.Container getLayoutTemplate()
-