Your file system might have different file types, where each type has different requirements for conversion into a repository item. The TypeMapper component determines which of the configured set of TypeMapping components is appropriate for a given file. Each TypeMapping specifies a content handler component. The file is routed to the appropriate ContentHandler for its type.

TypeMapper component

A TypeMapper component can be created from one of two classes:

In both cases, the extensions and directories are array properties whose elements map to the corresponding elements in the typeMappings property.

In the following example, a TypeMapper configuration maps five file extensions to five TypeMappings. Thus, files with extension .cfo map to TypeMapping CatalogFolderTypeMapping, .ctg maps to CatalogTypeMapping, and so on:

$class=atg.repository.loader.ExtFilterTypeMapper
$scope=global

extensions+=.cfo,.ctg,.cat,.prd,.sku
typeMappings+=\
  CatalogFolderTypeMapping,\
  CatalogTypeMapping,\
  CategoryTypeMapping,\
  ProductTypeMapping,\
  SkuTypeMapping
TypeMapper properties

A TypeMapper component is configured with the following properties:

Property

Description

folderTypeMapping

The Nucleus address of the TypeMapping that handles folder item descriptors. This property is required if any source files are content item types.

typeMappings

An array of Nucleus addresses of the TypeMappings used by this TypeMapper component.

extensions

An array of file extensions, specified in TypeMappers of class atg.repository.loader.ExtFilterTypeMapper.

directories

An array of directories, provided in TypeMappers of class atg.repository.loader.ExtFilterTypeMapper.

TypeMapping properties

The Repository Loader includes a TypeMappingImpl implementation of the TypeMapping interface. You can configure an instance of TypeMappingImpl for a given item descriptor with the following properties:

Property

Description

contentIsXML

A boolean property, specifies whether files assigned to this mapping contain XML content.

parseContent

A boolean property, specifies whether to parse the content of files assigned to this mapping for property values.

itemDescriptorName

The name of the item descriptor handled by this TypeMapping.

contentHandler

The Nucleus address of the ContentHandler component that handles content for this mapping.

contentRootPathProvider

The Nucleus address of the ContentRootPathProvider component used by this mapping, if any.

encodingTyper

The Nucleus address of the PageEncodingTyper used by this mapping, if any.

pathPropertyName

If the item descriptor is not a content item descriptor, set this property to the name of a repository item property to hold the file path of the items.

repository

The Nucleus address of the MutableRepository that contains the item descriptor handled by this TypeMapping.

updatePropertyConfiguration

Specifies how this mapping uses ID and path properties to create, update, and remove items, one of the following:

CONTENT_ITEM_DESCRIPTOR_ID_AND_PATH_PROP
CONTENT_DEFINED_ID_AND_NO_PATH_PROP
CONTENT_DEFINED_ID_AND_NAMED_PATH_PROP
GENERATED_ID_AND_NO_PATH_PROP
GENERATED_ID_AND_NAMED_PATH_PROP
ID_EQUALS_FILE_PATH

For information about these settings, see Setting Repository IDs.

Setting Repository IDs

When the Repository Loader creates a repository item from a file, it must assign that item a repository item ID. A TypeMapping’s updatePropertyConfiguration property points to an enumeration (of class UpdatePropertyConfiguration) that describes how repository item IDs and path properties are used by the repository, and the TypeMapping used to set the repository item ID and locate repository items for update.

The enumeration can be set to one of the following values:

 
loading table of contents...