Reference Productlist By Rule Configuration XML
Overview
This page lists the elements and attributes of the Product List by Rule XML configuration and what each one does. For the mental model, the build workflow, the modes, and the document parameters, see Concepts.
Take a look at the attached example that shows a few common configurations. Note that the attached Example is just a reference and can't be used without project-specific customization.
AccPackProductListRuleSample.xml
XML Configuration
(*): required
productListRuleSets(*)
The root element of the XML configuration. It can contain one or more productListRuleSet elements.
productListRuleSet(*)
The child element of productListRuleSets.
configId(*)
Unique id of each rule set, it should match _renderingruleset value of document parameter.
mode(*)
Three modes are supported. Planning records run in planning mode as they are, or convert to buckets in bucket mode. Bucket records run in bucket mode. Bucket records in planning mode return an error.
planning: works whether the products are buckets or planning records.bucket: works only when the products are buckets.dummy: renders templates from dummy buckets when no products are planned. Useful when building a table of contents or index template.
log
1: write log to file.0: do not write log.
logPath
File path to write log, support some predefined Comet variables.
Example: $DESKTOP/product-list-rule.log
projectIdentifier
Optional. Associates the rule set with a project.
The helper that lists rule sets by project returns this rule set when its projectIdentifier matches the current project, and returns all rule sets when it is empty.
Example:
<productListRuleSet configId="AccPackGeneric" mode="planning" log="1" logPath="$DESKTOP/product-list-rule.log">
productListRules(*)
Child element of productListRuleSet.
exclusive
true: if a product matches several rules, keep only the first matching rule (the lowest sort of<productListRule>).false: do not remove duplicate(default).
defaultPageTemplate(*)
Default page template(id or name) for building product.
Example:
<productListRules exclusive="true" defaultPageTemplate="A4PageTemplate">
pageTemplate
Child element of productListRules.
documentParameter
Child element of pageTemplate.
It is used to get page template from document parameter by identifier for building.
This page template will override defaultPageTemplate of productListRules.
identifier(*)
Document parameter identifier.
Document parameter could be text field or dropdown list. If it's a text field supports first value(value1).
Example
<pageTemplate>
<documentParameter identifier="_priint_pageTemplate"/>
</pageTemplate>
productListRule(*)
Child element of productListRules. Each rule can filter products by conditions and add them to the result list with actions.
sort(*)
An integer value. Rules run in ascending order of sort, so the lowest number is processed first. When exclusive is true, the first matching rule (the lowest sort) wins.
pageTemplate
Page template (id or name) for building product of current rule, it will make building break to new page for each rule.
masterPage
Master page name for this rule. This means all products of this rule will be built with a specific master page.
Example
<productListRule sort="1" pageTemplate="HalfPageTemplate" masterPage="A-MasterPage">
conditionList
Filter root bucket/root planning by condition list. If conditionList is empty do not filter.
operator
or: return a result if product match at least one condition(default).and: return a result if product match all condition.
Example
<conditionList operator="or">
condition
Child element of conditionList.
Each condition can filter by entity, media asset, root planning record, or planning metadata.
Conditions run in ascending order of sort, so the lowest number is processed first.
sort(*)
An integer value. Conditions are evaluated in ascending order of sort.
Condition types
A condition must contain exactly one of the following filter types:
Condition by entity
Filter by product entity and/or it's label. The label supports regular expression.
Example
<condition sort="1">
<entity>
<entityIdentifier>product</entityIdentifier>
<label>^(?!Logistic).*$</label>
</entity>
</condition>
Condition by media asset
Filter by media asset entity and/or it's label. The label supports regular expression.
Example
<condition sort="2">
<mediaAsset>
<entityIdentifier>imageHAUPTBILD</entityIdentifier>
<label>HAUPTBILD B(.*)</label>
</mediaAsset>
</condition>
Condition by root planning template
Filter by root planning entity and/or root planning assigned template.
rootTemplate accepts a template name, or PLANNED_TEMPLATE to match any record that has an assigned template.
Example
<condition sort="3">
<planning>
<entityIdentifier>Facet_VR_Group</entityIdentifier>
<rootTemplate>Tafel 2x1 8er</rootTemplate>
</planning>
</condition>
Condition by root planning metadata
Filter by metadata of the root planning record. Applies to planning records only.
Example
<condition sort="4">
<planningMetadata>
<metaDataEntityIdentifier>planning_layout</metaDataEntityIdentifier>
<value>1 Spaltig</value>
</planningMetadata>
</condition>
actionList
Contains list action elements. Each action can filter before it adds products to the result list.
Example
<actionList>
<action />
<action />
action
Child element of actionList.
An action adds products to the result list.
Its method attribute must be one of the supported values addDummyBucket, addCurrentBucket, or addChildBucket. Each action can filter before it adds.
We have some simple case as below examples:
Add a dummy bucket without filtering
Example
<action method="addDummyBucket">
<pageItemIds>
<when assignTemplate="IndexAZ" />
</pageItemIds>
</action>
Add root bucket if bucket match entity article
Example
<action method="addCurrentBucket">
<entity>
<entityIdentifier>article</entityIdentifier>
</entity>
<pageItemIds>
<when assignTemplate="Main Article Template"/>
</pageItemIds>
</action>
Add child bucket
Adds a level-1 child bucket under the root bucket.
The action is executed only for entities matching the configured entityIdentifier and entityLevel.
Set entityLevel to ANY to disable level validation.
Example
<action method="addChildBucket">
<entity>
<entityIdentifier>article</entityIdentifier>
<entityLevel>1</entityLevel>
</entity>
<pageItemIds>
<when assignTemplate="Article Table"/>
</pageItemIds>
</action>
pageItemIds
Child element of action. It contains a list of <when> elements that define the conditions for assigning templates to products.
Inside a when condition, entity can list several entityIdentifier values, matched with OR.
A page break is inserted when the pageBreak value is true. The type attribute sets the direction: left, any, or right.
Imagine we want to filter some product then depends on each media asset/key value of product we want to assign specific template.
In case you need to define a list <when> which child elements of pageItemIds for each rule you want.
These are some examples for <pageItemIds>
Assign fixed template, override assigned template of bucket/planning record
Example
<pageItemIds>
<when assignTemplate="Article Table"/>
</pageItemIds>
Assign template was planned by planning/bucket record
Example
<pageItemIds>
<when assignTemplate="PLANNED_TEMPLATE"/>
</pageItemIds>
Assign template and break page
Page break type value support: any, left, right
Example
<pageItemIds>
<when assignTemplate="Article Table">
<pageBreak type="any" value="true" />
</when>
</pageItemIds>
Assign template if match key value and key value metadata
Assigns a template when the bucket contains matching key/value data.
type(required): Must beKEYVALUE.level(optional): Specifies which bucket level is evaluated. Level of current bucket is processed by current action is 0.ifEmpty(optional):true: The condition is considered a match if the bucket contains no key value data.false: The condition is considered not matched if the bucket contains no key value data.
A match is successful when a key value with the specified <entity> and <metaData> are matched.
Example
<pageItemIds>
<when assignTemplate="Article Spec Template">
<when type="KEYVALUE" level="0" ifEmpty="true">
<entity>
<entityIdentifier>product_attribute</entityIdentifier>
<key>code</key>
<value>123456</value>
</entity>
<metaData>
<entityIdentifier>display</entityIdentifier>
<key>display</key>
<value>yes</value>
</metaData>
</when>
</when>
</pageItemIds>
Assign template if match media asset and media asset metadata
Assigns a template when the bucket contains a matching media asset.
type(required): Must beMEDIA_ASSET.level(optional): Specifies which bucket level is evaluated. Level of current bucket is processed by current action is 0.ifEmpty(optional):true: The condition is considered a match if the bucket contains no media asset data.false: The condition is considered not matched if the bucket contains no media asset data.
A match is successful when a media asset with the specified <entity> exists and <metaData> are matched.
Example
<pageItemIds>
<when assignTemplate="Article Image Template">
<when type="MEDIA_ASSET" level="0" ifEmpty="true">
<entity>
<entityIdentifier>imageHAUPTBILD</entityIdentifier>
</entity>
<metaData>
<entityIdentifier>imageSize</entityIdentifier>
<key>BKC_DVS_BITMAP_ORIENTATION_BBM</key>
<value>L</value>
</metaData>
</when>
</when>
</pageItemIds>