atg.svc.ui.util
Class ServiceUIComponentDataStore

java.lang.Object
  extended by atg.nucleus.GenericService
      extended by atg.svc.ui.util.ServiceUIComponentDataStore
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, atg.svc.configuration.ServiceUIConfigurationConstants, java.util.EventListener

public class ServiceUIComponentDataStore
extends atg.nucleus.GenericService
implements atg.svc.configuration.ServiceUIConfigurationConstants

The Service UI Component Data Store class was created as a helper method to the service UI framework to detect on startup whether or not certain tabs and panels should be displayed based upon the running modules and the licensed modules. When dynamo starts up, each UI Component will register itself with this class, and then only the components that pass the validation will be rendered. The scope of this central managing class is global.

Author:
Jonathan Busconi

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 boolean m_securityEnabled
          This setting will disable the checking for running modules.
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.svc.configuration.ServiceUIConfigurationConstants
ADVISOR_MODULE_NAME, ARM_MODULE_NAME, CHAT_MODULE_NAME, COMMERCE_ASSIST_MODULE_NAME, CSR_MODULE_NAME, KNOWLEDGE_MODULE_NAME, MODULE_MANAGER_PATH, NUCLEUS_PATH, PANEL_TYPE, TAB_TYPE, TICKETING_MODULE_NAME, WORKSPACE_MODULE_NAME
 
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
ServiceUIComponentDataStore()
          Empty Constructor as this component does not require any other components to start up
 
Method Summary
 void addServiceUIComponent(ServiceUIComponent pServiceUIComponent)
          The method to add a new service UI Component to the list of valid service UI components takes a service UI component in the constructor, passes it through validation, and then only adds the component if it passes all validation
 void doStartService()
           
 java.util.Collection getAllServiceUIComponents()
          This method will return the collection of all valid service ui components
 boolean getIsVisible(java.lang.String pName)
          This one method is the heart and sole of this application, and all of the other methods are to support this method that will return true if the component being rendered and looked up by name is running and licensed.
 atg.svc.configuration.ModuleDependencyManager getModuleDependencyManager()
          This method will get a reference to the global module dependency manager
 java.util.Collection getServiceUIComponentByLicense(java.lang.String pLicense)
          The method to get the list of valid components by license will return the list of ui components that are valid and bound to the license in the search
 java.util.Collection getServiceUIComponentByModule(java.lang.String pModule)
          The method to get the list of valid running modules as authenticated by the /atg/modules/ModuleManager component.
 ServiceUIComponent getServiceUIComponentByName(java.lang.String pName)
          The method to det a service UI component by name will return a service ui component if its name is stored in the key of the HashMap of valid service ui components
 java.util.Collection getServiceUIComponentByType(java.lang.String pComponentType)
          The method to get the list of valid running modules by UI Component Type seems like it would be useful as it will return the list of valid TABS, or the list of valid panels upon search.
 void initializeService()
          This method reads the input list of all of the UI Components and passes each component through validation and runs once nucleus has started
 boolean isValidProduct(java.lang.String pProduct)
          The method to check if a product is valid takes the name of the module as the parameter and returns true if the module is running
 java.util.HashMap obtainInvalidServiceUIComponents()
          This method will return the HashMap of the invalid service ui components
 java.util.HashMap obtainValidServiceUIComponents()
          This method will return the HashMap of the valid service ui components
 void removeServiceUIComponent(ServiceUIComponent pServiceUIComponent)
          The method to add a remove a service UI Component from the list of valid service UI components takes a service UI component as an argument and removes it from the list of valid service ui components.
 void setModuleDependencyManager(atg.svc.configuration.ModuleDependencyManager pModuleDependencyManager)
          This method will set the module manager and is populated on startup
 boolean validateServiceUIComponent(ServiceUIComponent pServiceUIComponent)
          The method to validate a service UI Component will check if the component passes the running module check.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, 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

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

m_securityEnabled

public boolean m_securityEnabled
This setting will disable the checking for running modules. Useful for testing.

Constructor Detail

ServiceUIComponentDataStore

public ServiceUIComponentDataStore()
Empty Constructor as this component does not require any other components to start up

Method Detail

getModuleDependencyManager

public atg.svc.configuration.ModuleDependencyManager getModuleDependencyManager()
This method will get a reference to the global module dependency manager

Returns:
ModuleDependencyManager the knows what modules and licenses are running

setModuleDependencyManager

public void setModuleDependencyManager(atg.svc.configuration.ModuleDependencyManager pModuleDependencyManager)
This method will set the module manager and is populated on startup

Parameters:
pModuleDependencyManager - represents the /atg/svc/configuration/ModuleDependencyManager

obtainValidServiceUIComponents

public java.util.HashMap obtainValidServiceUIComponents()
This method will return the HashMap of the valid service ui components

Returns:
HashMap the stores valid UI Components by name

obtainInvalidServiceUIComponents

public java.util.HashMap obtainInvalidServiceUIComponents()
This method will return the HashMap of the invalid service ui components

Returns:
HashMap the stores valid UI Components by name

addServiceUIComponent

public void addServiceUIComponent(ServiceUIComponent pServiceUIComponent)
The method to add a new service UI Component to the list of valid service UI components takes a service UI component in the constructor, passes it through validation, and then only adds the component if it passes all validation

Parameters:
pServiceUIComponent - representing the Service UI Component to be added

validateServiceUIComponent

public boolean validateServiceUIComponent(ServiceUIComponent pServiceUIComponent)
The method to validate a service UI Component will check if the component passes the running module check. If it passes the check, true is returned, otherwise, false.

Parameters:
pServiceUIComponent - represents the component to be validated
Returns:
boolean represents if component passed validation

isValidProduct

public boolean isValidProduct(java.lang.String pProduct)
The method to check if a product is valid takes the name of the module as the parameter and returns true if the module is running

Parameters:
pProduct - represents the name of the module being checked.
Returns:
boolean represents if the module exists or not

removeServiceUIComponent

public void removeServiceUIComponent(ServiceUIComponent pServiceUIComponent)
The method to add a remove a service UI Component from the list of valid service UI components takes a service UI component as an argument and removes it from the list of valid service ui components.

Parameters:
pServiceUIComponent - representing the Service UI Component to be added

getAllServiceUIComponents

public java.util.Collection getAllServiceUIComponents()
This method will return the collection of all valid service ui components

Returns:
Collection representing all of the valid service UI Components

getServiceUIComponentByName

public ServiceUIComponent getServiceUIComponentByName(java.lang.String pName)
The method to det a service UI component by name will return a service ui component if its name is stored in the key of the HashMap of valid service ui components

Parameters:
pName - representing the name of the component being looked up
Returns:
ServiceUIComponent that has the same name as the name in the search

getServiceUIComponentByLicense

public java.util.Collection getServiceUIComponentByLicense(java.lang.String pLicense)
The method to get the list of valid components by license will return the list of ui components that are valid and bound to the license in the search

Parameters:
pLicense - represents the license used in the search
Returns:
Collection represents the components that mapped to this license

getServiceUIComponentByModule

public java.util.Collection getServiceUIComponentByModule(java.lang.String pModule)
The method to get the list of valid running modules as authenticated by the /atg/modules/ModuleManager component. If a module is valid and registered with this service, then a lookup by this module name will return the list of all service ui components that are mapped to that module

Parameters:
pModule - represents the module used in the search
Returns:
Collection represents the components that mapped to this module

getServiceUIComponentByType

public java.util.Collection getServiceUIComponentByType(java.lang.String pComponentType)
The method to get the list of valid running modules by UI Component Type seems like it would be useful as it will return the list of valid TABS, or the list of valid panels upon search.

Parameters:
pComponentType - represents the UI Component Type used in the search such as the Tab, Panel, Field-Definition
Returns:
Collection represents the components that mapped to this UI Type

getIsVisible

public boolean getIsVisible(java.lang.String pName)
This one method is the heart and sole of this application, and all of the other methods are to support this method that will return true if the component being rendered and looked up by name is running and licensed.

Parameters:
pName - represents the name of the component that is being looked up
Returns:
boolean represents whether or not a component is licensed and running

doStartService

public void doStartService()
Overrides:
doStartService in class atg.nucleus.GenericService

initializeService

public void initializeService()
This method reads the input list of all of the UI Components and passes each component through validation and runs once nucleus has started