Tutorials > Management Center > Add a Recipes tool to the Management Center

< Previous | Next >


Define a library class for all OpenLaszlo classes

As part of creating a custom tool for the Management Center, after you have defined all of the Management Center library classes, define a single library class that includes all 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.

Complete the following steps to define a library class.


Procedure

  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 contain OpenLaszlo classes. Copy the following sample code into the file, and save the changes:

    <library>
    
        <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"/>    
    
    </library>
    

    <library>
       
    <include href="RecipeManagementResourceBundle.lzx"/>
       
    <include href="RecipeManagementResources.lzx"/>    
    </library>
    

  4. Register the 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 the new library class file in the file. Copy the <include> element from the following code sample into the file:

      <library>
             
      <include href="../../mycompany/recipe/RecipeLibrary.lzx"/>
      </library>
      

    4. Save the file.

  5. Right-click the LOBTools project and select Build OpenLaszlo Project.

    Note: There is a compile error in RecipeLibrary.lzx, because the RecipeManagementToolDefinition.lzx file is not found. This file is added in the next lesson.

< Previous | Next >


+

Search Tips   |   Advanced Search