lumis.portal.theme
Class ThemeUtil

Package class diagram package ThemeUtil
java.lang.Object
  extended by lumis.portal.theme.ThemeUtil

public class ThemeUtil
extends Object

Utility class for theme related actions.

Since:
7.0.0

Constructor Summary
ThemeUtil()
           
 
Method Summary
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 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: <the path of the theme where the resource was found><the resource folder><the resource path> If the resource was not found, the original one will be returned
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><the path of the theme where the resource was found><the resource path> (where <theme www prefix> is ThemeManager.THEME_WWW_RESOURCE_PREFIX) If the resource was not found, the original one will be returned
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThemeUtil

public ThemeUtil()
Method Detail

getThemeIdByPath

public static String getThemeIdByPath(String path)
                               throws lumis.portal.theme.InvalidThemePathException
Returns the theme identifier of the given theme path.

Parameters:
path - the path.
Returns:
the theme identifier of the given theme path.
Throws:
InvalidThemePathException - if the given path is null.
InvalidThemePathException - if the trimmed version of the given path is empty.
Since:
7.0.0

getThemePathById

public static String getThemePathById(String themeId)
                               throws lumis.portal.theme.InvalidThemeIdException
Returns the theme path of the given theme identifier.

Parameters:
themeId - the theme identifier.
Returns:
the theme path of the given theme identifier.
Throws:
InvalidThemeIdException - if the given identifier is null.
InvalidThemeIdException - if the given identifier is empty.
Since:
7.0.0

resolveWWWResourcePath

public static String resolveWWWResourcePath(String resourcePath,
                                            List<? extends ITheme> themes)
                                     throws PortalException
Resolves the resources' paths with the given applied themes applying the following rules:
  1. If the resource path start with no theme prefix, then the returned resource path will be the original one without the prefix
  2. If the appliedThemes parameter is null or if it is empty the original resource path will be returned
  3. The given resource will be searched through the applied themes' resource (under IThemeSPI.ResourceFolder.WWW)
    1. If the resource was found in any applied theme, the resolved resource will be compound as: <theme www prefix><the path of the theme where the resource was found><the resource path> (where <theme www prefix> is ThemeManager.THEME_WWW_RESOURCE_PREFIX)
    2. If the resource was not found, the original one will be returned

Parameters:
resourcePath - the requested resource path.
themes - the applied themes.
Returns:
the resolved resource path as described above.
Throws:
NullPointerException - if the resourcePath is null or if the resourceFolder is null.
PortalException
Since:
7.0.0

resolveLayoutFilePath

public static String resolveLayoutFilePath(String layoutFilePath,
                                           List<? extends ITheme> themes)
                                    throws PortalException
Resolves the layout file path with the given applied themes applying the following rules:
  1. If the appliedThemes parameter is null or if it is empty the original resource path will be returned
  2. The given resource will be searched through the applied themes' resource (under IThemeSPI.ResourceFolder.DEF)
    1. If the resource was found in any applied theme, the resolved resource will be compound as: <the path of the theme where the resource was found><the resource folder><the resource path>
    2. If the resource was not found, the original one will be returned

Parameters:
layoutFilePath - the layout file path to be resolved.
themes - the applied themes.
Returns:
the resolved layout file path as described above.
Throws:
NullPointerException - if the resourcePath is null or if the resourceFolder is null.
PortalException
Since:
7.0.0


Lumisportal  7.0.0.121130 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.