Promotions templates are XML files that are named with a .pmdt extension. You must store templates in a root location specified in the configurationRootPath property of the /atg/commerce/promotion/template/registry/PromotionTemplateRegistry component. The default setting is:

configurationRootPath=/atg/registry/data/promotiontemplates

You can set this path to any valid value and construct any additional folder structure needed below it as you add templates. Templates are referenced by both name and location, therefore the names do not have to be unique, but it is good practice to give them unique names.

Template files are created manually. You can shorten the process by creating a PMDL rule in the Advanced Condition and Offer Editor, then retrieving the generated PMDL from the DCS_DISCOUNT_PROMO table or from the asset detail page of the project. That PMDL can be used for the template’s pmdlrule repository property, replacing placeholder names with the necessary values. You must still ensure that your template XML file includes the requisite user interface elements.

Note that if you do use this method to create a PMDL rule, you should be careful to delete the promotion you created, to avoiding confusing your users. You cannot delete promotions through Oracle ATG Web Commerce Merchandising the way you can some other assets, but you can create a temporary project in Merchandising, then delete the project without deploying.

What Promotion Templates Do

Templates allow your users to set promotion repository item properties through a simple interface. The pmdlRule property one of the most important properties, but other properties such as usage dates can also be set this way (see Promotion Repository Item Properties for a full property list).

  1. The ui-description section of the template lays out the visual elements of the template, which determine how it appears on the user’s screen. Much of the ui-description relies on standard form elements such as textInput.

    The user interface also includes product set criteria (PSCs), which are sets of combination boxes that allow users to specify products to include in or exclude from a promotion. Modeling for these expressions is handled by a custom PSCExpressionModel component, which requires no configuration.

    See Creating the PMDT File for information on ui-description elements.

  2. The end-user provides their input to the template in Oracle ATG Web Commerce Merchandising. For example, the user might select products to include in the promotion, set begin and end dates for the promotion, and specify how many times the promotion can be given to a customer.

  3. The template associates the user input with the id attribute of the element through which it was selected. For example, you could have a textInput that allows the user to specify how many items can have the promotion applied:

    <textInput id="numberOfItemsToDiscount_textInput">

    In the textInput example, the information referenced by the id is most likely a simple integer; in the case of PSCs, the id references a complex string of PMDL representing the user’s selections, their AND or OR conditions, etc.

  4. Translator elements in the template perform any transformations necessary to the user input; the translated input is assigned to a placeholder. For example, you may need to change date formatting or capitalization. For PSCs, the translators add required tags to create well-formed PMDL, which can then be processed by the back-end systems. See Translating User Input Values in Templates.

  5. The item-properties section of the template provides the blueprint for the promotion, and defines what property information the promotion stores.


Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices