atg.repository.search.indexing.config
Class SearchUpdateAdapter

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.search.adapter.customization.CustomizationDataAdapterImpl
              extended by atg.repository.search.indexing.config.SearchUpdateAdapter
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, atg.search.adapter.customization.CustomizationDataAdapter, java.util.EventListener

public class SearchUpdateAdapter
extends atg.search.adapter.customization.CustomizationDataAdapterImpl

This class is a search adapter to collect dynamically changing data for a specific type of item.
The adapter will be registered with search administration and should be kicked off regularly.
It contains a list of collector classes which carry out the specific data collection and an xml generator.
The xml generator creates the xml required by the search engine from an array of SearchUpdateOutputProperty objects.
Typically this adapter is configured to collect data for all sku or products in the product catalog.
It will iterate through the items and call the collectors to process them.


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
SearchUpdateAdapter()
           
 
Method Summary
 java.util.List enumerateAutoApplyCustomizationItemsByTypeAndProject(atg.search.adapter.customization.CustomizationType pCustomizationType, java.lang.String pProjectId)
          Returns the ids for the customization items defined by this adapter.
 java.util.List enumerateCustomizationItems()
          Returns the ids for the customization items defined by this adapter.
 java.util.List enumerateCustomizationItemsByType(atg.search.adapter.customization.CustomizationType pCustomizationType)
          Returns the ids for the customization items defined by this adapter.
protected  java.util.List enumerateItems(java.lang.String pId)
           
protected  void generateXMLForProperties(java.lang.String pId, java.util.List pOutputProperties, java.io.OutputStream pOut)
           
 int getBatchSize()
           
 java.lang.String getBatchXMLAsString(java.lang.String pId)
           
 SearchUpdateCollector[] getCollectors()
           
 atg.search.adapter.customization.CustomizationItem getCustomizationItem(atg.search.adapter.customization.CustomizationType pCustomizationType, java.lang.String pCustomizationItemId)
          Returns a customization item for the requested id
 java.lang.String getDisplayName()
          Returns the display name for this customization adapter.
 java.lang.String getIndexedIdPropertyName()
           
 RepositoryItemDescriptor getIndexedItemDescriptor()
           
 java.lang.String getIndexedItemDescriptorName()
           
 RepositoryItemGroup getIndexedItemsGroup()
           
 Repository getIndexedRepository()
           
 java.util.Collection getSupportedCustomizationTypes()
          Returns a collection of the customization types supported by this adapter.
 javax.transaction.TransactionManager getTransactionManager()
           
 SearchUpdateXMLGenerator getXMLGenerator()
           
 boolean isAutoApplyAll()
          Whether to auto-apply all customization items.
protected  void populateListForItem(java.lang.String pId, java.util.List pOutputProperties)
           
 void setBatchSize(int pBatchSize)
           
 void setCollectors(SearchUpdateCollector[] pCollectors)
           
 void setDisplayName(java.lang.String pDisplayName)
           
 void setIndexedIdPropertyName(java.lang.String pIndexedIdPropertyName)
           
 void setIndexedItemDescriptorName(java.lang.String pIndexedItemDescriptorName)
           
 void setIndexedItemsGroup(RepositoryItemGroup pIndexedItemsGroup)
           
 void setIndexedRepository(Repository pIndexedRepository)
           
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
           
 void setXMLGenerator(SearchUpdateXMLGenerator pXMLGenerator)
           
 
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, reResolveThis, 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
 
Methods inherited from interface atg.naming.NameContextElement
getName, getNameContext
 
Methods inherited from interface atg.naming.NameContextBindingListener
nameContextElementBound, nameContextElementUnbound
 

Field Detail

CLASS_VERSION

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

See Also:
Constant Field Values
Constructor Detail

SearchUpdateAdapter

public SearchUpdateAdapter()
Method Detail

setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()

getIndexedRepository

public Repository getIndexedRepository()

setIndexedRepository

public void setIndexedRepository(Repository pIndexedRepository)

getXMLGenerator

public SearchUpdateXMLGenerator getXMLGenerator()

setXMLGenerator

public void setXMLGenerator(SearchUpdateXMLGenerator pXMLGenerator)

setBatchSize

public void setBatchSize(int pBatchSize)

getBatchSize

public int getBatchSize()

setIndexedItemDescriptorName

public void setIndexedItemDescriptorName(java.lang.String pIndexedItemDescriptorName)

getIndexedItemDescriptorName

public java.lang.String getIndexedItemDescriptorName()

getIndexedItemDescriptor

public RepositoryItemDescriptor getIndexedItemDescriptor()

setIndexedIdPropertyName

public void setIndexedIdPropertyName(java.lang.String pIndexedIdPropertyName)

getIndexedIdPropertyName

public java.lang.String getIndexedIdPropertyName()

setCollectors

public void setCollectors(SearchUpdateCollector[] pCollectors)

getCollectors

public SearchUpdateCollector[] getCollectors()

setDisplayName

public void setDisplayName(java.lang.String pDisplayName)

setIndexedItemsGroup

public void setIndexedItemsGroup(RepositoryItemGroup pIndexedItemsGroup)

getIndexedItemsGroup

public RepositoryItemGroup getIndexedItemsGroup()

isAutoApplyAll

public boolean isAutoApplyAll()
Whether to auto-apply all customization items. This also hides the customization items from enumerateCustomizationItemsByType, and enumerateCustomizationItems methods from the CustomizationDataAdapter interface.

Specified by:
isAutoApplyAll in interface atg.search.adapter.customization.CustomizationDataAdapter
Overrides:
isAutoApplyAll in class atg.search.adapter.customization.CustomizationDataAdapterImpl

enumerateCustomizationItemsByType

public java.util.List enumerateCustomizationItemsByType(atg.search.adapter.customization.CustomizationType pCustomizationType)
Returns the ids for the customization items defined by this adapter. The ids will be passed into #getCustomizationItem() to retrieve the actual customization item.

Specified by:
enumerateCustomizationItemsByType in interface atg.search.adapter.customization.CustomizationDataAdapter
Specified by:
enumerateCustomizationItemsByType in class atg.search.adapter.customization.CustomizationDataAdapterImpl
Returns:
List of String representing the customization items defined by this adapter.

enumerateCustomizationItems

public java.util.List enumerateCustomizationItems()
Returns the ids for the customization items defined by this adapter. The ids will be passed into #getCustomizationItem() to retrieve the actual customization item. For search updates we will deploy all commands as one single item, so only 1 id will be returned.

Specified by:
enumerateCustomizationItems in interface atg.search.adapter.customization.CustomizationDataAdapter
Specified by:
enumerateCustomizationItems in class atg.search.adapter.customization.CustomizationDataAdapterImpl
Returns:
List of String representing the customization items defined by this adapter.

enumerateAutoApplyCustomizationItemsByTypeAndProject

public java.util.List enumerateAutoApplyCustomizationItemsByTypeAndProject(atg.search.adapter.customization.CustomizationType pCustomizationType,
                                                                           java.lang.String pProjectId)
                                                                    throws atg.search.adapter.exception.CustomizationItemNotFoundException
Returns the ids for the customization items defined by this adapter. The ids will be passed into #getCustomizationItem() to retrieve the actual customization item.

Specified by:
enumerateAutoApplyCustomizationItemsByTypeAndProject in interface atg.search.adapter.customization.CustomizationDataAdapter
Overrides:
enumerateAutoApplyCustomizationItemsByTypeAndProject in class atg.search.adapter.customization.CustomizationDataAdapterImpl
Returns:
List of String representing the customization items defined by this adapter.
Throws:
atg.search.adapter.exception.CustomizationItemNotFoundException

getCustomizationItem

public atg.search.adapter.customization.CustomizationItem getCustomizationItem(atg.search.adapter.customization.CustomizationType pCustomizationType,
                                                                               java.lang.String pCustomizationItemId)
                                                                        throws atg.search.adapter.exception.CustomizationItemNotFoundException
Returns a customization item for the requested id

Specified by:
getCustomizationItem in interface atg.search.adapter.customization.CustomizationDataAdapter
Specified by:
getCustomizationItem in class atg.search.adapter.customization.CustomizationDataAdapterImpl
Parameters:
pCustomizationItemId - The unique identifier for a CustomizationItem
Returns:
atg.commerce.search.config.SearchUpdateCustomizationItem
Throws:
atg.search.adapter.exception.CustomizationItemNotFoundException

getSupportedCustomizationTypes

public java.util.Collection getSupportedCustomizationTypes()
Returns a collection of the customization types supported by this adapter.

Specified by:
getSupportedCustomizationTypes in interface atg.search.adapter.customization.CustomizationDataAdapter
Specified by:
getSupportedCustomizationTypes in class atg.search.adapter.customization.CustomizationDataAdapterImpl
Returns:
List of atg.searchadmin.adapter.customization.CustomizationType

getDisplayName

public java.lang.String getDisplayName()
Returns the display name for this customization adapter.

Specified by:
getDisplayName in interface atg.search.adapter.customization.CustomizationDataAdapter
Specified by:
getDisplayName in class atg.search.adapter.customization.CustomizationDataAdapterImpl

getBatchXMLAsString

public java.lang.String getBatchXMLAsString(java.lang.String pId)
                                     throws SearchUpdateException
Throws:
SearchUpdateException

enumerateItems

protected java.util.List enumerateItems(java.lang.String pId)
                                 throws SearchUpdateException
Throws:
SearchUpdateException

populateListForItem

protected void populateListForItem(java.lang.String pId,
                                   java.util.List pOutputProperties)
                            throws SearchUpdateException
Throws:
SearchUpdateException

generateXMLForProperties

protected void generateXMLForProperties(java.lang.String pId,
                                        java.util.List pOutputProperties,
                                        java.io.OutputStream pOut)
                                 throws SearchUpdateException
Throws:
SearchUpdateException