Defining a library class for all OpenLaszlo classes

After you define your Management Center library classes, define a single library class that includes all of the .LZX files that contain OpenLaszlo classes. The Management Center reads this file to understand and recognize all the associated classes for the new tool.

About this task

Complete the following steps to define a library class.


  1. In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > mycompany > recipe
  2. Create an OpenLaszlo class file named RecipeLibrary.lzx, by selecting New > Other... > General > File.
  3. Within the library class file, include all the .LZX files that you created for the Recipes tool that contains OpenLaszlo classes. Copy the following sample code into your file, and save your changes:
    WebSphere Commerce Version Pack 1
      <include href="./objectDefinitions/RecipeTopObjectDefinition.lzx"/>
      <include href="./objectDefinitions/RecipePrimaryObjectDefinition.lzx"/>
      <include href="./objectDefinitions/RecipeCommonObjectDefinition.lzx"/>
      <include href="./propertiesViews/RecipePropertiesView.lzx"/>
      <include href="./propertiesViews/RecipeCollectionPropertiesView.lzx"/>
      <include href="./propertiesViews/RecipeIngredientsPropertiesView.lzx"/>
      <include href="./propertiesViews/RecipeInstructionsPropertiesView.lzx"/>
      <include href="./listViewDefinitions/RecipeGrid.lzx"/>
      <include href="./listViewDefinitions/RecipeCollectionGrid.lzx"/>
      <include href="./listViewDefinitions/RecipeAssociationGrid.lzx"/>
      <include href="./listViewDefinitions/RecipeInstructionGrid.lzx"/>
      <include href="./listViewDefinitions/RecipeIngredientsGrid.lzx"/>
      <include href="./searchDefinitions/FindRecipesSearchDefinition.lzx"/>
      <include href="RecipeManagementToolDefinition.lzx"/>
      <include href="RecipeManagementResourceBundle.lzx"/>
      <include href="RecipeManagementResources.lzx"/>
    Feature Pack 3Feature Pack 2
        <include href="RecipeManagementResourceBundle.lzx"/>
        <include href="RecipeManagementResources.lzx"/>    
  4. Register your new library class file so that the Management Center can find the new Recipes tool classes:
    1. In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > commerce > shell
    2. Double-click the ShellExtensionsLibarary.lzx to edit the file.
    3. Include your new library class file in the file. Copy the <include> element from the following code sample into your file:
              <include href="../../mycompany/recipe/RecipeLibrary.lzx"/>
    4. Save the file.
  5. Right-click the LOBTools project and select Build OpenLaszlo Project.
    WebSphere Commerce Version Pack 1Note: There is a compile error in RecipeLibrary.lzx, because the RecipeManagementToolDefinition.lzx file is not found. This file is added in the next lesson.