8 Replies Latest reply: Oct 18, 2012 2:03 AM by Nitin Khare RSS

    Promotionn configuration

    965889
      Hi. Maybe someone had the same problem:
      In standart pricingModels.xml we have description of some standart promotion(called dcs_promotion). It has field description. I add new field to it in my own pricingModels.xml(called shortDescription). Now I need to make "description" field length = 2500 and "shortDescription" field length = 255. I add custom propertyViewMapping,propertyView and propertyViewAttributeDefinition. In last I describe length. But it works for my custom "shortDescription" fielsd, and doesn't work for standart "description" field.

      Thanks
        • 1. Re: Promotionn configuration
          RMishra
          I think using xml-combine="replace" in your description property should help.
          like <property name="description" ....................................... xml-combine="replace"/>
          By default it is taking OOTB definition.
          -RMishra
          • 2. Re: Promotionn configuration
            967104
            <gsa-template>
            <item-descriptor name="contactInfo">
            <table name="dps_contact_info">
            <property name="firstName">
            <property name="middleName" xml-combine="remove">
            <property name="lastName">
            <property name="position" xml-combine="append">
            </table>
            </item-descriptor>

            <item-descriptor name="contactInfo" xml-combine="replace">
            <table name="dps_contact_info">
            <property name="firstName">
            <property name="middleName">
            <property name="lastName">
            </table>
            </item-descriptor>
            </gsa-template>

            try to understand the above code snippet
            xml-combine="append" : if you want to add your property to OOTB definition file use it

            xml-combine="replace" : we are using replace , alredy property is there in OOTB but you want to overide that property that time we using it

            xml-combine="remove" : if you want to remove OOTB propery that time you need to use, this time we need keep one thing in our mind that is while removing that propery , we need to remove all the other properties belonging to it.


            so according to you0r problem you need to use

            xml-combine="replace" then you will get your property in OOTB by replacing exsting property
            • 3. Re: Promotionn configuration
              Nitin Khare
              I think you would need to change the existing view mapping for the "description" property. Your custom propertyViewAttributeDefinition will be applied to the custom property that you are adding and it would not change or affect the existing view mappings. As on ATG10, the default propertyViewMapping for the "description" field in Promotions would be coming from the propertyView with id AmPvmPrmoDef. You can check and confirm it from the ViewMappingRepository or from the view mapping initial data xml present in DCS-UI (Merchandising) module. This propertyView AmPvPrmoDef has these default attributes defined:

              inputFieldMaxWidth=propertyViewAttributeDefinition:AmPvadDefInputFieldMaxWidth

              inputFieldMaxlength=propertyViewAttributeDefinition:AmPvadDefInputFieldMaxLength

              So you can try by updating the field length values in the above propertyViewAttributeDefinition items which would already be existing in the ViewMappingRepository.

              Also note that since the "description" is specified as string in the repository definition xml so in the sql for corresponding column its size would have default value of 254 characters. So if you are changing "description" to some higher value then your dcs_promotion database table should also be altered to have the new value for the description column in the both versioned (publishing) and non-versioned (switching/production) schema.
              • 4. Re: Promotionn configuration
                965889
                Fs I see in http://docs.oracle.com/cd/E23507_01/Platform.20073/ATGPersProgGuide/html/s0206replacinguserprofilexml01.html I should do the following:
                <item-descriptor name="promotion" >

                     <table name="dcs_promotion" type="primary" id-column-name="promotion_id">
                          <property name="description" xml-combine="remove"/>
                     </table>

                     <table name="my_promotion" type="auxiliary" id-column-name="promotion_id">
                          <property name="shortDescription" data-type="string" column-name="shortDescription" category-resource="categoryBasics" display-name-resource="shortDescription">
                               <attribute name="propertySortPriority" value="20"/>
                          </property>
                          <property name="description" data-type="string" column-name="description" category-resource="categoryBasics" display-name-resource="description" xml-combine="replace">
                <attribute name="propertySortPriority" value="20"/>
                </property>
                </table>
                     

                </item-descriptor>

                but it still doesn't work
                • 5. Re: Promotionn configuration
                  Nitin Khare
                  I must say I have got some confusion over here. From your original post I was made to think that you are trying to change the field lengths in the default "description" property along with your custom property but probably it was not getting reflected in BCC since you mentioned about propertyViewMapping,propertyView and propertyViewAttributeDefinition. So my earlier reply was purely based on that.

                  Can you confirm that what exactly is the issue you are facing - your new property "shortDescription" is not getting reflected along with "description"? Or is it UI level change in BCC for the "description" and "shortDescription" properties? Or you just want to change the default field lengths in the database column for description and shortDescription properties? or is there something else?

                  Regarding your repository XML changes: You seem to be removing description property from the "dcs_promotion" table and move it to "my_promotion" table but there should be no need of adding xml-combine="replace" for "description" property under "my_promotion" table if you are adding it fresh there. Also check if there is no repository related error during the server startup and your startup is clean.

                  Edited by: Nitin Khare on Oct 17, 2012 8:52 AM
                  • 6. Re: Promotionn configuration
                    karthik chopperla
                    You dont have to use xml-combine replace. Just remove that and keep your only added new property.

                    For shortDescription, it works because you added new viewmapping attributes. For description it doesnt work, because you are not using same viewmapping attribute. Check in ACC the view-mapping attribute used by promotion "description" and change its attributes to use the new one you created. Do not try to change the length of existing one , as it will effect all other properties pointing to that viewmapping.

                    -karthik
                    • 7. Re: Promotionn configuration
                      965889
                      I tried to change mapping, but rusult was the sane - 254 characters. This is my xml:

                      <gsa-template>
                           <import-items>

                                <!-- Promotion description -->
                                <add-item item-descriptor="propertyViewAttributeDefinition"
                                     id="AmPvadPromoDescrInputFieldMaxLengthCust">
                                     <set-property name="description"><![CDATA[Max number of characters in the input field for promo description 2500]]></set-property>
                                     <set-property name="defaultValue"><![CDATA[50]]></set-property>
                                </add-item>
                                
                                <add-item item-descriptor="propertyView" id="AmPvPrmoDescr">
                                     <set-property name="description"><![CDATA[AssetManager description propertyView for promotions]]></set-property>
                                     <set-property name="isDefault"><![CDATA[true]]></set-property>
                                     <set-property name="attributes"><![CDATA[inputFieldMaxWidth=AmPvadDefInputFieldMaxWidth,inputFieldMaxlength=AmPvadPromoDescrInputFieldMaxLength]]></set-property>
                                     <set-property name="mode"><![CDATA[AmMmDef]]></set-property>
                                     <set-property name="isComponentPropertyView"><![CDATA[false]]></set-property>
                                     <set-property name="isDefault"><![CDATA[false]]></set-property>
                                     <set-property name="viewComponent"><![CDATA[atg.assetmanager.editor.view.property.PromotionPriorityEditor]]></set-property>
                                     <set-property name="type"><![CDATA[?]]></set-property>
                                     <set-property name="name"><![CDATA[AssetManager description propertyView for promotions]]></set-property>
                                </add-item>

                                <add-item item-descriptor="propertyViewMapping" id="AmPvmPrmoDescr">
                                     <set-property name="description"><![CDATA[AssetManager promotions description view mapping]]></set-property>
                                     <set-property name="propertyView"><![CDATA[AmPvPrmoDescr]]></set-property>
                                </add-item>
                                
                                <!-- Promotion short description -->
                                <add-item item-descriptor="propertyViewAttributeDefinition"
                                     id="AmPvadPromoShortDescrInputFieldMaxLength">
                                     <set-property name="description"><![CDATA[Max number of characters in the input field for promo short description 254]]></set-property>
                                     <set-property name="defaultValue"><![CDATA[50]]></set-property>
                                </add-item>
                                
                                <add-item item-descriptor="propertyViewAttributeDefinition" id="AmPvadDefPromoWidthMaxWidth">
                                <set-property name="defaultValue"><![CDATA[600]]></set-property>
                                <set-property name="description"><![CDATA[Max width of the input field in pixels]]></set-property>
                                </add-item>

                                <add-item item-descriptor="propertyView" id="AmPvPrmoShortDescr">
                                     <set-property name="description"><![CDATA[AssetManager short description propertyView for promotions]]></set-property>
                                     <set-property name="isDefault"><![CDATA[true]]></set-property>
                                     <set-property name="attributes"><![CDATA[inputFieldMaxWidth=AmPvadDefPromoWidthMaxWidth,inputFieldMaxlength=AmPvadPromoShortDescrInputFieldMaxLength]]></set-property>
                                     <set-property name="mode"><![CDATA[AmMmDef]]></set-property>
                                     <set-property name="isComponentPropertyView"><![CDATA[false]]></set-property>
                                     <set-property name="isDefault"><![CDATA[false]]></set-property>
                                     <set-property name="viewComponent"><![CDATA[atg.assetmanager.editor.view.property.PromotionPriorityEditor]]></set-property>
                                     <set-property name="type"><![CDATA[?]]></set-property>
                                     <set-property name="name"><![CDATA[AssetManager short description propertyView for promotions]]></set-property>
                                </add-item>

                                <add-item item-descriptor="propertyViewMapping" id="AmPvmPrmoShortDescr">
                                     <set-property name="description"><![CDATA[AssetManager short promotions description view mapping]]></set-property>
                                     <set-property name="propertyView"><![CDATA[AmPvPrmoShortDescr]]></set-property>
                                </add-item>
                                
                           </import-items>

                           <update-item item-descriptor="itemViewMapping" id="AmIvmPrmoGen">
                                <set-property name="propertyMappings" add="true"><![CDATA[description=AmPvmPrmoDescr]]></set-property>
                                <set-property name="propertyMappings" add="true"><![CDATA[shortDescription=AmPvmPrmoShortDescr]]></set-property>
                           </update-item>

                      </gsa-template>
                      • 8. Re: Promotionn configuration
                        Nitin Khare
                        Can you try by changing "isDefault" to true in the two propertyView definitions: "AmPvPrmoDescr" and "AmPvPrmoShortDescr"? Also if you are on ATG10+, apart from view mapping you might have to do some additional work to customize the Flex based UI.

                        I would also like to mention something I faced once while working with view mappings which was caching in the view mapping repository. In your dev environment, you may update the view mappings either directly from ACC or through dyn/admin using XML operations tags. So do ensure that after updating the view mappings any existing cache for ViewMappingRepository is cleared either by restarting the server or by invoking invalidateCache method on the /atg/web/viewmapping/ViewMappingRepository component from dyn/admin. This is just to make sure that you view mapping changes are picked up.