Creating a resource bundle for strings labels and the field title

In this lesson, you will create a property file to be display in the Management Center for the new profile field. You will use the StoreExtensionLibrary.lzx and StoreResourceBundleExt.lzx files to import the new resource bundle package so it can be reference in the store property view definition file.

Procedure

  1. In the Enterprise Explorer view, navigate to LOBTools > src in your workspace.
  2. Right-click Java Resources: src; then create a package called com.mycompany.commerce.store.client.lobtools.properties.
  3. Right-click the com.mycompany.commerce.store.client.lobtools.properties package; then click New > Other > General > File.
  4. In the File name field, enter StoreLOB_en_US.properties. The file name is case-sensitive.
  5. Open the StoreLOB_en_US.properties file for editing.
  6. Add the status information to display in the store profile page for the new field.
    storeManager = Store Manager
  7. Save your changes and close the file.
  8. Navigate to LOBTools > WebContent > WEB-INF > src > lzx > commerce > store.
  9. Right-click the store directory; then click New > Other > General > File to create a new OpenLaszlo file.
  10. In the File name field, enter StoreResourceBundleExt.lzx
  11. Open the StoreResourceBundleExt.lzx file for editing.
  12. Add the following code snippet:
    <library>
      <class name="stoStoreResourceBundleExt" extends="wcfResourceBundle" baseName="com.mycompany.commerce.store.client.lobtools.properties.StoreLOB">
        <!-- Properties -->
        <wcfResourceBundleKey name="storeManager"/>
      </class>
      <stoStoreResourceBundleExt id="stoStoreResourcesExt"/>
    </library>
  13. Save your changes and close the file.
  14. In the store directory, open StoreExtensionsLibrary.lzx for editing.
  15. Add the following include statement to the body of the <library> tag.
    <include href="StoreResourceBundleExt.lzx"/>
  16. Save your changes and close the file.
  17. Right-click LOBTools; select Build OpenLaszlo Project.

Results