planetj.dataengine.theme
Class ThemeManager

java.lang.Object
  |
  +--planetj.dataengine.theme.ThemeManager
All Implemented Interfaces:
ITheme

public class ThemeManager
extends Object
implements ITheme

Manages instances of Themes. Provides data access methods and data generation methods.

Author:
PlanetJ Corp.

Field Summary
static String DEFAULT_THEME_TABLE_NAME
           
 
Fields inherited from interface planetj.dataengine.theme.ITheme
CSS_FILE, DEFAULT_THEME_ID, DESCRIPTION, OWNER_ID, PROPERTIES, SECURITY_ID, THEME, THEME_ID, TYPE, TYPE_DEFAULT
 
Method Summary
 Theme createTheme(String metaDataAlias, Map values)
          Creates a Theme using the given values.
 void createThemeTable(String systemAlias)
          Creates a Theme table in the givin database.
 Theme getDefaultTheme(String metaDataAlias, List columnNames)
          Gets the Default Theme.
 String getLibraryName()
          Gets the library containing the application table
 Theme getNonCachedTheme(String metaDataAlias, int id, List columnNames)
          Gets a Theme by ID out of the DB (the cache is not checked).
 Theme getTheme(Application application, List columnNames)
          Gets a Theme associated with the given Application.
 Theme getTheme(String metaDataAlias, int id, List columnNames)
          Gets a Theme by ID.
 RowCollection getThemes(String metaDataAlias, int ownerId, List columnNames)
          Gets a RowCollection of all Theme objects available to the specified owner.
 RowCollection getThemes(String metaDataAlias, List columnNames)
          Gets a RowCollection of all Theme objects available to all owners.
 Table getThemeTable(String metaDataAlias)
          Gets the Theme Table Object.
 String getThemeTableName()
          Gets the name of the table containing theme information (the default name is THEME).
static void setSingleton(ThemeManager newSingleton)
          Allows a subclass of the ThemeManager to be set as the singleton instance.
 void setThemeTableName(String themeTableName)
          Sets the name of the table containing theme information (the default name is THEME).
static ThemeManager singleton()
          Gets the singleton instance of the ThemeManager
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_THEME_TABLE_NAME

public static final String DEFAULT_THEME_TABLE_NAME
See Also:
Constant Field Values
Method Detail

createTheme

public Theme createTheme(String metaDataAlias,
                         Map values)
                  throws CMException
Creates a Theme using the given values.

Parameters:
metaDataAlias - Alias of the system containing the table of themes
values - Map of values for the newly created Theme.
Returns:
Theme
CMException

createThemeTable

public void createThemeTable(String systemAlias)
                      throws CMException
Creates a Theme table in the givin database.

Parameters:
systemAlias - The alias of the system to create the Theme table in.
CMException

getDefaultTheme

public Theme getDefaultTheme(String metaDataAlias,
                             List columnNames)
                      throws CMException
Gets the Default Theme.

Parameters:
metaDataAlias - Alias of the system containing the table of themes.
columnNames - Names of the columns to retrieve. If null, all columns will be retrieved.
Returns:
Theme
CMException

getLibraryName

public String getLibraryName()
Gets the library containing the application table


getNonCachedTheme

public Theme getNonCachedTheme(String metaDataAlias,
                               int id,
                               List columnNames)
                        throws CMException
Gets a Theme by ID out of the DB (the cache is not checked).

Parameters:
metaDataAlias - Alias of the system containing the table of themes.
id - Id of the theme to retrieve.
columnNames - Names of the columns to retrieve. If null, all columns will be retrieved.
Returns:
Theme
CMException

getTheme

public Theme getTheme(String metaDataAlias,
                      int id,
                      List columnNames)
               throws CMException
Gets a Theme by ID.

Parameters:
metaDataAlias - Alias of the system containing the table of themes.
id - Id of the theme to retrieve.
columnNames - Names of the columns to retrieve. If null, all columns will be retrieved.
Returns:
Theme
CMException

getTheme

public Theme getTheme(Application application,
                      List columnNames)
               throws CMException
Gets a Theme associated with the given Application.

Parameters:
application - Application object to retrieve Theme for.
columnNames - Names of columns to retrieve. If null, all columns are retrieved.
Returns:
Theme
CMException

getThemes

public RowCollection getThemes(String metaDataAlias,
                               int ownerId,
                               List columnNames)
                        throws CMException
Gets a RowCollection of all Theme objects available to the specified owner.

Parameters:
metaDataAlias - Alias of the system containing the table of themes.
ownerId - Id of owner for themes to retrieve for.
columnNames - Names of the columns to retrieve. If null, all columns will be retrieved.
CMException

getThemes

public RowCollection getThemes(String metaDataAlias,
                               List columnNames)
                        throws CMException
Gets a RowCollection of all Theme objects available to all owners.

Parameters:
metaDataAlias - Alias of the system containing the table of themes.
columnNames - Names of the columns to retrieve. If null, all columns will be retrieved.
CMException

getThemeTable

public Table getThemeTable(String metaDataAlias)
Gets the Theme Table Object.

Parameters:
metaDataAlias - Alias of system to get the Theme Table from.
Returns:
Theme Table

getThemeTableName

public String getThemeTableName()
Gets the name of the table containing theme information (the default name is THEME).

Returns:
name of theme table

setSingleton

public static void setSingleton(ThemeManager newSingleton)
Allows a subclass of the ThemeManager to be set as the singleton instance. The singleton instance isn't synchronized, so this method must be invoked before the singleton is accessed.

Parameters:
newSingleton - ThemeManager to set as singleton instance

setThemeTableName

public void setThemeTableName(String themeTableName)
Sets the name of the table containing theme information (the default name is THEME). This method should only be invoked during initialization.

Parameters:
themeTableName - Name of table containing theme information.

singleton

public static ThemeManager singleton()
Gets the singleton instance of the ThemeManager

Returns:
ThemeManager