Feature Pack 5

Extending the resource bundle and properties files

Feature Pack 5

In this lesson, you are creating an extended properties file that contains the text for your new folders and general tabs. A properties file is a resource bundle that contains translatable text that displays in the user interface.

Feature Pack 6 or laterAttention: This tutorial is based on the folder support that is included in Feature Pack 5 and is not recommended if you are on a newer feature pack level. Beginning with Feature Pack 6, support is provided by default for grouping e-Marketing Spots, activities, customer segments, marketing content, promotions, and attribute dictionary attributes. This support includes the capability of creating, changing, and deleting folders within the Management Center Catalogs, Marketing, and Promotions tools. You are not able to group folders created by following this tutorial with folders that are created by using Management Center. If you create Management Center folders by following the steps included in this tutorial, delete those folders before you create folders by using Management Center. For more information about folders, see Folders.

Feature Pack 7 or laterSupport is provided by default for grouping content pages and layouts in the Commerce Composer tool. This support includes creating, changing, and deleting folders with the Commerce Composer tool.

About this task

To ensure that your folders properties and list views in Management Center display folder-related text, you must add text for folders to a properties file. Properties views are used to contain text that displays on the Management Center user interface, such as list and properties views for the main work area. Rather than hardcode user interface text, include all text in resource properties files, and associate the files with resource keys. This way, you maintain the user interface code in one area, such as OpenLaszlo files or definition files. You maintain the text for your folder-related user interface elements in a separate properties file.


  1. Create the com.mycompany.commerce.marketing.client.lobtools.properties package:
    1. In the Enterprise Explorer view, navigate to LOBTools > Java Resources: src.
    2. Right-click Java Resources:src, click New > Package.
    3. In the Name field, enter com.mycompany.commerce.marketing.client.lobtools.properties.
    4. Click Finish. The new package com.mycompany.commerce.marketing.client.lobtools.properties is created.
  2. Create the EMarketingSpotFolderLOB.properties properties file:
    1. Right-click the com.mycompany.commerce.marketing.client.lobtools.properties package. Click New > Other > General > File and click Next.
    2. For the File name, enter EMarketingSpotFolderLOB.properties, click Finish.
  3. Create the EMarketingSpotFolderLOB_en_US.properties properties file:
    1. Right-click the com.mycompany.commerce.marketing.client.lobtools.properties package. Click New > Other > General > File and click Next.
    2. For the File name, enter EMarketingSpotFolderLOB_en_US.properties, click Finish.
  4. Add the properties definitions to your created properties files.
    1. Open the EMarketingSpotFolderLOB.properties and EMarketingSpotFolderLOB_en_US.properties files for editing, and add the following code into both files:
      EmarketingSpotFolderObjectName=E-Marketing Spot Folder
      EmarketingSpotFolder_newEMarketingSpotFolderDisplayName=New E-Marketing Spot Folder
      contextMenuNewEMarketingSpotFolder=New E-Marketing Spot Folder
      # Marketing Folder Panel
      EMarketingSpotFolder_newEMarketingSpotFolderProperties=E-Marketing Spot Folder Properties
      EMarketingSpotFolder_parentFolder=Parent Folder
      # Marketing Folder List Panel
      EMarketingSpotFolderList_uniqueID=Unique ID
      # Marketing Folder Titles
      allEMarketingSpotFolders_displayText=E-Marketing Spot Folders
      EMarketingSpotFolderListMenuTitle=E-Marketing Spot Folders List
      EMarketingSpotFolderListTitle=E-Marketing Spot Folders List
      EMarketingSpotFolderItemListMenuTitle=E-Marketing Spot List
      EMarketingSpotFolderItemListTitle=E-Marketing Spot List
    2. Save your changes.
  5. Register the new property file in the resource bundle:
    1. In the Enterprise Explorer view, navigate to LOBTools > WebContent > WEB-INF > src > lzx.
    2. Right-click lzx; select New > Folder.
    3. In the Folder name field, enter mycompany. Click Finish.
    4. Right-click mycompany; select New > Folder.
    5. In the Folder name field, enter marketing. Click Finish.
    6. Right-click marketing; select New > File. Click Next.
    7. In the File name field, enter extMarketingManagementResourceBundle.lzx.
    8. Click Finish. The extMarketingManagementResourceBundle.lzx file opens.
    9. Add the following code to the file:
            <class name="extMarketingResourceBundle" extends="wcfResourceBundle" baseName="com.mycompany.commerce.marketing.client.lobtools.properties.EMarketingSpotFolderLOB">
                  <wcfResourceBundleKey name="EmarketingSpotFolderObjectName"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolderType"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolderStore"/>
                  <wcfResourceBundleKey name="EmarketingSpotFolder_newEMarketingSpotFolderDisplayName"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolder_newEMarketingSpotFolderProperties"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolder_name"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolder_description"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolder_parentFolder"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolderList_uniqueID"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolderList_identifier"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolderList_description"/>
                  <wcfResourceBundleKey name="contextMenuNewEMarketingSpotFolder"/>
                  <wcfResourceBundleKey name="allEMarketingSpotFolders_headerText"/>
                  <wcfResourceBundleKey name="allEMarketingSpotFolders_displayText"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolderListMenuTitle"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolderListTitle"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolderItemListMenuTitle"/>
                  <wcfResourceBundleKey name="EMarketingSpotFolderItemListTitle"/>
            <extMarketingResourceBundle id="extMarketingResources"/>
  6. Include the extMarketingManagementResourceBundle.lzx file in the marketing extensions library to make the file available to use:
    1. In the Enterprise Explorer view, navigate to LOBTools\WebContent\WEB-INF\src\lzx\commerce\marketing.
    2. Open the file MarketingExtensionsLibrary.lzx.
    3. Update the file to the following to point to the customized resource bundle file:
      <!-- File to add customer libraries -->
      <include href="../../mycompany/marketing/extMarketingManagementResourceBundle.lzx"/>
    4. Save your changes.