|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectatg.nucleus.GenericService
atg.svc.repository.service.BaseService
atg.svc.repository.service.KnowledgeBaseService
atg.svc.repository.service.SegmentedOptionService
public class SegmentedOptionService
Business methods for editing/reading/saving options that are segmented by profile group.
| Nested Class Summary | |
|---|---|
protected class |
SegmentedOptionService.LazySegmentedOptionsMap
A Map for SegmentedOptions that waits until get() or containsKey() is called to load the SegmentedOption value into the Map. |
| Field Summary | |
|---|---|
static java.lang.String |
CLASS_VERSION
|
SegmentService |
mSegmentService
|
static java.lang.String |
SEGMENT_REQ_ATTR
|
| Fields inherited from class atg.svc.repository.service.BaseService |
|---|
mBeanHomes, mBeanHomesName, mRepositoryHomes, mRepositoryHomesName |
| Fields inherited from class atg.nucleus.GenericService |
|---|
SERVICE_INFO_KEY |
| Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
|---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
| Constructor Summary | |
|---|---|
SegmentedOptionService()
|
|
| Method Summary | |
|---|---|
void |
createOptionsSegment(java.lang.String pApplicationId,
java.lang.String pSrcSegmentName,
java.lang.String pDstSegmentName)
Creates a new options segment, copies the set of SegmentedOption from the source segment to the new one and sets the new segment priority to the beginning of the list. |
java.util.List |
findAllOptionSegments()
Gets the list of options segments in priority order. |
SegmentedOption |
findOptionBySegmentAndName(java.lang.String pSegment,
java.lang.String pOptionName)
Finds a single SegmentedOption given the segment and option name. |
java.util.Collection |
findOptionsBySegment(java.lang.String pSegment)
Gets the collection of SegmentedOption objects given the segment. |
OptionSegment |
findOptionSegmentById(java.lang.String pId)
Finds an OptionSegment object by the given id. |
OptionSegment |
findOptionSegmentByName(java.lang.String pSegment)
Gets an option segment given the name of the segment. |
java.lang.String[] |
getArrayValue(atg.repository.RepositoryItem pProfile,
java.lang.String pOptionName)
Gets an option by name in the highest priority segment the given user belongs to and returns its value as a String. |
java.lang.String[] |
getArrayValue(java.lang.String pOptionName)
Gets an option by name in the highest priority segment the current user belongs to and returns its value as a String. |
java.lang.String[] |
getArrayValue(java.lang.String pSegment,
java.lang.String pOptionName)
Gets a Segmented option by name and returns its value as an array of Strings. |
boolean |
getBooleanValue(atg.repository.RepositoryItem pProfile,
java.lang.String pOptionName)
Gets an option by name in the highest priority segment the given user belongs to and returns its value as a boolean. |
boolean |
getBooleanValue(java.lang.String pOptionName)
Gets an option by name in the highest priority segment the current user belongs to and returns its value as a boolean. |
boolean |
getBooleanValue(java.lang.String pSegment,
java.lang.String pOptionName)
Gets a Segmented option by name and returns its value as a boolean. |
java.lang.String |
getHighestPriorityOptionSegment(atg.repository.RepositoryItem pProfile)
Gets the highest priority segment the given user belongs to. |
java.lang.String |
getHighestPriorityOptionSegmentForCurrentUser()
Gets the highest priority segment the current user belongs to. |
int |
getIntegerValue(atg.repository.RepositoryItem pProfile,
java.lang.String pOptionName)
Gets an option by name in the highest priority segment the given user belongs to and returns its value as a int. |
int |
getIntegerValue(java.lang.String pOptionName)
Gets an option by name in the highest priority segment the current user belongs to and returns its value as a int. |
int |
getIntegerValue(java.lang.String pSegment,
java.lang.String pOptionName)
Gets a Segmented option by name and returns its value as an int. |
java.util.Map |
getOptions(java.lang.String pSegment)
Returns a Map that can be used to edit Segmented options. |
SegmentService |
getSegmentService()
Gets the SegmentService business component. |
java.lang.String |
getStringValue(atg.repository.RepositoryItem pProfile,
java.lang.String pOptionName)
Gets an option by name in the highest priority segment the given user belongs to and returns its value as a String. |
java.lang.String |
getStringValue(java.lang.String pOptionName)
Gets an option by name in the highest priority segment the current user belongs to and returns its value as a String. |
java.lang.String |
getStringValue(java.lang.String pSegment,
java.lang.String pOptionName)
Gets a Segmented option by name and returns its value as a String. |
UIService |
getUiService()
Gets the UIService business component. |
void |
removeOptionsSegment(java.lang.String pApplicationId,
java.lang.String pId)
Removes all options associated with the given segment and the option segment as well. |
void |
restoreDefaultValues(java.lang.String pSegmentName,
java.lang.String[] pOptionNames)
Restores the given options to their default value. |
void |
saveOptions(java.util.Map pSegmentedOptions)
Saves a Map of segmented options to the repository. |
void |
saveOptionSegment(OptionSegment pOptionSegment)
Commits changes in the given OptionSegment to the repository. |
void |
setSegmentService(SegmentService pSegmentService)
Sets the SegmentService business component. |
void |
setUiService(UIService pUIService)
Sets the UIService business component. |
void |
swapOptionSegmentPriorities(java.lang.String pId1,
java.lang.String pId2)
Swaps the priority of the two given OptionSegment objects given their ids and commits the changed to the repository. |
| Methods inherited from class atg.svc.repository.service.KnowledgeBaseService |
|---|
getBeanHomes, getRepositoryHomes |
| Methods inherited from class atg.svc.repository.service.BaseService |
|---|
getBaseBeanHomes, getBaseRepositoryHomes, getBeanHomesName, getRepositoryHomesName, getRepositoryService, getToday, setBeanHomesName, setRepositoryHomesName, setRepositoryService |
| Methods inherited from class atg.nucleus.GenericService |
|---|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingWarning, setServiceInfo, startService, stopService |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CLASS_VERSION
public static final java.lang.String SEGMENT_REQ_ATTR
public SegmentService mSegmentService
| Constructor Detail |
|---|
public SegmentedOptionService()
| Method Detail |
|---|
public java.util.Map getOptions(java.lang.String pSegment)
public void saveOptions(java.util.Map pSegmentedOptions)
throws PersistenceException
pSegmentedOptions - The map of user options as SegmentedOption beans.
PersistenceException - If the save fails.
public void restoreDefaultValues(java.lang.String pSegmentName,
java.lang.String[] pOptionNames)
throws ObjectNotFoundException,
PersistenceException
pSegmentName - The name of the segment the options belong to.pOptionNames - The names of the option to restore.
ObjectNotFoundException - If an option cannot be found with the given segment and name.
PersistenceException - If the write of an option to the repository fails.
java.lang.IllegalArgumentException - If the segmentName is blank or the option names are empty.
public java.lang.String getStringValue(java.lang.String pOptionName)
throws javax.ejb.FinderException,
ObjectNotFoundException
pOptionName - The name of option to find.
ObjectNotFoundException - If the SegmentedOption is not found by the given name in the given segment.
javax.ejb.FinderException - If the underlying finder call to get the list of segments fails.
public boolean getBooleanValue(java.lang.String pOptionName)
throws javax.ejb.FinderException,
ObjectNotFoundException
pOptionName - The name of option to find.
ObjectNotFoundException - If the default option is not found for the given name.
javax.ejb.FinderException - If the underlying finder call to get the list of segments fails.
public int getIntegerValue(java.lang.String pOptionName)
throws javax.ejb.FinderException,
ObjectNotFoundException
pOptionName - The name of option to find.
ObjectNotFoundException - If the default option is not found for the given name.
javax.ejb.FinderException - If the underlying finder call to get the list of segments fails.
public java.lang.String[] getArrayValue(java.lang.String pOptionName)
throws javax.ejb.FinderException,
ObjectNotFoundException
pOptionName - The name of the option.
ObjectNotFoundException - If the SegmentedOption is not found by the given name in the given segment.
javax.ejb.FinderException - If the underlying finder call to get the list of segments fails.
public java.lang.String getStringValue(atg.repository.RepositoryItem pProfile,
java.lang.String pOptionName)
throws javax.ejb.FinderException,
ObjectNotFoundException
pProfile - The user to find the highest priority segment to be used to lookup the value.pOptionName - The name of option to find.
ObjectNotFoundException - If the SegmentedOption is not found by the given name in the given segment.
javax.ejb.FinderException - If the underlying finder call to get the list of segments fails.
public boolean getBooleanValue(atg.repository.RepositoryItem pProfile,
java.lang.String pOptionName)
throws javax.ejb.FinderException,
ObjectNotFoundException
pProfile - The user to find the highest priority segment to be used to lookup the value.pOptionName - The name of option to find.
ObjectNotFoundException - If the default option is not found for the given name.
javax.ejb.FinderException - If the underlying finder call to get the list of segments fails.
public int getIntegerValue(atg.repository.RepositoryItem pProfile,
java.lang.String pOptionName)
throws javax.ejb.FinderException,
ObjectNotFoundException
pProfile - The user to find the highest priority segment to be used to lookup the value.pOptionName - The name of option to find.
ObjectNotFoundException - If the default option is not found for the given name.
javax.ejb.FinderException - If the underlying finder call to get the list of segments fails.
public java.lang.String[] getArrayValue(atg.repository.RepositoryItem pProfile,
java.lang.String pOptionName)
throws javax.ejb.FinderException,
ObjectNotFoundException
pProfile - The user to find the highest priority segment to be used to lookup the value.pOptionName - The name of the option.
ObjectNotFoundException - If the SegmentedOption is not found by the given name in the given segment.
javax.ejb.FinderException - If the underlying finder call to get the list of segments fails.
public java.lang.String getStringValue(java.lang.String pSegment,
java.lang.String pOptionName)
throws ObjectNotFoundException
pSegment - The segment name of option to find.pOptionName - The name of option to find.
ObjectNotFoundException - If the SegmentedOption is not found by the given name in the given segment.
java.lang.IllegalArgumentException - If the pSegment or pOptionName arguments are empty.
public boolean getBooleanValue(java.lang.String pSegment,
java.lang.String pOptionName)
throws ObjectNotFoundException
pSegment - The segment name of option to find.pOptionName - The name of option to find.
ObjectNotFoundException - If the default option is not found for the given name.
java.lang.IllegalArgumentException - If the pSegment or pOptionName arguments are empty.
public int getIntegerValue(java.lang.String pSegment,
java.lang.String pOptionName)
throws ObjectNotFoundException
pSegment - The segment name of option to find.pOptionName - The name of option to find.
ObjectNotFoundException - If the default option is not found for the given name.
java.lang.IllegalArgumentException - If the pSegment or pOptionName arguments are empty.
public java.lang.String[] getArrayValue(java.lang.String pSegment,
java.lang.String pOptionName)
throws ObjectNotFoundException
pSegment - The segment name of option to find.pOptionName - The name of the option.
ObjectNotFoundException - If the SegmentedOption is not found by the given name in the given segment.
java.lang.IllegalArgumentException - If the pSegment or pOptionName arguments are empty.
public java.lang.String getHighestPriorityOptionSegmentForCurrentUser()
throws javax.ejb.FinderException
javax.ejb.FinderException
public java.lang.String getHighestPriorityOptionSegment(atg.repository.RepositoryItem pProfile)
throws javax.ejb.FinderException
pProfile - The user to get the segment for.
javax.ejb.FinderException - If the finder for getting the segments fails.
public SegmentedOption findOptionBySegmentAndName(java.lang.String pSegment,
java.lang.String pOptionName)
throws ObjectNotFoundException
pSegment - The non-empty name of the segment (profile group).pOptionName - The non-empty name of the option.
ObjectNotFoundException - If no SegmentedOption is found with the given segment and name.
java.lang.IllegalArgumentException - If either argument is empty.
public java.util.Collection findOptionsBySegment(java.lang.String pSegment)
throws javax.ejb.FinderException
pSegment - The segment to get the options for.
javax.ejb.FinderException - If the finder fails.
public void createOptionsSegment(java.lang.String pApplicationId,
java.lang.String pSrcSegmentName,
java.lang.String pDstSegmentName)
throws javax.ejb.CreateException,
javax.ejb.FinderException,
ObjectNotFoundException,
PersistenceException
pApplicationId - The app id for framework, e.g. "workspace" or "selfService", can be null
to ignore framework objects and copy only optionspSrcSegmentName - The repository id of the existing segment to copy the options from (the source).pDstSegmentName - The name of the new segment which is also the name of the profile group.
javax.ejb.CreateException - If a creating the new OptionSegment or a SegmentedOption fails
javax.ejb.FinderException - If the finder that gets all the source SegmentedOption objects fails.
ObjectNotFoundException - If source OptionSegment cannot be found by the given id.
PersistenceException - If the write of the new OptionSegment or a copied SegmentedOption fails
public void removeOptionsSegment(java.lang.String pApplicationId,
java.lang.String pId)
throws javax.ejb.FinderException,
ObjectNotFoundException,
PersistenceException
pApplicationId - The app id for framework, e.g. "workspace" or "selfService", can be null
to ignore framework objects and remove only optionspId - The repository id of the segment.
javax.ejb.FinderException - If the finder to get all the options by segment fails.
ObjectNotFoundException - If not segment is found with the given name.
PersistenceException - If the remove of the segment or one of the SegmentedOption objects fails.
public void swapOptionSegmentPriorities(java.lang.String pId1,
java.lang.String pId2)
throws ObjectNotFoundException,
PersistenceException
pId1 - The repository id of an existing OptionSegmentpId2 - The repository id of another existing OptionSegment
ObjectNotFoundException - If either of the two segments cannot be found by id.
PersistenceException - If the commit to the repository fails.
java.lang.IllegalArgumentException - If the given arguments are the same id.
public void saveOptionSegment(OptionSegment pOptionSegment)
throws PersistenceException
pOptionSegment - The OptionSegment to commit.
PersistenceException - If the commit operation fails.
public OptionSegment findOptionSegmentByName(java.lang.String pSegment)
throws ObjectNotFoundException
pSegment - The name of the segment.
ObjectNotFoundException - If the OptionSegment is not found by the given name.
public java.util.List findAllOptionSegments()
throws javax.ejb.FinderException
javax.ejb.FinderException - If the finder call fails.
public OptionSegment findOptionSegmentById(java.lang.String pId)
throws ObjectNotFoundException
pId - The id of the OptionSegment to find.
ObjectNotFoundException - If the OptionSegment is not found by the given id.public SegmentService getSegmentService()
public void setSegmentService(SegmentService pSegmentService)
pSegmentService - The SegmentService business component.public UIService getUiService()
public void setUiService(UIService pUIService)
pUIService - The UIService business component.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||