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:
atg.repository.loader.ExtFilterTypeMapper
specifies one or more file extensions in itsextensions
property. Source file extensions are thereby mapped to the appropriate TypeMappings.atg.repository.loader.DirFilterTypeMapper
specifies one or more source file parent directories in itsdirectories
property. These directories determine the location of source file type mappings.
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 |
---|---|
| The Nucleus address of the TypeMapping that handles folder item descriptors. This property is required if any source files are content item types. |
| An array of Nucleus addresses of the TypeMappings used by this TypeMapper component. |
| An array of file extensions, specified in TypeMappers of class |
| An array of directories, provided in TypeMappers of class |
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 |
---|---|
| A boolean property, specifies whether files assigned to this mapping contain XML content. |
| A boolean property, specifies whether to parse the content of files assigned to this mapping for property values. |
| The name of the item descriptor handled by this TypeMapping. |
| The Nucleus address of the ContentHandler component that handles content for this mapping. |
| The Nucleus address of the ContentRootPathProvider component used by this mapping, if any. |
| The Nucleus address of the PageEncodingTyper used by this mapping, if any. |
| 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. |
| The Nucleus address of the MutableRepository that contains the item descriptor handled by this TypeMapping. |
| Specifies how this mapping uses ID and path properties to create, update, and remove items, one of the following:
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:
CONTENT_ITEM_DESCRIPTOR_ID_AND_PATH_PROP
For content item descriptor types only, use descriptor metadata to determine which properties should be used to assign the repository item ID and path properties. IDs can still be assigned from content data.
If you use this value, make sure the source files do not include an ID tag, or set their TypeMapping’s
parseContent
property tofalse
.CONTENT_DEFINED_ID_AND_NO_PATH_PROP
The repository item ID property is set as part of the file parsing process. Because the file content uniquely and persistently defines the repository item’s ID, no path property needs to be assigned.
CONTENT_DEFINED_ID_AND_NAMED_PATH_PROP
The repository item ID property is set as part of the file parsing process. Set the repository item property specified by the TypeMapping’s
pathPropertyName
property with the file’s path.GENERATED_ID_AND_NO_PATH_PROP
Use a value generated by the
IdGenerator
for the repository item ID, using theIdGenerator
specified by theTypeMapping
’sidGenerator
property. If noidGenerator
is specified, errors result. No path property is set. As a consequence, files assigned to this mapping cannot be updated or removed with the Repository Loader.GENERATED_ID_AND_NAMED_PATH_PROP
Use a value generated by the
IdGenerator
for the repository item ID, using theIdGenerator
specified by theTypeMapping
’sidGenerator
property. If noidGenerator
is specified, errors result. Set the repository item property specified by theTypeMapping
’spathPropertyName
property with the file’s path.ID_EQUALS_FILE_PATH
For non-content item descriptors. Use the file’s path as both its repository item ID and its path value. If you use this value, make sure the source files do not include an ID tag, or set their TypeMapping’s
parseContent
property tofalse
.