public class ThemeUtil extends Object
Constructor and Description |
---|
ThemeUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addNewTheme(String themeName,
String themeDescription,
String themePath,
String moduleId,
IResource resource) |
static String |
getThemeIdByPath(String path)
Returns the theme identifier of the given theme path.
|
static String |
getThemePathById(String themeId)
Returns the theme path of the given theme identifier.
|
static IFile |
getThemeRootDir(String themePath) |
static boolean |
isEditableTheme(String themeId)
Returns whether the given theme is editable.
|
static boolean |
isLumisTheme(ITheme theme)
Returns whether the given theme is one of the LumisPortal standard themes.
|
static String |
resolveDefinitionFilePath(String definitionFilePath,
List<? extends ITheme> themes)
Resolves the definition file path with the given applied themes applying the following rules:
If the appliedThemes parameter is null or if it is empty the original resource path will be returned
The given resource will be searched through the applied themes' resource (under IThemeSPI.ResourceFolder.DEF )If the resource was found in any applied theme, the resolved resource will be compound as: |
static String |
resolveLayoutFilePath(String layoutFilePath,
List<? extends ITheme> themes)
Resolves the layout file path with the given applied themes applying the following rules:
If the appliedThemes parameter is null or if it is empty the original resource path will be returned
The given resource will be searched through the applied themes' resource (under IThemeSPI.ResourceFolder.DEF )If the resource was found in any applied theme, the resolved resource will be compound as: |
static String |
resolveWWWResourcePath(String resourcePath,
List<? extends ITheme> themes)
Resolves the resources' paths with the given applied themes applying the following rules:
If the resource path start with no theme prefix , then the returned resource path will be the original one without the
prefix
If the appliedThemes parameter is null or if it is empty the original resource path will be returned
The given resource will be searched through the applied themes' resource (under IThemeSPI.ResourceFolder.WWW )If the resource was found in any applied theme, the resolved resource will be compound as: <theme www prefix> is ThemeManager.THEME_WWW_RESOURCE_PREFIX )
If the resource was not found, the original one will be returned
|
public static String getThemeIdByPath(String path) throws lumis.portal.theme.InvalidThemePathException
path
- the path.InvalidThemePathException
- if the given path is null.InvalidThemePathException
- if the trimmed version of the given path is empty.public static String getThemePathById(String themeId) throws lumis.portal.theme.InvalidThemeIdException
themeId
- the theme identifier.InvalidThemeIdException
- if the given identifier is null.InvalidThemeIdException
- if the given identifier is empty.public static String resolveWWWResourcePath(String resourcePath, List<? extends ITheme> themes) throws PortalException
no theme prefix
, then the returned resource path will be the original one without the
prefixappliedThemes
parameter is null
or if it is empty the original resource path will be returnedIThemeSPI.ResourceFolder.WWW
)<theme www prefix>
is ThemeManager.THEME_WWW_RESOURCE_PREFIX
)resourcePath
- the requested resource path.themes
- the applied themes.NullPointerException
- if the resourcePath
is null
or if the resourceFolder
is null
.PortalException
public static String resolveLayoutFilePath(String layoutFilePath, List<? extends ITheme> themes) throws PortalException
appliedThemes
parameter is null
or if it is empty the original resource path will be returnedIThemeSPI.ResourceFolder.DEF
)layoutFilePath
- the layout file path to be resolved.themes
- the applied themes.NullPointerException
- if the resourcePath
is null
or if the resourceFolder
is null
.PortalException
public static String resolveDefinitionFilePath(String definitionFilePath, List<? extends ITheme> themes) throws PortalException
appliedThemes
parameter is null
or if it is empty the original resource path will be returnedIThemeSPI.ResourceFolder.DEF
)definitionFilePath
- the definition file path to be resolved.themes
- the applied themes.NullPointerException
- if the resourcePath
is null
or if the resourceFolder
is null
.PortalException
public static IFile getThemeRootDir(String themePath) throws PortalException
PortalException
public static void addNewTheme(String themeName, String themeDescription, String themePath, String moduleId, IResource resource) throws PortalException
PortalException
public static boolean isLumisTheme(ITheme theme)
theme
- the themepublic static boolean isEditableTheme(String themeId) throws PortalException
themeId
- the theme identifiertrue
if the given theme is editable.false
otherwise.PortalException
LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.