Target Metadata
Target items in Data Hub contain metadata that describe rules for processing and validating the items during the publication phase.
Target System Metadata Entities
The target system metadata follows a parallel structure to other Data Hub metadata. In addition, it defines the target system or systems, including credentials for publication. The target item entity relationships are shown in the following diagram.
TargetSystem
The TargetSystem type defines a system where data can be published and contains all of the information to access that particular system. It contains a set of TargetItemMetadata that has a similar structure and serves a similar purpose to the CanonicalItemMetadata. An example of the TargetSystem table from a sample data set, and its related XML definition, is shown following.
TargetSystem Table
+-------------------------------+----------------+----------------------------------+---------------------+------------------+--------------------------------------+----------------------------------------------------------+---------------------+----------+--------------+--------+------------------+ | targetsystemname | targetsystemid | password | modifiedtime | targetsystemtype | exporturl | id | creationtime | username | typecode | tenant | schemaless_attrs | +-------------------------------+----------------+----------------------------------+---------------------+------------------+--------------------------------------+----------------------------------------------------------+---------------------+----------+--------------+--------+------------------+ | HybrisApparelCoreInstallation | 1.00000 | 3f5dd71d9f11c307c535b775922cc1ce | 2015-10-23 13:01:58 | HybrisCore | https://localhost:9002/datahubadapter | single|TargetSystem|7e354dd8-e7ee-4b87-80fd-ece3590fec7a | 2015-10-23 13:01:58 | admin | TargetSystem | single | NULL | +-------------------------------+----------------+----------------------------------+---------------------+------------------+--------------------------------------+----------------------------------------------------------+---------------------+----------+--------------+--------+------------------+
TargetSystem XML
<extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"
xsi:schemaLocation="http://www.hybris.com/schema/ http://www.hybris.com/schema/datahub-metadata-schema-1.2.0.xsd"
name="pcm-apparel-target">
<targetSystems>
<targetSystem>
<name>HybrisApparelCoreInstallation</name>
<type>HybrisCore</type>
<exportURL>${datahub.extension.exportURL}</exportURL>
<userName>${datahub.extension.userName}</userName>
<password>${datahub.extension.password}</password>
<exportCodes>
<exportCode>
$catalogVersion=catalogversion(catalog(id[default=apparelProductCatalog]),version[default='Staged'])[unique=true,default=apparelProductCatalog:Staged]
</exportCode>
<exportCode>
$baseProduct=baseProduct(code,catalogVersion(catalog(id[default='apparelProductCatalog']),version[default='Staged']))
</exportCode>
</exportCodes>
<targetItems>
<item>
...
You may publish to multiple target systems. Each has its own TargetSystem definition, and each its own complete set of TargetItemMetadata and TargetAttributeDefinition s.
TargetItemMetadata
TargetItemMetadata is a parallel structure to canonical items. It describes a TargetItem type. An example of the TargetItemMeta table from a sample data set, and its related XML definition, is shown in the following.
TargetItemMeta Table
+----------------------------------------------------------+---------------------------------------------------+---------+-------------------------------------------------------------------+------------------------+---------------------+----------------------------+----------------+-------------+----------------------------------------------------------------+---------------------+----------------------------+--------------------+--------+------------------+ | targetsystem | description | version | canonicalitemsource | isexportcodeexpression | modifiedtime | itemtype | itemmetadataid | isupdatable | id | creationtime | exportcode | typecode | tenant | schemaless_attrs | +----------------------------------------------------------+---------------------------------------------------+---------+-------------------------------------------------------------------+------------------------+---------------------+----------------------------+----------------+-------------+----------------------------------------------------------------+---------------------+----------------------------+--------------------+--------+------------------+ | single|TargetSystem|7e354dd8-e7ee-4b87-80fd-ece3590fec7a | Style Variant for an Apparel Product | NULL | single|CanonicalItemMetadata|6ca301ec-f6b8-46fa-977f-9a258e7dcbdf | 0 | 2015-10-23 13:01:58 | ApparelStyleVariantProduct | 2.00000 | 1 | single|TargetItemMetadata|6ad6b4b1-17b9-498f-9600-0d248ce88be6 | 2015-10-23 13:01:58 | ApparelStyleVariantProduct | TargetItemMetadata | single | NULL | | single|TargetSystem|7e354dd8-e7ee-4b87-80fd-ece3590fec7a | Hybris Platform representation of apparel product | NULL | single|CanonicalItemMetadata|63badf08-437e-46d6-ab39-69da892c424a | 0 | 2015-10-23 13:01:58 | ApparelProduct | 1.00000 | 1 | single|TargetItemMetadata|7c7c27dd-47a7-4600-a8a8-2477c4dba588 | 2015-10-23 13:01:58 | ApparelProduct | TargetItemMetadata | single | NULL | | single|TargetSystem|7e354dd8-e7ee-4b87-80fd-ece3590fec7a | Size Variant for an Apparel Product | NULL | single|CanonicalItemMetadata|6ca301ec-f6b8-46fa-977f-9a258e7dcbdf | 0 | 2015-10-23 13:01:58 | ApparelSizeVariantProduct | 3.00000 | 1 | single|TargetItemMetadata|990c3ad6-7876-4254-87a0-5f3011dafe25 | 2015-10-23 13:01:58 | ApparelSizeVariantProduct | TargetItemMetadata | single | NULL | | single|TargetSystem|7e354dd8-e7ee-4b87-80fd-ece3590fec7a | Product Category | NULL | single|CanonicalItemMetadata|42079a4b-7fc4-4d79-a27d-b93a975c7fc1 | 0 | 2015-10-23 13:01:58 | Category | 4.00000 | 1 | single|TargetItemMetadata|b46b06d9-fc2e-45fa-8843-ecc4209b32c0 | 2015-10-23 13:01:58 | Category | TargetItemMetadata | single | NULL | +----------------------------------------------------------+---------------------------------------------------+---------+-------------------------------------------------------------------+------------------------+---------------------+----------------------------+----------------+-------------+----------------------------------------------------------------+---------------------+----------------------------+--------------------+--------+------------------+
TargetItemMetadata XML
<targetItems> <item> <type>ApparelProduct</type> <exportCode>ApparelProduct</exportCode> <description>Hybris Platform representation of apparel product</description> <updatable>true</updatable> <canonicalItemSource>CanonicalProduct</canonicalItemSource> <status>ACTIVE</status> <attributes> ... </attributes> </item> ... </targetItems>
TargetAttributeDefinition
TargetAttributeDefinitions function similarly to the CanonicalAttributeDefinition but contain additional validation rules as defined in the target system. The transformation expression supports the Spring Expression Language (SpEL) expressions to transform the data for the target system.
TargetAttrDef Table
+----------------------------------------------------------------+--------+--------------------+------------+--------------------------+-------------------+---------------------+-------------+----------------------+-----------------------------------------------------------------------+---------------------+---------+-------------------------------------------------------+---------------------------+--------+------------------+ | targetitemmetadata | active | attributename | collection | transformationexpression | mandatoryinheader | modifiedtime | localizable | exportcodeexpression | id | creationtime | secured | exportcode | typecode | tenant | schemaless_attrs | +----------------------------------------------------------------+--------+--------------------+------------+--------------------------+-------------------+---------------------+-------------+----------------------+-----------------------------------------------------------------------+---------------------+---------+-------------------------------------------------------+---------------------------+--------+------------------+ | single|TargetItemMetadata|b46b06d9-fc2e-45fa-8843-ecc4209b32c0 | 1 | superCategories | 1 | parent | 0 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|04741fd3-dd70-4b77-a8f6-79103b88bbe8 | 2015-10-23 13:01:58 | 0 | supercategories(code,$catalogVersion) | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|990c3ad6-7876-4254-87a0-5f3011dafe25 | 1 | catalogVersion | 0 | "" | 1 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|0bb712c7-7ef7-47d2-a175-35f7cc7083c7 | 2015-10-23 13:01:58 | 0 | $catalogVersion | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|6ad6b4b1-17b9-498f-9600-0d248ce88be6 | 1 | style | 0 | style | 0 | 2015-10-23 13:01:58 | 1 | 0 | single|TargetAttributeDefinition|31df5a18-60f9-42b0-bcd2-29b52e593774 | 2015-10-23 13:01:58 | 0 | style | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|6ad6b4b1-17b9-498f-9600-0d248ce88be6 | 1 | code | 0 | product + '-1' | 1 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|34b5b9fd-74a8-412e-bf91-133ac7b1dbcc | 2015-10-23 13:01:58 | 0 | code[unique=true] | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|b46b06d9-fc2e-45fa-8843-ecc4209b32c0 | 1 | code | 0 | integrationKey | 1 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|45a46811-c5a8-4bf9-896f-82dacaa2b447 | 2015-10-23 13:01:58 | 0 | code[unique=true] | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|7c7c27dd-47a7-4600-a8a8-2477c4dba588 | 1 | superCategories | 1 | category | 0 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|4a7bb7f2-7f34-4307-8410-79e7cd9787af | 2015-10-23 13:01:58 | 0 | supercategories(code,$catalogVersion) | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|7c7c27dd-47a7-4600-a8a8-2477c4dba588 | 1 | unit | 0 | unit | 0 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|533f7f64-6a30-4875-b2ca-096b90fe7adc | 2015-10-23 13:01:58 | 0 | unit(code) | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|990c3ad6-7876-4254-87a0-5f3011dafe25 | 1 | baseProduct | 0 | product + '-1' | 1 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|637fd544-346c-4c4a-8ff7-2b888f3db654 | 2015-10-23 13:01:58 | 0 | $baseProduct | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|7c7c27dd-47a7-4600-a8a8-2477c4dba588 | 1 | numberContentUnits | 0 | numberContentUnits | 0 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|65a8d417-a255-43d1-a8fc-11c5ff074a69 | 2015-10-23 13:01:58 | 0 | numberContentUnits | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|6ad6b4b1-17b9-498f-9600-0d248ce88be6 | 1 | description | 0 | styleDescription | 0 | 2015-10-23 13:01:58 | 1 | 0 | single|TargetAttributeDefinition|80b2c984-8227-4aa9-9608-07d3d0477c5f | 2015-10-23 13:01:58 | 0 | description | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|7c7c27dd-47a7-4600-a8a8-2477c4dba588 | 1 | code | 0 | integrationKey | 1 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|8d32a504-5b3c-4eb3-850e-8854e15bbb20 | 2015-10-23 13:01:58 | 0 | code[unique=true] | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|990c3ad6-7876-4254-87a0-5f3011dafe25 | 1 | variantType | 0 | "" | 0 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|8d9a2554-1e81-416e-90a7-67b1e2409abd | 2015-10-23 13:01:58 | 0 | varianttype(code)[default=ApparelSizeVariantProduct] | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|990c3ad6-7876-4254-87a0-5f3011dafe25 | 1 | code | 0 | SKU | 1 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|9243e5a6-05d8-4ff6-818d-f57e96c68081 | 2015-10-23 13:01:58 | 0 | code[unique=true] | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|6ad6b4b1-17b9-498f-9600-0d248ce88be6 | 1 | catalogVersion | 0 | "" | 1 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|97ab57ea-ac31-4401-a56e-98d1b4353284 | 2015-10-23 13:01:58 | 0 | $catalogVersion | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|6ad6b4b1-17b9-498f-9600-0d248ce88be6 | 1 | variantType | 0 | "" | 0 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|a3fa043f-a2d8-4285-843a-e635b2e54bb3 | 2015-10-23 13:01:58 | 0 | varianttype(code)[default=ApparelSizeVariantProduct] | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|7c7c27dd-47a7-4600-a8a8-2477c4dba588 | 1 | baseDescription | 0 | baseDescription | 0 | 2015-10-23 13:01:58 | 1 | 0 | single|TargetAttributeDefinition|b6bc6ca4-f89c-48f7-a1be-73794981d5c0 | 2015-10-23 13:01:58 | 0 | description | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|990c3ad6-7876-4254-87a0-5f3011dafe25 | 1 | size | 0 | size | 0 | 2015-10-23 13:01:58 | 1 | 0 | single|TargetAttributeDefinition|badc5250-b071-41a9-b7f0-cb1e710a9833 | 2015-10-23 13:01:58 | 0 | size | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|b46b06d9-fc2e-45fa-8843-ecc4209b32c0 | 1 | name | 0 | name | 0 | 2015-10-23 13:01:58 | 1 | 0 | single|TargetAttributeDefinition|c01c8b1b-048c-4299-b29e-e3d6bec4d2ae | 2015-10-23 13:01:58 | 0 | name | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|7c7c27dd-47a7-4600-a8a8-2477c4dba588 | 1 | ean | 0 | ean | 0 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|c359eb07-aac2-47d0-b7ad-8f06079f14e1 | 2015-10-23 13:01:58 | 0 | ean | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|6ad6b4b1-17b9-498f-9600-0d248ce88be6 | 1 | baseProduct | 0 | product | 1 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|cad7f506-edc7-45d6-b92e-d68fe640dd6c | 2015-10-23 13:01:58 | 0 | $baseProduct | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|7c7c27dd-47a7-4600-a8a8-2477c4dba588 | 1 | variantType | 0 | "" | 0 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|d46407f1-f500-4cc9-badc-b6d2a40462a4 | 2015-10-23 13:01:58 | 0 | varianttype(code)[default=ApparelStyleVariantProduct] | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|7c7c27dd-47a7-4600-a8a8-2477c4dba588 | 1 | catalogVersion | 0 | "" | 1 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|da8b8b6a-4770-4465-ad0a-567f477b43b5 | 2015-10-23 13:01:58 | 0 | $catalogVersion | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|b46b06d9-fc2e-45fa-8843-ecc4209b32c0 | 1 | catalogVersion | 0 | "" | 1 | 2015-10-23 13:01:58 | 0 | 0 | single|TargetAttributeDefinition|dfe63102-2c94-4036-8834-a5a0c6cf6f6e | 2015-10-23 13:01:58 | 0 | $catalogVersion | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|7c7c27dd-47a7-4600-a8a8-2477c4dba588 | 1 | baseName | 0 | baseName | 0 | 2015-10-23 13:01:58 | 1 | 0 | single|TargetAttributeDefinition|ed1cddc4-7963-4bbe-baa8-9d9e60d9c358 | 2015-10-23 13:01:58 | 0 | name | TargetAttributeDefinition | single | NULL | | single|TargetItemMetadata|b46b06d9-fc2e-45fa-8843-ecc4209b32c0 | 1 | description | 0 | description | 0 | 2015-10-23 13:01:58 | 1 | 0 | single|TargetAttributeDefinition|ed37ef68-9958-4d55-8bfc-52acd84f6681 | 2015-10-23 13:01:58 | 0 | description | TargetAttributeDefinition | single | NULL | +----------------------------------------------------------------+--------+--------------------+------------+--------------------------+-------------------+---------------------+-------------+----------------------+-----------------------------------------------------------------------+---------------------+---------+-------------------------------------------------------+---------------------------+--------+------------------+
TargetAttributeDefinition XML
<attributes> ... <attribute> <name>code</name> <localizable>false</localizable> <collection>false</collection> <transformationExpression>SKU</transformationExpression> <exportCode>code[unique=true]</exportCode> <mandatoryInHeader>true</mandatoryInHeader> </attribute> <attribute> <name>size</name> <localizable>true</localizable> <collection>false</collection> <transformationExpression>size</transformationExpression> <exportCode>size</exportCode> <mandatoryInHeader>false</mandatoryInHeader> </attribute> <attribute> <name>baseProduct</name> <localizable>false</localizable> <collection>false</collection> <transformationExpression>product + '-1'</transformationExpression> <exportCode>$baseProduct</exportCode> <mandatoryInHeader>true</mandatoryInHeader> </attribute> <attribute> <name>catalogVersion</name> <localizable>false</localizable> <collection>false</collection> <transformationExpression>""</transformationExpression> <exportCode>$catalogVersion</exportCode> <mandatoryInHeader>true</mandatoryInHeader> </attribute> ... </attributes>