atg.endeca.index.dimension
Class RepositoryTypeHierarchyExporter

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.endeca.index.LocaledExporter
              extended by atg.endeca.index.dimension.RepositoryTypeHierarchyExporter
All Implemented Interfaces:
Indexable, DimensionNameProvider, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class RepositoryTypeHierarchyExporter
extends LocaledExporter
implements DimensionNameProvider

This class exports the repository hierarchy of any items referrred to by an IndexingOutputConfig as an Endeca dimension hierarchy.

Created: November 16 2011


Nested Class Summary
 
Nested classes/interfaces inherited from class atg.endeca.index.LocaledExporter
LocaledExporter.MinimalBulkLoaderResults, LocaledExporter.MinimalIncrementalLoaderResults
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string from source code control system.
 
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
RepositoryTypeHierarchyExporter()
           
 
Method Summary
protected  void addParentAndChildTypes(java.util.Set<RepositoryItemDescriptor> pTypes, RepositoryItemDescriptor pType)
          Add pType and any supertypes and sub-types of pType to pTypes.
protected  void addReferencedTypes(java.util.Set<RepositoryItemDescriptor> pTypes, atg.repository.search.indexing.specifier.OutputItemSpecifier pSpecifier)
          Add the types referenced by OutputItemSpecifiers to pTypes, and do the same for any subItem OutputItemSpecifiers.
protected  Records createExportRecords(EndecaContext pContext, java.util.Locale pLocale)
          Create the export records for the specified locale.
protected  Record createMultiLanguageNodeFromType(RepositoryItemDescriptor pItemDescriptor)
          Create a dimvals Record from the specified RepositoryItemDescriptor type and all given locales
protected  Record createNodeFromType(RepositoryItemDescriptor pItemDescriptor, java.util.Locale pLocale)
          Create a dimvals Record from the specified RepositoryItemDescriptor type.
protected  Record createRootNode(java.util.Locale pLocale)
          Create a dimvals root node Record
 void doStartService()
          This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.
protected  java.util.Set<RepositoryItemDescriptor> getAllReferencedTypes()
          Get the set of all the types mentioned in the IndexingOutputConfig, and all the parents and children of those types.
 java.lang.String getDimensionDisplayName()
          Returns property dimensionDisplayName.
 java.lang.String getDimensionDisplayNameFromResource()
          Returns property dimensionDisplayNameFromResource.
protected  java.lang.String getDimensionDisplayNameFromResource(java.util.Locale pLocale)
           
 java.lang.String getDimensionName()
          Returns property dimensionName.
 java.lang.String getDimensionNameForProperty(atg.repository.search.indexing.specifier.OutputProperty pProperty)
          Get the dimension name for the specified property.
 boolean getMultiLanguageSynonyms()
          Returns property multiLanguageSynonyms
 java.lang.String getResourceBundleName()
          Returns property resourceBundleName.
 java.util.Set<atg.repository.search.indexing.specifier.OutputProperty> getTypeOutputProperties()
          Returns property typeOutputProperties.
protected  java.lang.String or(java.lang.String... pStrings)
          Returns the first non-null value.
 void setDimensionDisplayName(java.lang.String pDimensionDisplayName)
          Sets property dimensionDisplayName.
 void setDimensionName(java.lang.String pDimensionName)
          Sets property dimensionName.
 void setMultiLanguageSynonyms(boolean pMultiLanguageSynonyms)
          Sets property multiLanguageSynonyms.
 void setResourceBundleName(java.lang.String pResourceBundleName)
          Sets property resourceBundleName.
 void setTypeOutputProperties(java.util.Set<atg.repository.search.indexing.specifier.OutputProperty> pTypeOutputProperties)
          Sets property typeOutputProperties.
 
Methods inherited from class atg.endeca.index.LocaledExporter
cancel, createAdminServlet, createContext, createExportRecordsAsXML, createExportRecordsForLocale, export, export, exportRecords, getDefaultLanguageForRecordStores, getDocumentSubmitter, getExportRecordsForDefaultLocale, getIndexingOutputConfig, getIndexingOutputConfigPaths, getLocales, initContext, isNeededForIncremental, isSupportsStatusCounts, mayNeedCleanup, performBaselineUpdate, performPartialUpdate, postIndexingCleanup, restoreDynamoRequestLocale, setDefaultLanguageForRecordStores, setDocumentSubmitter, setDynamoRequestLocale, setIndexingOutputConfig, setLocales
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, 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, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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 final java.lang.String CLASS_VERSION
Class version string from source code control system.

See Also:
Constant Field Values
Constructor Detail

RepositoryTypeHierarchyExporter

public RepositoryTypeHierarchyExporter()
Method Detail

setResourceBundleName

public void setResourceBundleName(java.lang.String pResourceBundleName)
Sets property resourceBundleName. Path to our resource bundle.


getResourceBundleName

public java.lang.String getResourceBundleName()
Returns property resourceBundleName. Path to our resource bundle.


setDimensionName

public void setDimensionName(java.lang.String pDimensionName)
Sets property dimensionName. The name of the dimension. This is used for spec and qualified spec of the root node.


getDimensionName

public java.lang.String getDimensionName()
Returns property dimensionName. The name of the dimension. This is used for spec and qualified spec of the root node.


setDimensionDisplayName

public void setDimensionDisplayName(java.lang.String pDimensionDisplayName)
Sets property dimensionDisplayName. The default display name value. Used if no display name resource is found.


getDimensionDisplayName

public java.lang.String getDimensionDisplayName()
Returns property dimensionDisplayName. The default display name value. Used if no display name resource is found.


setTypeOutputProperties

public void setTypeOutputProperties(java.util.Set<atg.repository.search.indexing.specifier.OutputProperty> pTypeOutputProperties)
Sets property typeOutputProperties. The set of OutputProperties which reference a type.


getTypeOutputProperties

public java.util.Set<atg.repository.search.indexing.specifier.OutputProperty> getTypeOutputProperties()
Returns property typeOutputProperties. The set of OutputProperties which reference a type.


getDimensionDisplayNameFromResource

public java.lang.String getDimensionDisplayNameFromResource()
Returns property dimensionDisplayNameFromResource. The display name from our resource bundle, if any.


getDimensionDisplayNameFromResource

protected java.lang.String getDimensionDisplayNameFromResource(java.util.Locale pLocale)

setMultiLanguageSynonyms

public void setMultiLanguageSynonyms(boolean pMultiLanguageSynonyms)
Sets property multiLanguageSynonyms.


getMultiLanguageSynonyms

public boolean getMultiLanguageSynonyms()
Returns property multiLanguageSynonyms


getAllReferencedTypes

protected java.util.Set<RepositoryItemDescriptor> getAllReferencedTypes()
                                                                 throws atg.repository.search.indexing.IndexingException
Get the set of all the types mentioned in the IndexingOutputConfig, and all the parents and children of those types. Also sets our "typeOutputProperties" property.

Throws:
atg.repository.search.indexing.IndexingException

addReferencedTypes

protected void addReferencedTypes(java.util.Set<RepositoryItemDescriptor> pTypes,
                                  atg.repository.search.indexing.specifier.OutputItemSpecifier pSpecifier)
Add the types referenced by OutputItemSpecifiers to pTypes, and do the same for any subItem OutputItemSpecifiers. Note this does no add sub-types referenced by properties.

Parameters:
pTypes - the set of types to add to.
pSpecifier - the specifier whose referenced type to add, as well as the types referenced by any sub-items.

addParentAndChildTypes

protected void addParentAndChildTypes(java.util.Set<RepositoryItemDescriptor> pTypes,
                                      RepositoryItemDescriptor pType)
                               throws RepositoryException
Add pType and any supertypes and sub-types of pType to pTypes.

Parameters:
pTypes - the set of types to add to.
pType - the type to add.
Throws:
RepositoryException

createExportRecords

protected Records createExportRecords(EndecaContext pContext,
                                      java.util.Locale pLocale)
                               throws atg.repository.search.indexing.IndexingException
Create the export records for the specified locale.

Specified by:
createExportRecords in class LocaledExporter
Parameters:
pContext - the current indexing context.
pLocale - to locale for which to generate records.
Returns:
the generated set of records.
Throws:
atg.repository.search.indexing.IndexingException

createNodeFromType

protected Record createNodeFromType(RepositoryItemDescriptor pItemDescriptor,
                                    java.util.Locale pLocale)
Create a dimvals Record from the specified RepositoryItemDescriptor type.

Parameters:
pItemDescriptor - the repository item type to create a dimvals Record for.
pLocale - the locale to which we are currently exporting.

createMultiLanguageNodeFromType

protected Record createMultiLanguageNodeFromType(RepositoryItemDescriptor pItemDescriptor)
Create a dimvals Record from the specified RepositoryItemDescriptor type and all given locales

Parameters:
pItemDescriptor - the repository item type to create a dimvals Record for.

createRootNode

protected Record createRootNode(java.util.Locale pLocale)
Create a dimvals root node Record

Parameters:
pLocale - the locale to which we are exporting.

or

protected java.lang.String or(java.lang.String... pStrings)
Returns the first non-null value.


doStartService

public void doStartService()
                    throws ServiceException
Description copied from class: GenericService
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. The Service should override this method to start any processes it requires.

Overrides:
doStartService in class LocaledExporter
Throws:
ServiceException - if the Service had a problem starting up

getDimensionNameForProperty

public java.lang.String getDimensionNameForProperty(atg.repository.search.indexing.specifier.OutputProperty pProperty)
Description copied from interface: DimensionNameProvider
Get the dimension name for the specified property. May return null if there is no recommended dimension name for that property.

Specified by:
getDimensionNameForProperty in interface DimensionNameProvider