Defining catalog aware item types
- 11th Feb 2018
- 4
- 52335
- how to add custom item types for synchronization how to define catalog aware item type in hybris How to define synchronization for custom item type How to make an item type as catalog aware item type how to make custom type as catalog aware type synchronizing custom item type in hybris
Sometimes, it is required to define our custom item types as Catalog aware item types in order to make them eligible for synchronization.
It means we need to associate these custom item types with a catalog (content or product)
We can achieve this either in HMC/Backoffice or by defining required attributes in items.xml file.
Note : Here we will not discuss about HMC/Backoffice way as it does not persist for a long time.
Let’s see how we can make item types as catalog aware using items.xml
Step 1:
Enable item type as catalog item type, using custom property catalogItemType
Step 2:
Define the attribute catalogVersionAttributeQualifier with value same as qualifier of catalogversion attribute in the same item type.
Step 3:
Define the attribute uniqueKeyAttributeQualifier with value same as qualifier of unique attribute in the same item type and if there are multiple unique attributes then separate them by comma
.
So with these steps, new item type definition in items.xml will be as below
- <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>
<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>
Once above configuration is done, We need to build and also need to update the platform using system update.
After that above item type is synchronizable which means source content of this item type will be copied to target automatically when we do synchronization.
Thanks KB. Nice Information. Kindly make an article on Product Cockpit.
nice article KB. Thanks for the post if it possible I want more info about datahub
thanks for the post, it helped me a lot. Thanks KB
can you plse add some customization of the registration page like adding new filed like city in registration page.