Sometimes, it is required to define our custom
item types as Catalog aware item types in order to make them eligible for
synchronization.
While creating a data model for any project,
where we might need some of your item types to be part of catalog. This means,
you want them to synchronize, you want them to be associated with a catalog,
content or product. Such item types are known as catalog aware.
It’s not just CMS item types or products, that
needs synchronization.
All OOTB CMS items and products are catalog
aware.
We can achieve this either in HMC/Backoffice (Not
persist for a long time) or by defining required attributes in items.xml file.
Step 1:
Mark your item as catalog item type, using
custom property catalogItemType.
Step 2:
Choose attribute from item, which will qualify
the catalog associated using custom property
catalogVersionAttributeQualifier.
Step 3:
Since each item in a catalog must be unique, we
need to choose an attribute from item which is unique. This can be done using
custom property uniqueKeyAttributeQualifier. (If there are multiple unique
attributes then separate them by comma)
<itemtype code="MyCustomItemType" autocreate=”true” generate=”true”>
<deployment table=" MyCustomItemType "
typecode="12500"/>
<custom-properties>
<!-- Defining the
type as synchronizing capable here: -->
<property
name="catalogItemType">
<value>java.lang.Boolean.TRUE</value>
</property>
<!-- defining
catalog version attribute here: -->
<property
name="catalogVersionAttributeQualifier">
<value>"catalogVersion"</value>
</property>
<!-- defining
unique key attributes here; separate multiple attribute qualifiers by commas:
-->
<property
name="uniqueKeyAttributeQualifier">
<value>"code"</value>
</property>
</custom-properties>
<attributes>
<attribute qualifier="code"
type="java.lang.String">
<modifiers
read="true" write="true" search="true"
optional="false" unique=”true”/>
<persistence
type="property"/>
</attribute>
<attribute
qualifier="catalogVersion" type="CatalogVersion">
<modifiers
read="true" write="true" search="true"
optional="false"/>
<persistence
type="property"/>
</attribute>
</attributes>
</itemtype>