atg.svc.repository.service
Class TransactionalFragmentService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.svc.repository.service.BaseService
              extended by atg.svc.repository.service.KnowledgeBaseService
                  extended by atg.svc.repository.service.TransactionalFragmentService
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class TransactionalFragmentService
extends KnowledgeBaseService

TransactionalFragmentService Business services for managing Transactional Fragments and associated objects.

See Also:
TransactionalFragment, TransactionalFragmentParameter, TransactionalFragmentParameterListValue, TransactionalFragmentFieldValue, TransactionalFragmentParameterValue

Nested Class Summary
protected static class TransactionalFragmentService.TransactionalFragmentComparator
           
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
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
TransactionalFragmentService()
           
 
Method Summary
 TransactionalFragmentFieldValue copyTransactionalFragmentFieldValue(TransactionalFragmentFieldValue pSrcValue)
          Creates a new TransactionalFieldValue from an existing TransactionalFieldValue by creating new objects and filling them in with the data from the existing objects.
 SolutionFieldValue createSolutionFieldValue(java.lang.String pFragmentPath, java.util.Map pParamValues, SolutionHomes pHomes)
          

Creates a new SolutionFieldValue object specifically for Transactional Fragment fields.

 TransactionalFragmentParameter createTransactionalFragmentParameter()
          Creates a new TransactionalFragmentParameter object that has not been committed to the repository.
 TransactionalFragmentParameterListValue createTransactionalFragmentParameterListValue()
          Creates a new TransactionalFragmentParameterListValue object that has not been committed to the repository.
 java.util.List getAllTransactionalFragments()
          Gets a List of all TransactionalFragment components configured in the registry that are selectable.
 TransactionalFragment getDefaultFragment()
          Gets the default fragment to show when a requested fragment component cannot be resolved by name.
 atg.assetregistry.RegistryManager getRegistryManager()
          Gets the asset registry manager for getting the transactional fragment nucleus components.
 java.lang.String getRegistryName()
          Gets the name of the registry where the transactional fragments are stored.
 java.lang.String getRegistryPath()
          Gets the path in the config layer where the transactional fragment components are found.
 SolutionService getSolutionService()
          Gets the SolutionService business component.
 TransactionalFragment getTransactionalFragment(java.lang.String pNucleusPath)
          Gets a TransactionalFragment component given the nucleus path to the component.
 TransactionalFragmentParameter getTransactionalFragmentParameterByName(java.lang.String pParamName, java.lang.String pResourceBundle)
          Gets a TransactionalFragmentParameter given the unique parameter name.
 void removeTransactionalFieldValue(TransactionalFragmentFieldValue pValueToDelete)
          Removes a TransactionalFragmentFieldValue and any associated TransactionalFragmentParameterValue objects from the repository.
 void saveTransactionalFragmentFieldValue(TransactionalFragmentFieldValue pTransactionalFragmentFieldValue)
          Commits the given TransactionalFragmentFieldValue to the repository.
 void saveTransactionalFragmentParameter(TransactionalFragmentParameter pParameter)
          Saves a TransactionalFragmentParameter and any list values associated with it through the parameter property.
 void setDefaultFragment(TransactionalFragment pDefaultFragment)
          Sets the default fragment to show when a requested fragment component cannot be resolved by name.
 void setRegistryManager(atg.assetregistry.RegistryManager pRegistryManager)
          Sets the asset registry manager for getting the transactional fragment nucleus components.
 void setRegistryName(java.lang.String pRegistryName)
          Sets the name of the registry where the transactional fragments are stored.
 void setRegistryPath(java.lang.String pRegistryPath)
          Sets the path in the config layer where the transactional fragment components are found.
 void setSolutionService(SolutionService pSolutionService)
          Gets the SolutionService business component.
 
Methods inherited from class atg.svc.repository.service.KnowledgeBaseService
getKnowledgeHomesFactory, getOptionBeanHomes, getOptionRepositoryHomes, getServiceSegmentBeanHomes, getServiceSegmentRepositoryHomes, getSolutionBeanHomes, getSolutionRepositoryHomes, getUserOptionBeanHomes, getUserOptionRepositoryHomes, setKnowledgeHomesFactory
 
Methods inherited from class atg.svc.repository.service.BaseService
getRepositoryService, getToday, setRepositoryService
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

TransactionalFragmentService

public TransactionalFragmentService()
Method Detail

getRegistryPath

public java.lang.String getRegistryPath()
Gets the path in the config layer where the transactional fragment components are found. By default the path is /atg/registry/TransactionalFragments.

Returns:
The path in the config layer where the transactional fragment components are found.

setRegistryPath

public void setRegistryPath(java.lang.String pRegistryPath)
Sets the path in the config layer where the transactional fragment components are found. By default the path is /atg/registry/TransactionalFragments.

Parameters:
pRegistryPath - The path in the config layer where the transactional fragment components are found.

getRegistryManager

public atg.assetregistry.RegistryManager getRegistryManager()
Gets the asset registry manager for getting the transactional fragment nucleus components.

Returns:
The RegistryManager.

setRegistryManager

public void setRegistryManager(atg.assetregistry.RegistryManager pRegistryManager)
Sets the asset registry manager for getting the transactional fragment nucleus components.

Parameters:
pRegistryManager - The RegistryManager.

getRegistryName

public java.lang.String getRegistryName()
Gets the name of the registry where the transactional fragments are stored.

Returns:
The String name of the registry.

setRegistryName

public void setRegistryName(java.lang.String pRegistryName)
Sets the name of the registry where the transactional fragments are stored.

Parameters:
pRegistryName - The String name of the registry.

getSolutionService

public SolutionService getSolutionService()
Gets the SolutionService business component.

Returns:
The SolutionService.

setSolutionService

public void setSolutionService(SolutionService pSolutionService)
Gets the SolutionService business component.

Parameters:
pSolutionService - The SolutionService.

getDefaultFragment

public TransactionalFragment getDefaultFragment()
Gets the default fragment to show when a requested fragment component cannot be resolved by name.

Returns:
The default fragment.

setDefaultFragment

public void setDefaultFragment(TransactionalFragment pDefaultFragment)
Sets the default fragment to show when a requested fragment component cannot be resolved by name.

Parameters:
pDefaultFragment - The default fragment.

createSolutionFieldValue

public SolutionFieldValue createSolutionFieldValue(java.lang.String pFragmentPath,
                                                   java.util.Map pParamValues,
                                                   SolutionHomes pHomes)
                                            throws javax.ejb.CreateException

Creates a new SolutionFieldValue object specifically for Transactional Fragment fields.

The SolutionFieldValue is created and associated with the given TransactionalFragment by creating a new TransactionalFragmentFieldValue object and setting it on the SolutionFieldValue. The parameters for the TransactionalFragmentFieldValue are created on that object from the parameters in the TransactionalFragment component and each value in the given Map is set on the corresponding TransactionalFragmentParameterValue object by name. If a parameter in the transactional fragment has no parameter in the given Map then the default value of the transactional fragment parameter is used.

Once the new SolutionFieldValue is added to a SolutionField, calling saveSolution on the SolutionService will save save the new SolutionFieldValue, TransactionalFragmentFieldValue and any new parameter values that were set on the parameters property.

Parameters:
pFragmentPath - The nucleus path of the fragment to associate with the transactional fragment field value.
pParamValues - A Map of parameter values keyed by the parameter name.
pHomes - The homes to create the solution field value and underlying transactional fragment objects from.
Returns:
A TransactionalFragmentFieldValue repository impl.
Throws:
javax.ejb.CreateException - If the create operation fails.
java.lang.NullPointerException - If the given path does not resolve to a component in nucleus.
java.lang.ClassCastException - If the given path resolves to an component that is not a TransactionalFragment type.

saveTransactionalFragmentFieldValue

public void saveTransactionalFragmentFieldValue(TransactionalFragmentFieldValue pTransactionalFragmentFieldValue)
                                         throws PersistenceException
Commits the given TransactionalFragmentFieldValue to the repository. The TransactionalFragmentFieldValue and any associated TransactionalFragmentParameterValue objects that have changed will be saved.

Parameters:
pTransactionalFragmentFieldValue - The TransactionalFragmentFieldValue to save.
Throws:
PersistenceException - If the save operation fails.

copyTransactionalFragmentFieldValue

public TransactionalFragmentFieldValue copyTransactionalFragmentFieldValue(TransactionalFragmentFieldValue pSrcValue)
                                                                    throws javax.ejb.CreateException
Creates a new TransactionalFieldValue from an existing TransactionalFieldValue by creating new objects and filling them in with the data from the existing objects. Any contains TransactionFieldParameterValues are copied also. The copy is a deep copy.

Parameters:
pSrcValue - The transactional field value to deep copy.
Returns:
The new copy of the transactional field value object but not committed to the repository.
Throws:
javax.ejb.CreateException - If a create of a new object fails.

removeTransactionalFieldValue

public void removeTransactionalFieldValue(TransactionalFragmentFieldValue pValueToDelete)
                                   throws javax.ejb.RemoveException
Removes a TransactionalFragmentFieldValue and any associated TransactionalFragmentParameterValue objects from the repository.

Parameters:
pValueToDelete - The TransactionalFragmentFieldValue to remove.
Throws:
javax.ejb.RemoveException - If a remove operation fails.

getTransactionalFragment

public TransactionalFragment getTransactionalFragment(java.lang.String pNucleusPath)
Gets a TransactionalFragment component given the nucleus path to the component.

Parameters:
pNucleusPath - The nucleus path to the component to resolve.
Returns:
The TransactionalFragment component or null if no component is resolved with the given name.
Throws:
java.lang.ClassCastException - If the path resolves to a component that is not of type TransactionalFragment.

getAllTransactionalFragments

public java.util.List getAllTransactionalFragments()
Gets a List of all TransactionalFragment components configured in the registry that are selectable. All components in any folder under the /atg/registry/TransactionalFragment directory that are of type TransactionalFragment with the property isSelectable=true will be returned in the list.

Returns:
A List of TransactionalFragment components.

getTransactionalFragmentParameterByName

public TransactionalFragmentParameter getTransactionalFragmentParameterByName(java.lang.String pParamName,
                                                                              java.lang.String pResourceBundle)
                                                                       throws ObjectNotFoundException
Gets a TransactionalFragmentParameter given the unique parameter name. The given resource bundle is used to lookup the value in the label property and substitute the resource value if found in the resource bundle. If the parameter has any list values the displayName on each list value is replaced with the resource value if found in the resource bundle.

Parameters:
pParamName - The parameter Name.
Returns:
The TransactionalFragmentParameter object.
Throws:
ObjectNotFoundException - If a TransactionalFragmentParameter with the given name cannot be found.
java.util.MissingResourceException - If the given resource bundle is not found in the class path.

createTransactionalFragmentParameter

public TransactionalFragmentParameter createTransactionalFragmentParameter()
                                                                    throws javax.ejb.CreateException
Creates a new TransactionalFragmentParameter object that has not been committed to the repository.

Returns:
A TransactionalFragmentParameter repository impl.
Throws:
javax.ejb.CreateException - If the create operation fails.

createTransactionalFragmentParameterListValue

public TransactionalFragmentParameterListValue createTransactionalFragmentParameterListValue()
                                                                                      throws javax.ejb.CreateException
Creates a new TransactionalFragmentParameterListValue object that has not been committed to the repository.

Returns:
A TransactionalFragmentParameterListValue repository impl.
Throws:
javax.ejb.CreateException - If the create operation fails.

saveTransactionalFragmentParameter

public void saveTransactionalFragmentParameter(TransactionalFragmentParameter pParameter)
                                        throws PersistenceException
Saves a TransactionalFragmentParameter and any list values associated with it through the parameter property.

Parameters:
pParameter - The parameter to save.
Throws:
PersistenceException - If the save operation fails.