|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bowstreet.profiles.NamedObject
com.bowstreet.profiles.ProfileSetDescription
com.bowstreet.profiles.ProfileSet
public class ProfileSet
Class that represents a single ProfileSet.
// The name of the Profileset, must be unique
String profileSetName = "regionTest";
// create a ProfileSetStorageManager to read/write ProfileSets
ProfileSetStorageManager profileStorage = new ProfileSetStorageManager("Test User");
// create the ProfileSet with a name, description and specify to use qualified (e.g. "acme.hr.gold") profile names.
ProfileSet profileSet = new ProfileSet(profileSetName, "Sample ProfileSet", true);
// create the ProfileSet structure by adding each ProfileDefEntry to the ProfileDef
// create the profile definition
ProfileDef profileDef = new ProfileDef();
// add the the ProfileDef to the new ProfileSet
profileSet.setProfileDef(profileDef);
// create the individual entries(structure) and add them to the definition
ProfileDefEntry profileDefEntry = new ProfileDefEntry("ManagerName", "TextInput", "Set Manager's Name","");
profileDef.addEntry(profileDefEntry);
profileDefEntry = new ProfileDefEntry("ManagerPhone", "TextInput", "Set Manager's Phone Number", "");
profileDef.addEntry(profileDefEntry);
profileDefEntry = new ProfileDefEntry("DisplayPhone", "CheckBox", "Display Manager's Phone Number","");
profileDef.addEntry(profileDefEntry);
profileDefEntry = new ProfileDefEntry("Commission", "TextInput", "Percent Commission on Sales", "");
profileDef.addEntry(profileDefEntry);
// create the mandatory Default Profile
Profile profile = new Profile(Profile.DEFAULT);
// add the values to the Default Profile
ProfileValue value = new ProfileValue("ManagerName", "None");
profile.addValue(value);
value = new ProfileValue("ManagerPhone", "0000-0000");
profile.addValue(value);
value = new ProfileValue("Commission", "10.0");
profile.addValue(value);
value = new ProfileValue("DisplayPhone", "true");
profile.addValue(value);
// add the profile to the ProfileSet
profileSet.addProfile(profile);
// create the "EastCoast" Profile where the parent will default to "Default"
profile = new Profile("EastCoast");
// create values and add them to the Profile
value = new ProfileValue("ManagerName", "Frank R.");
profile.addValue(value);
value = new ProfileValue("ManagerPhone", "123-4567");
profile.addValue(value);
value = new ProfileValue("Commission", "25.0");
value.setFinal(true);
profile.addValue(value);
// add the profile to the ProfileSet
profileSet.addProfile(profile);
// create the "NH" Profile with a parent of "EastCoast"
profile = new Profile("NH", profile.getName());
// create values and add them to the Profile
value = new ProfileValue("ManagerName", "Sol R.");
profile.addValue(value);
value = new ProfileValue("ManagerPhone", "555-1212");
profile.addValue(value);
profile.addRole("Role1");
profile.addRole("Role2");
// add the profile to the Profileset
profileSet.addProfile(profile);
// save the new ProfileSet to the storage device
profileStorage.saveProfileSet(profileSet, false);
ProfileSetDescription
,
ProfileSetStorageManager
,
Profile
,
ProfileDef
,
ProfileDefEntry
,
Serialized FormField Summary |
---|
Fields inherited from interface com.bowstreet.profiles.IProfileDefines |
---|
CURRENT_CUSTOM_VALUE_PSET, CUSTOM_VALUE_MAP_KEY, DEFAULT, DESCRIPTION, EDIT_STATUS, EDITABLE, EFFECTS_CHILD, emptyIterator, ENTRIES, ENTRY, EXTRA_DATA, FALSE, FINAL_LOCKED, FINAL_LOCKED_STR, INHERITED_FROM, INHERITED_LOCKED, INHERITED_LOCKED_STR, IS_CONTAINER, IS_FINAL, IS_INHERITED, IS_RUNTIME, LAST_MODIFIED, LAST_MODIFIED_BY, MODEL, MODELS, NAME, PARENT, PC_ALREADY_CONVERTED, PC_INVALID_DATA, PC_NO_PROFILE, PC_OK, PROFILE, PROFILE_ATTR, PROFILE_DEF, PROFILE_SET, PROFILE_SET_MAP_PREVIEW_KEY, PROFILED, PROFILES, PROMPT, ROLE, ROLE_SELECTION_CLASS, ROLES, TRUE, TYPE, UI, USE_FULL_NAMES, VALUE, VALUE_CLASS, VALUES |
Constructor Summary | |
---|---|
ProfileSet()
Constructs a ProfileSet. |
|
ProfileSet(java.lang.String name,
java.lang.String description)
Constructs a ProfileSet with the specified description information. |
Method Summary | |
---|---|
void |
addModel(java.lang.String modelName)
Adds a single Model to this ProfileSet. |
void |
addProfile(Profile profile)
Adds a Profile to this ProfileSet. |
void |
calculateProfileValues()
Calculates all of the values from the profile hierarchy. |
void |
calculateProfileValues(boolean forceRecalc)
Calculates all of the values from the profile hierarchy. |
java.lang.Object |
clone()
Creates and returns a copy of this ProfileSet. |
ProfileSet |
cloneStructure()
Creates and returns a copy of the ProfileSet structure. |
boolean |
containsModel(java.lang.String modelName)
Checks to see if a specified Model exists for this ProfileSet. |
boolean |
containsProfile(Profile profile)
Checks if there is an existing profile with the same name. |
boolean |
equals(java.lang.Object obj)
Compare two ProfileSet's. |
IXml |
getAsIXml()
Gets the entire Profile Set as IXml. |
IXml |
getAsIXml(boolean getAll)
Gets the entire ProfileSet as IXml. |
Profile |
getDefaultProfile()
Gets the default Profile from this Profile Set. |
java.util.Iterator |
getModels()
Gets an Iterator to a list of all of the Models for this ProfileSet. |
Profile |
getProfile(java.lang.String profileName)
Gets the specified Profile by name from this ProfileSet. |
ProfileDef |
getProfileDef()
Gets the ProfileDef field of this ProfileSet. |
java.util.Iterator |
getProfiles()
Gets an Iterator to the entire list of Profile objects from within this ProfileSet. |
java.lang.String |
getProfileSelectionClass()
Gets the name of the class to be used to calculate the Profile selection. |
java.lang.String |
getValueClass()
Gets the name of the class to be used to create the values associated with a Profile. |
boolean |
isChild(java.lang.String profileName,
java.lang.String childProfileName)
Checks to see the specified child is child of the specified profile. |
void |
mergeChangedProfiles(ProfileSet updatedProfileSet)
Merges changes using the hasChanged data member of the Profiles from the source ProfileSet to this ProfileSet. |
void |
mergeProfileDefData(ProfileSet updatedProfileSet)
Merges changes of the ProfilesDef, strProfileSelectionClass and strValueClass from the source ProfileSet to this ProfileSet. |
void |
modifyProfile(Profile profile)
Modifies an existing Profile in this ProfileSet. |
void |
removeDefEntry(java.lang.String defEntryName)
Removes a Profile Definition Entry on this Profileset. |
void |
removeModel(java.lang.String modelName)
Removes the specified Model from this ProfileSet. |
void |
removeProfile(java.lang.String profileName)
Removes the specified Profile from this Profile Set. |
void |
renameDefEntry(java.lang.String defEntryName,
java.lang.String newDefEntryName)
Rename a Profile Definition Entry on this Profileset. |
void |
renameParent(java.lang.String profileName,
java.lang.String newParentName)
Changes the parent of the specified Profile. |
void |
setFromIXml(IXml tdProfileSet)
Sets the entire Profile Set from a IXml. |
void |
setModels(java.util.List models)
Sets a list of all of the Models for this ProfileSet. |
void |
setProfileDef(ProfileDef profileDef)
Sets the ProfileDef field of this Profile Set. |
void |
setProfileSelectionClass(java.lang.String name)
Sets the name of the class or handler to be used to perform the Profile selection. |
void |
setProfilesLastModified()
Sets all of the Profiles in this ProfileSet to the current time if they are currently not set. |
void |
setValueClass(java.lang.String className)
Sets the name of the class to be used to create the values associated with a Profile. |
java.lang.String |
toString()
Gets a String of all the Profile data for debugging. |
void |
update(com.bowstreet.profiles.IXmlDataAccess item)
Updates from an existing ProfileSet. |
void |
updateProfilesChanged(ProfileSet originalProfileSet)
Compares the individual Profiles of this ProfileSet to the specified original ProfileSet and sets the Profile hasChanged accordingly. |
Methods inherited from class com.bowstreet.profiles.ProfileSetDescription |
---|
getDescription, getLastModifiedBy, getLastTimeModified, setDescription, setLastModifiedBy, setLastTimeModified, setUseQualifiedProfileNames, useQualifiedProfileNames |
Methods inherited from class com.bowstreet.profiles.NamedObject |
---|
getName, setName |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ProfileSet()
public ProfileSet(java.lang.String name, java.lang.String description)
name
- The ProfileSet name.description
- The ProfileSet description.Method Detail |
---|
public void addModel(java.lang.String modelName)
modelName
- A Model unique ID to add.public void addProfile(Profile profile) throws ProfileException
profile
- The Profile to add.
ProfileException
- if duplicate name in entry.Profile
public void calculateProfileValues() throws ProfileException
ProfileException
- On error.public void calculateProfileValues(boolean forceRecalc) throws ProfileException
forceRecalc
- true to force a recalculate. This can be used by the UI if a value changes.
ProfileException
- On error.public java.lang.Object clone()
clone
in interface com.bowstreet.profiles.IXmlDataAccess
clone
in class NamedObject
public ProfileSet cloneStructure()
public boolean containsModel(java.lang.String modelName)
modelName
- The unique ID of the Model to check.
public boolean containsProfile(Profile profile)
profile
- The Profile to check if exists.
Profile
public boolean equals(java.lang.Object obj)
equals
in class NamedObject
obj
- The ProfileSet to compare against.
public IXml getAsIXml() throws ProfileException
ProfileException
- On error.IXml
public IXml getAsIXml(boolean getAll) throws ProfileException
getAsIXml
in interface com.bowstreet.profiles.IXmlDataAccess
getAsIXml
in class ProfileSetDescription
getAll
- true to get all of the calculated inherited data, else false.
ProfileException
- On error.IXml
public Profile getDefaultProfile()
Profile
public java.util.Iterator getModels()
public Profile getProfile(java.lang.String profileName)
profileName
- The name of the profile to get.
Profile
public ProfileDef getProfileDef()
ProfileDef
public java.util.Iterator getProfiles()
Profile
public java.lang.String getProfileSelectionClass()
public java.lang.String getValueClass()
public boolean isChild(java.lang.String profileName, java.lang.String childProfileName) throws ProfileException
profileName
- The name of the Profile who's children to check.childProfileName
- The name of the child Profile.
ProfileException
- On error.public void mergeChangedProfiles(ProfileSet updatedProfileSet) throws ProfileException
updatedProfileSet
- The source ProfileSet to merge from.
ProfileException
- On error.public void mergeProfileDefData(ProfileSet updatedProfileSet) throws ProfileException
updatedProfileSet
- The source ProfileSet to merge from.
ProfileException
- On error.public void modifyProfile(Profile profile) throws ProfileException
profile
- The Profile to modify or add.
ProfileException
- On error.Profile
public void removeDefEntry(java.lang.String defEntryName) throws ProfileException
defEntryName
- The name of the Profile Definition Entry to remove.
ProfileException
- On error.public void removeModel(java.lang.String modelName)
modelName
- The unique ID of the Model to remove.public void removeProfile(java.lang.String profileName) throws ProfileException
profileName
- The name of the Profile to be removed.
ProfileException
- On error.Profile
public void renameDefEntry(java.lang.String defEntryName, java.lang.String newDefEntryName) throws ProfileException
defEntryName
- The name of the existing Definition entry.newDefEntryName
- The new name of the Definition entry..
ProfileException
- On error.public void renameParent(java.lang.String profileName, java.lang.String newParentName) throws ProfileException
profileName
- The name of the Profile for the parent to be change.newParentName
- The name of the new parent Profile.
ProfileException
- On error.public void setFromIXml(IXml tdProfileSet) throws ProfileException
setFromIXml
in interface com.bowstreet.profiles.IXmlDataAccess
setFromIXml
in class ProfileSetDescription
tdProfileSet
- The IXml representation of a ProfileSet.
ProfileException
- On error.IXml
public void setModels(java.util.List models)
models
- A List of Strings that represent the Model unique ID's.public void setProfileDef(ProfileDef profileDef)
profileDef
- The ProfileDef to set on this ProfileSet.ProfileDef
public void setProfileSelectionClass(java.lang.String name)
name
- The name of the handler or class.public void setProfilesLastModified() throws ProfileException
ProfileException
- On error.public void setValueClass(java.lang.String className)
className
- The name of the class.public java.lang.String toString()
toString
in class ProfileSetDescription
public void update(com.bowstreet.profiles.IXmlDataAccess item)
update
in interface com.bowstreet.profiles.IXmlDataAccess
update
in class ProfileSetDescription
item
- The IXmlDataAccess, which must be a ProfileSet.public void updateProfilesChanged(ProfileSet originalProfileSet)
originalProfileSet
- The original ProfileSet to compare against or null if there was no original.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |