com.wm.app.tn.profile
Class ProfileDictionary

java.lang.Object
  extended by com.wm.app.tn.profile.ProfileDictionary

public class ProfileDictionary
extends java.lang.Object

The ProfileDictionary manages the set of profile field definitions. It is used to create new extended fields and to define which fields are required and which are used during profile exchange.

When a client requires changes to the set of field definitions, the ProfileDictionary creates, updates and deletes ProfileFieldMetaData objects as needed.

ProfileDictionary is a Singleton. A reference to it can be obtained from the static method getProfileDictionary which will initialize the dictionary from the database, create the single instance the first time it's called, and return a reference to the dictionary.

See Also:
ProfileFieldMetaData

Method Summary
 void addExtendedFieldDefinition(ProfileFieldMetaData pfmd)
          Adds a new ProfileFieldMetaData to the TN database.
 ProfileFieldMetaData getExtendedFieldDefinition(java.lang.String fieldName)
           
 ProfileFieldMetaData[] getExtendedFieldDefinitions()
           
 ProfileFieldMetaData[] getExtendedRegistrationFieldDefs()
           
 ProfileFieldMetaData[] getExtendedRequiredFieldDefs()
           
 ProfileFieldMetaData getFieldDefinition(java.lang.String fieldID)
           
static ProfileDictionary getProfileDictionary()
          Provides access to the ProfileDictionary.
static ProfileDictionary getProfileDictionary(boolean refresh)
          Provides access to the ProfileDictionary.
 ProfileFieldMetaData getStandardFieldDefinition(java.lang.String table, java.lang.String column)
           
 ProfileFieldMetaData[] getStandardFieldDefinitions()
           
 ProfileFieldMetaData[] getStandardFieldDefinitions(boolean all)
           
static void init()
           
static ProfileDictionary quietGetProfileDictionary()
          Provides "quiet" access to the ProfileDictionary.
 void updateFieldDefinition(ProfileFieldMetaData pfmd)
          Persists changes to a ProfileFieldMetaData to the TN database.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

quietGetProfileDictionary

public static ProfileDictionary quietGetProfileDictionary()
Provides "quiet" access to the ProfileDictionary. Call this method to get a reference when you don't want to deal with exceptions. This will eat any exceptions that happen.


getProfileDictionary

public static ProfileDictionary getProfileDictionary()
                                              throws ProfileStoreException
Provides access to the ProfileDictionary. Call this method to get a reference to the dictionary, which cannot be constructed using new.

Throws:
ProfileStoreException

getProfileDictionary

public static ProfileDictionary getProfileDictionary(boolean refresh)
                                              throws ProfileStoreException
Provides access to the ProfileDictionary. Call this method to get a reference to the dictionary, which cannot be constructed using new.

Throws:
ProfileStoreException

init

public static void init()
                 throws ProfileStoreException
Throws:
ProfileStoreException

getFieldDefinition

public final ProfileFieldMetaData getFieldDefinition(java.lang.String fieldID)
Returns:
a ProfileFieldMetaData for a standard or extended field
See Also:
ProfileFieldMetaData

getExtendedFieldDefinition

public final ProfileFieldMetaData getExtendedFieldDefinition(java.lang.String fieldName)
Returns:
a ProfileFieldMetaData for a standard field
See Also:
ProfileFieldMetaData

getStandardFieldDefinition

public final ProfileFieldMetaData getStandardFieldDefinition(java.lang.String table,
                                                             java.lang.String column)
Returns:
a ProfileFieldMetaData for a standard field
See Also:
ProfileFieldMetaData

getExtendedFieldDefinitions

public final ProfileFieldMetaData[] getExtendedFieldDefinitions()
                                                         throws ProfileStoreException
Returns:
a sorted array of ProfileFieldMetaData objects for all extended fields.
Throws:
ProfileStoreException
See Also:
ProfileFieldMetaData

getExtendedRequiredFieldDefs

public final ProfileFieldMetaData[] getExtendedRequiredFieldDefs()
                                                          throws ProfileStoreException
Returns:
a sorted array of ProfileFieldMetaData objects for required extended fields.
Throws:
ProfileStoreException
See Also:
ProfileFieldMetaData

getExtendedRegistrationFieldDefs

public final ProfileFieldMetaData[] getExtendedRegistrationFieldDefs()
                                                              throws ProfileStoreException
Returns:
a sorted array of ProfileFieldMetaData objects for registration extended fields. Registration fields are those requested during profile exchange.
Throws:
ProfileStoreException
See Also:
ProfileFieldMetaData

getStandardFieldDefinitions

public final ProfileFieldMetaData[] getStandardFieldDefinitions(boolean all)
                                                         throws ProfileStoreException
Parameters:
all - if true, returns both displayable and hidden field defs. Otherwise, only displayable fields are returned. 'Displayable' means that the field appears on the Profile Fields panel of the TN Console.
Returns:
a sorted array of ProfileFieldMetaData objects for standard fields.
Throws:
ProfileStoreException
See Also:
ProfileFieldMetaData

getStandardFieldDefinitions

public final ProfileFieldMetaData[] getStandardFieldDefinitions()
                                                         throws ProfileStoreException
Parameters:
all - if true, returns both displayed and hidden field defs.
Returns:
a sorted array of ProfileFieldMetaData objects for all displayable standard fields. 'Displayable' means that the field appears on the Profile Fields panel of the GUI.
Throws:
ProfileStoreException
See Also:
ProfileFieldMetaData

updateFieldDefinition

public final void updateFieldDefinition(ProfileFieldMetaData pfmd)
                                 throws ProfileStoreException
Persists changes to a ProfileFieldMetaData to the TN database.

To change a field definition, get a ProfileFieldMetaData by calling one of the accessor methods in this class. Use it's mutators to change your local copy. To save the changes, pass it to this method.

NOTE: There is not a delete method. Field defintions are logically deleted by calling the delete method on a ProfileFieldMetaData object, then passing that object to this method to save it.

Parameters:
pfmd - the field defintion to be saved
Throws:
ProfileStoreException - if a database error occurs

addExtendedFieldDefinition

public final void addExtendedFieldDefinition(ProfileFieldMetaData pfmd)
                                      throws ProfileStoreException
Adds a new ProfileFieldMetaData to the TN database.

Parameters:
pfmd - the field defintion to be added
Throws:
ProfileStoreException - if a database error occurs