Feature Pack 2

Troubleshooting: Custom methods and handlers not supported while migrating Management Center

Custom methods and handlers in OpenLaszlo (.lzx) files cannot be migrated when migrating the Management Center from WebSphere Commerce Version 7 or from WebSphere Commerce Version 7 Feature Pack 1 to a higher feature pack version.

Problem

You can see the following information in the enable Feature Pack 2 Management Center log:

runPortUtility:
........
WARNING: method init cannot be promoted in file C:\IBM\WCDE_P~1\components\management-center\backup\LOBToolsCustom\WebContent\WEB-INF\src\lzx\commerce\catalog\propertiesViews\CatalogPropertyPane.lzx
.........
Custom methods and handlers in OpenLaszlo files are not supported when migrating Management Center using the port utility.

Solution

The original IBM code does not use any of the following tags in classes within OpenLaszlo files since they are difficult to migrate:
  • method
  • handler
  • setter
  • state
  • attribute
If you previously customized OpenLaszlo files on the WebSphere Commerce Version 7 or WebSphere Commerce Version 7 Feature Pack 1 environment by adding method or handler tags to classes, you must recover your customizations that were not migrated manually.

Example

The following code snippet shows a class within the LOBTools\WebContent\WEB-INF\src\lzx\commerce\catalog\propertiesViews\CatalogPropertyPane.lzx file that is customized by adding a new init method:

<class extends="wcfPropertyGroup" groupTitle="${catalogResources.generalProductInformationSection.string}" 
        name="catManageGeneralProductInformation" open="true">
        
<method name="init">
          <![CDATA[
            super.init();            
             this.content.yspacing = 200;
          ]]&gt;
        </method>

        <!-- Property: Code. An input box for the code property. -->
        <wcfPropertyInputText
            extendedHelpText="${catalogResources.extendedHelpText_Code.string}"
            promptText="${catalogResources.codePrompt.string}"
            propertyName="partnumber" required="true"/>
        <!-- Property: Name. An input box for the name property. -->
        ...................
        </class>
After you install WebSphere Commerce Version 7 Feature Pack 2 and enable the Management Center feature, this OpenLaszlo (.lzx) file is converted to a definition (.def) file: LOBTools\WebContent\config\commerce\catalog\propertiesViews\CatalogPropertyPane.def . The custom init method is lost during this conversion:

<PropertyGroup definitionName="catManageGeneralProductInformation" groupTitle="${catalogResources.generalProductInformationSection}" open="true">
        <!-- Property: Code. An input box for the code property. -->
        <PropertyInputText extendedHelpText="${catalogResources.extendedHelpText_Code}" promptText="${catalogResources.codePrompt}" propertyName="partnumber" required="true"/>
        <!-- Property: Name. An input box for the name property. -->
         ...................
    </PropertyGroup>
To recover your customization:
  1. Create the LOBTools\WebContent\WEB-INF\src\lzx\mycompany\catalog\propertiesViews\extCatalogPropertyPane.lzx file.
  2. Add the following code to the extCatalogPropertyPane.lzx file:
    
    <library>
      
        <class extends="wcfPropertyGroup"
            groupTitle="${catalogResources.generalProductInformationSection.string}"
            name="extPropertyGroup" open="true">
              <method name="init">
              <![CDATA[
                super.init();
                 this.content.yspacing = 200;
              ]]&gt;
            </method>
        </class>
       </library>
    
  3. Register the extCatalogPropertyPane.lzx file by adding the highlighted line to the LOBTools\WebContent\WEB-INF\src\lzx\commerce\catalog\CatalogExtensionsLibrary.lzx file:
    
    <library>
           ...........
           
    <include href="../../mycompany/catalog/propertiesViews/extCatalogPropertyPane.lzx"/>
    
          </library>
    
  4. In the LOBTools\WebContent\config\commerce\catalog\propertiesViews\CatalogPropertyPane.def file, change:
    
    <PropertyGroup baseDefinitionName="catManageGeneralProductInformation"/>
    
    to:
    
    <PropertyGroup baseDefinitionName="catManageGeneralProductInformation" package="ext"/>
    
  5. Save your changes.
  6. Right-click LOBTools Project ; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the workspace_dir\LOBTools\WebContent directory. This is the default environment setting.