atg.endeca.index.dimension
Class RepositoryTypeHierarchyExporter

java.lang.Object
  extended by PerApplicationExporter
      extended by atg.endeca.index.dimension.RepositoryTypeHierarchyExporter
All Implemented Interfaces:
DimensionNameProvider

public class RepositoryTypeHierarchyExporter
extends PerApplicationExporter
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


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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()
           
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 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

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.

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
Throws:
ServiceException

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