Xml2Metadata parser
If using the Xml2Metadata parser metadata must be preconfigured.
Here is an example of a Xml2Metadata configuration file:
< Settings > < Metafield Id = "5EB3EEFC-A043-410F-89B0-29ED3EF37078" XPath = "/Media/Title" /> < Metafield Id = "50182" XPath = "/Media/Description" /> < Metafield Id = "50188" XPath = "/Media/MMMenu" /> </ Settings > |
The Settings element is required. It holds the Metafield elements, which couples the metafields in your metadata files to the metafields in the DC.
Metafield attribute | Description |
---|---|
Id | The metafield ID or GUID as seen in the DC under theID or GUIDcolumn respectively. One special tag can also be used: ItemID. When this is set an ItemId can be specified to skip the match search and set metadata on this ItemId directly. |
XPath | The XPath selector for this metafield in the metadata XML files. |
ComboSeparator | Override the ComboSeparator from the import configuration for a specific metafield. For future use (xml metadata does not support multivalues in same string input). |
ComboMatchStyle | Override the ComboMatchStyle from the import configuration for a specific metafield. Possible values: TextValue (default) or OptionValue. |
Excel parser
With Excel metadata the configuration is part of the sheet. The MetafieldIdRow config specifies which row to find it. All other rows until DataStartRow are ignored. Make sure to be aware of ComboMatchStyle - it is set in the import configuration. If it is not explicitly set it defaults to the textvalue. ComboSeparator defaults to ; (semicolon). Even though the configs are called combo... they are in effect also for tree type metafields.
The simplest configuration is just metafield ID set. Let's say we need to update a MultiComboValue with ID 50521. That might look like this:
Overriding ComboSeparator and/or ComboMatchStyle
Lets say an import configuration holds this default configuration (equivalent to not having these configs specifed at all):
<ComboSeparator>;</ComboSeparator>
<ComboMatchStyle>TextValue</ComboMatchStyle>
Now the metafield row accepts a simple notation like this: Metafield-ID ComboSeparator ComboMatchStyle.
In this example we tell the importer this is Metafield 50521, the combo separator is , (comma) and we want to match against the optionvalue.
It's important that there is a space in between the values. It's not necessary to specify ComboMatchStyle if the default is preferred but it is necessary to set ComboSeparator if in need of setting ComboMatchStyle. So:
- "50521 ," is equivalent to "50521 , TextValue" when TextValue is the default ComboMatchStyle.
- "50521 OptionValue" or "50521 TextValue" are not valid.