Open SiteSearch 4.1.1
Final

ORG.oclc.jassi
Class StyleTable

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--ORG.oclc.jassi.StyleTable

public class StyleTable
extends Hashtable

The StyleTable class stores interface definitions such as colors, fonts, default html pages, and interface gadgets that are read from the JaSSI configuration files during server initialization. Information held in the StyleTable object is used to customize the the look and feel of interface applications. The information is shared globally by all user sessions in the JaSSI Server and can be accessed in HTML documents via the style table entity notation: &<TableName>.<SectionName>.<Name>;

The data containined in the StyleTable is organized by the section and name/value pairs. For example, a JaSSI configuration input:

 [colors]
 bgcolor         = #ffffff
 text            = #000000
 link            = #006600
 
 [images]
 toolbar  = /images/toolbar.gif
 webplaces= /images/grn_destinations.gif
 go       = /images/grn_go.gif
 

The StyleTable class provides methods to retrieve information for each entry, based on the name of a section within the table and the variable within the section. For example, &StyleTable.colors.bgcolors; retrieves the value from the colors section for the variable named bgcolor (i.e. #ffffff). The get methods in the StyleTable object are also responsible for executing the interface or display gadgets.

The StyleTable class maintains two categories of static data that can be accessed by all applications in the JaSSI: the interface styles and the display gadgets for each style. There are methods to retrieve an individual StyleTable object based on the unique style name.

See Also:
Serialized Form

Constructor Summary
StyleTable(int capacity)
          Constructs a StyleTable object with the initial size specified as the input parameter.
 
Method Summary
 Object get(String key)
          Retrieves the value for the input key which has the syntax including the variable section name (<sectionname>.<name>) and by default, executes the gadget class for gadget objects retrieved.
 Object get(String key, boolean execute)
          Retrieves the value for the input key which has the syntax including the variable section name (<sectionname>.<name>) and executes the gadget class based on the input execute flag.
 Object get(String key, boolean execute, RequestManager rMngr)
          Retrieves the value for the input RequestManager object and key which has the syntax including the variable section name (<sectionname>.<name>) and executes the gadget class based on the input execute flag.
 Object get(String key, RequestManager rMngr)
          Retrieves the value for the input RequestManager object and key which has the syntax including the variable section name (<sectionname>.<name>) and by default, executes the gadget class for gadget objects retrieved.
 Object get(String section, String key)
          Retrieves the value for the input key from the input section name and by default, executes the gadget class for any gadget objects retrieved.
 Object get(String section, String key, boolean execute, RequestManager rMngr)
          Retrieves the value for the input key from the input section name and executes the gadget class based on the input execute flag.
 Object get(String section, String key, RequestManager rMngr)
          Retrieves the value for the input RequestManager object and key from the input section name and by default, executes the gadget class for any gadget objects retrieved.
static StyleTable getDisplayGadgets(String name)
          Retrieves a StyleTable object from the cache of saved display gadget styles for the input table name.
static Hashtable getDisplayGadgetsTables()
          Returns a Hashtable object containing all the saved display gadgets tables.
static StyleTable getStyle(String name)
          Retrieves a StyleTable object from the cache of saved interface styles for the input table name.
static StyleTable getStyle(String category, String name)
          Retrieves a StyleTable object from the cache of saved styles for the input table name found in the input category.
static Hashtable getStyleTables()
          Returns a Hashtable object containing all the saved interface style tables.
static Hashtable getStyleTables(String category)
          Returns a Hashtable object containing all the saved style tables for a certain category.
 void put(String section, String key, Object data)
          Stores an Object that is associated with the input section and key name in the style table.
static void saveDisplayGadgets(String name, StyleTable table)
          Saves a StyleTable object into the cache of display gadgets which can be retrieved using the input name.
static void saveStyle(String category, String name, StyleTable table)
          Saves a StyleTable object into the cache based on the input category and is named using the input name.
static void saveStyle(String name, StyleTable table)
          Saves a StyleTable object into the cache of interface styles which can be retrieved using the input name.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StyleTable

public StyleTable(int capacity)
Constructs a StyleTable object with the initial size specified as the input parameter.
Parameters:
capacity - the initial size to allocate the StyleTable Hashtable.
Method Detail

saveStyle

public static void saveStyle(String name,
                             StyleTable table)
Saves a StyleTable object into the cache of interface styles which can be retrieved using the input name.
Parameters:
name - the name of the saved StyleTables's object.
table - the StyleTable object to store in the saved StyleTables Hashtable.

saveStyle

public static void saveStyle(String category,
                             String name,
                             StyleTable table)
Saves a StyleTable object into the cache based on the input category and is named using the input name.
Parameters:
category - the type of StyleTable object it is.
name - the name of the saved StyleTables's object.
table - the StyleTable object to store in the saved StyleTables Hashtable.

getStyle

public static StyleTable getStyle(String name)
Retrieves a StyleTable object from the cache of saved interface styles for the input table name.
Parameters:
name - the name of the saved StyleTables's object.
Returns:
StyleTable object found in the saved StyleTables Hashtable and an empty String if not found.

getStyle

public static StyleTable getStyle(String category,
                                  String name)
Retrieves a StyleTable object from the cache of saved styles for the input table name found in the input category.
Parameters:
category - the type of style
name - the name of the saved StyleTables's object.
Returns:
StyleTable object found in the saved StyleTables Hashtable and an empty String if not found.

getStyleTables

public static Hashtable getStyleTables()
Returns a Hashtable object containing all the saved interface style tables.
Returns:
Hashtable

getStyleTables

public static Hashtable getStyleTables(String category)
Returns a Hashtable object containing all the saved style tables for a certain category.
Parameters:
category - the name of the style table category
Returns:
Hashtable

saveDisplayGadgets

public static void saveDisplayGadgets(String name,
                                      StyleTable table)
Saves a StyleTable object into the cache of display gadgets which can be retrieved using the input name.
Parameters:
name - the name of the save DisplayGadgets's object.
table - the StyleTable object to store in the saved DisplayGadgets Hashtable.

getDisplayGadgets

public static StyleTable getDisplayGadgets(String name)
Retrieves a StyleTable object from the cache of saved display gadget styles for the input table name.
Parameters:
name - the name of the saved DisplayGadgets's object.
Returns:
the StyleTable object found in the saved DisplayGadgets Hashtable and an empty String if not found.

getDisplayGadgetsTables

public static Hashtable getDisplayGadgetsTables()
Returns a Hashtable object containing all the saved display gadgets tables.
Returns:
Hashtable

get

public Object get(String key)
Retrieves the value for the input key which has the syntax including the variable section name (<sectionname>.<name>) and by default, executes the gadget class for gadget objects retrieved.
Parameters:
key - the name of the StyleTable section name and variable delineated by a period.
Returns:
Object the value matching the input key

get

public Object get(String key,
                  RequestManager rMngr)
Retrieves the value for the input RequestManager object and key which has the syntax including the variable section name (<sectionname>.<name>) and by default, executes the gadget class for gadget objects retrieved.
Parameters:
key - the name of the StyleTable section name and variable delineated by a period.
rMngr - the current RequestManager object
Returns:
Object the value matching the input key

get

public Object get(String key,
                  boolean execute)
Retrieves the value for the input key which has the syntax including the variable section name (<sectionname>.<name>) and executes the gadget class based on the input execute flag.
If the value matching the key is a gadget and the execute flag is true, the gadget is loaded and run. If the execute flag is false, only the reference to the gadget is returned.
Parameters:
key - the name of the StyleTable section name and variable delineated by a period.
boolean - indicating whether to execute a gadget
Returns:
Object the value matching the input key

get

public Object get(String key,
                  boolean execute,
                  RequestManager rMngr)
Retrieves the value for the input RequestManager object and key which has the syntax including the variable section name (<sectionname>.<name>) and executes the gadget class based on the input execute flag.
If the value matching the key is a gadget and the execute flag is true, the gadget is loaded and run. If the execute flag is false, only the reference to the gadget is returned.
Parameters:
key - the name of the StyleTable section name and variable delineated by a period.
boolean - indicating whether to execute a gadget
rMngr - the RequestManager object
Returns:
Object the value matching the input key

get

public Object get(String section,
                  String key)
Retrieves the value for the input key from the input section name and by default, executes the gadget class for any gadget objects retrieved.
Parameters:
section - the section name in the StyleTable object
key - the variable name within the section
Returns:
Object the value matching the input section/key or an empty string, if not found.

get

public Object get(String section,
                  String key,
                  RequestManager rMngr)
Retrieves the value for the input RequestManager object and key from the input section name and by default, executes the gadget class for any gadget objects retrieved.
Parameters:
section - the section name in the StyleTable object
key - the variable name within the section
rMngr - the current RequestManager object for the transaction
Returns:
Object the value matching the input section/key or an empty string, if not found.

get

public Object get(String section,
                  String key,
                  boolean execute,
                  RequestManager rMngr)
Retrieves the value for the input key from the input section name and executes the gadget class based on the input execute flag.
If the value matching the key is a gadget and the execute flag is true, the gadget is loaded and run. If the execute flag is false, only the reference to the gadget is returned.
Parameters:
section - the section name in the StyleTable object
key - the variable name within the section
boolean - indicating whether to execute a gadget
rMngr - the current RequestManager object
Returns:
Object the value matching the input section/key or an empty string, if not found.

put

public void put(String section,
                String key,
                Object data)
Stores an Object that is associated with the input section and key name in the style table.
Parameters:
section - the name of the section in the StyleTable
key - the name of the Object.
data - the data to store in the Object.

Open SiteSearch 4.1.1
Final