Package lumis.portal.theme
Class ThemeManager
- java.lang.Object
-
- lumis.portal.theme.ThemeManager
-
- All Implemented Interfaces:
IThemeManagerSPI
public class ThemeManager extends java.lang.Object implements IThemeManagerSPI
Implements theme related operations.- Since:
- 7.0.0
- Version:
- $Revision: 25159 $ $Date: 2022-07-31 15:54:42 -0300 (Sun, 31 Jul 2022) $
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
APPLIED_THEME_PROPERTY_BAG_NAME
Applied themes property bag name.static java.lang.String
BASE_THEME_PREFIX
Base theme prefixlum_basetheme/
.static java.lang.String
CLASSIC_THEME_ID
The classic theme identifier.static java.lang.String
LUMIS_PORTAL_7_0_THEME_ID
The Lumis Portal 7.0 theme identifier.static java.lang.String
LUMIS_PORTAL_9_0_THEME_ID
The Lumis Portal 9.0 theme identifier.static java.lang.String
LUMIS_PORTAL_ADMIN_THEME_ID
The Lumis Portal 7.0 theme identifier.static java.lang.String
NO_THEME_PREFIX
No theme prefixlum_notheme/
.static java.lang.String
THEME_DEFINITION_FILE
The theme definition file name.static java.lang.String
THEME_WWW_RESOURCE_PREFIX
The WWW resource prefixlumis-theme/
.
-
Constructor Summary
Constructors Constructor Description ThemeManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyThemesFilesToWebRoots(java.util.Collection<? extends ITheme> themes, java.util.Collection<IWebRootPortalBaseFolder> webRoots)
Copies the given themes' WWW resources to the given web root folders.java.util.Collection<ITheme>
getAllThemes()
Returns all existent themes.java.util.List<java.lang.String>
getAppliedThemesIds(ChannelConfig channel)
Return the applied themes (identifiers) in the given channel.java.util.List<java.lang.String>
getAppliedThemesIds(PageConfig page)
Returns the applied themes (identifiers) in the given page.ThemeUsageConfig
getLocalThemes(ChannelConfig channel, java.lang.String runtimeInterfaceId)
Returns thetheme usage
for the given channel.ThemeUsageConfig
getLocalThemes(PageConfig page, java.lang.String runtimeInterfaceId)
Returns thetheme usage
for the given page.IThemeSPI
getTheme(java.lang.String themeId)
Returns the theme with the given identifier.java.util.List<ITheme>
getThemes(java.util.List<java.lang.String> appliedThemeIds)
Returns the applied themes from an applied themes identifiers list.java.util.List<ITheme>
getThemes(WebResource webResource)
Returns the applied themes in the given web resource.void
register(java.lang.String themePath)
Registers a theme in the specified classpath relative path.void
removeThemeFolderFromWebRoots(java.util.Collection<? extends ITheme> themes, java.util.Collection<IWebRootPortalBaseFolder> webRoots)
Removes the given themes' folders from the given web root folders.void
unregister(java.lang.String themeId)
Unregisters a theme, removing it from the themes registry.void
unregister(java.lang.String themeId, boolean verifyUsage)
Unregisters a theme, removing it from the themes registry.void
updateLocalThemeUsage(ChannelConfig channel, ThemeUsageConfig themeUsage)
Updates thetheme usage
for the given channel.void
updateLocalThemeUsage(PageConfig page, ThemeUsageConfig themeUsage)
Updates thetheme usage
for the given page.
-
-
-
Field Detail
-
THEME_DEFINITION_FILE
public static final java.lang.String THEME_DEFINITION_FILE
The theme definition file name.- Since:
- 7.0.0
- See Also:
- Constant Field Values
-
APPLIED_THEME_PROPERTY_BAG_NAME
public static final java.lang.String APPLIED_THEME_PROPERTY_BAG_NAME
Applied themes property bag name.- Since:
- 7.0.0
- See Also:
- Constant Field Values
-
BASE_THEME_PREFIX
public static final java.lang.String BASE_THEME_PREFIX
Base theme prefixlum_basetheme/
.- Since:
- 7.0.0
- See Also:
- Constant Field Values
-
NO_THEME_PREFIX
public static final java.lang.String NO_THEME_PREFIX
No theme prefixlum_notheme/
.- Since:
- 7.0.0
- See Also:
- Constant Field Values
-
THEME_WWW_RESOURCE_PREFIX
public static final java.lang.String THEME_WWW_RESOURCE_PREFIX
The WWW resource prefixlumis-theme/
.- Since:
- 7.0.0
- See Also:
- Constant Field Values
-
CLASSIC_THEME_ID
public static final java.lang.String CLASSIC_THEME_ID
The classic theme identifier.- Since:
- 7.0.0
- See Also:
- Constant Field Values
-
LUMIS_PORTAL_7_0_THEME_ID
public static final java.lang.String LUMIS_PORTAL_7_0_THEME_ID
The Lumis Portal 7.0 theme identifier.- Since:
- 7.1.0
- See Also:
- Constant Field Values
-
LUMIS_PORTAL_9_0_THEME_ID
public static final java.lang.String LUMIS_PORTAL_9_0_THEME_ID
The Lumis Portal 9.0 theme identifier.- Since:
- 10.0.0
- See Also:
- Constant Field Values
-
LUMIS_PORTAL_ADMIN_THEME_ID
public static final java.lang.String LUMIS_PORTAL_ADMIN_THEME_ID
The Lumis Portal 7.0 theme identifier.- Since:
- 7.1.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
register
public void register(java.lang.String themePath) throws PortalException
Description copied from interface:IThemeManagerSPI
Registers a theme in the specified classpath relative path.The theme will be added or updated in the themes registry.
- Specified by:
register
in interfaceIThemeManagerSPI
- Parameters:
themePath
- the relative path in the classpath, referencing the folder that contains thethemedefintion.xml
file.- Throws:
PortalException
- if an error occurs during register.
-
unregister
public void unregister(java.lang.String themeId) throws PortalException
Description copied from interface:IThemeManagerSPI
Unregisters a theme, removing it from the themes registry.- Specified by:
unregister
in interfaceIThemeManagerSPI
- Parameters:
themeId
- the theme identifier.- Throws:
PortalException
- if an error occurs during unregister.
-
unregister
public void unregister(java.lang.String themeId, boolean verifyUsage) throws PortalException
Unregisters a theme, removing it from the themes registry.- Parameters:
themeId
- the theme identifier.verifyUsage
- indicates whether the theme usage must be done.- Throws:
PortalException
- Since:
- 7.0.0
-
getTheme
public IThemeSPI getTheme(java.lang.String themeId) throws PortalException
Description copied from interface:IThemeManagerSPI
Returns the theme with the given identifier.- Specified by:
getTheme
in interfaceIThemeManagerSPI
- Parameters:
themeId
- the theme identifier.- Returns:
- the theme.
- Throws:
PortalObjectNotFoundException
- if no theme exists with the given identifier.PortalException
- if an error occurred while obtaining the theme.
-
getAppliedThemesIds
public java.util.List<java.lang.String> getAppliedThemesIds(ChannelConfig channel) throws PortalException
Return the applied themes (identifiers) in the given channel.- Parameters:
channel
- the channel.- Returns:
- the applied themes in the given channel.
- Throws:
PortalException
- Since:
- 7.0.0
-
getAppliedThemesIds
public java.util.List<java.lang.String> getAppliedThemesIds(PageConfig page) throws PortalException
Returns the applied themes (identifiers) in the given page.- Parameters:
page
- the page.- Returns:
- the applied themes in the given page.
- Throws:
PortalException
- Since:
- 7.0.0
-
getThemes
public java.util.List<ITheme> getThemes(WebResource webResource) throws PortalException
Returns the applied themes in the given web resource. Ignores the inexistent themes.- Parameters:
webResource
- the web resource.- Returns:
- the applied themes in the given web resource.
- Throws:
PortalException
- Since:
- 11.0.0
-
getThemes
public java.util.List<ITheme> getThemes(java.util.List<java.lang.String> appliedThemeIds) throws PortalException
Returns the applied themes from an applied themes identifiers list. Ignores the inexistent themes.- Parameters:
appliedThemeIds
- the applied themes identifiers list.- Returns:
- the applied themes from an applied themes identifiers list.
- Throws:
PortalException
- Since:
- 7.0.0
-
getLocalThemes
public ThemeUsageConfig getLocalThemes(PageConfig page, java.lang.String runtimeInterfaceId) throws PortalException
Returns thetheme usage
for the given page.- Parameters:
page
- the page.runtimeInterfaceId
- the runtime interface identifier being requested (if any).- Returns:
- the
theme usage
for the given page. - Throws:
PortalException
- Since:
- 7.0.0
-
getLocalThemes
public ThemeUsageConfig getLocalThemes(ChannelConfig channel, java.lang.String runtimeInterfaceId) throws PortalException
Returns thetheme usage
for the given channel.- Parameters:
channel
- the channel.runtimeInterfaceId
- the runtime interface identifier being requested (if any).- Returns:
- the
theme usage
for the given channel. - Throws:
PortalException
- Since:
- 7.0.0
-
updateLocalThemeUsage
public void updateLocalThemeUsage(PageConfig page, ThemeUsageConfig themeUsage) throws PortalException
Updates thetheme usage
for the given page.- Parameters:
page
- the page.themeUsage
- the theme usage.- Throws:
PortalException
- Since:
- 7.0.0
-
updateLocalThemeUsage
public void updateLocalThemeUsage(ChannelConfig channel, ThemeUsageConfig themeUsage) throws PortalException
Updates thetheme usage
for the given channel.- Parameters:
channel
- the channel.themeUsage
- the theme usage.- Throws:
PortalException
- Since:
- 7.0.0
-
copyThemesFilesToWebRoots
public void copyThemesFilesToWebRoots(java.util.Collection<? extends ITheme> themes, java.util.Collection<IWebRootPortalBaseFolder> webRoots) throws PortalException
Copies the given themes' WWW resources to the given web root folders.- Parameters:
themes
- the themes.webRoots
- the web root folders.- Throws:
PortalException
- Since:
- 7.0.0
-
removeThemeFolderFromWebRoots
public void removeThemeFolderFromWebRoots(java.util.Collection<? extends ITheme> themes, java.util.Collection<IWebRootPortalBaseFolder> webRoots) throws PortalException
Removes the given themes' folders from the given web root folders. If the remaining folder "lumis-theme" is empty after the themes' folders removal it will also be removed.- Parameters:
themes
- the themes.webRoots
- the web root folders.- Throws:
PortalException
- Since:
- 7.0.0
-
getAllThemes
public java.util.Collection<ITheme> getAllThemes() throws PortalException
Returns all existent themes. Does not use cache.- Specified by:
getAllThemes
in interfaceIThemeManagerSPI
- Returns:
- all existent themes.
- Throws:
PortalException
- Since:
- 7.0.0
-
-