Introduced in Feature Pack 2

Troubleshooting: Custom unique ID not defined while running OL unique ID validation

When running the OL Unique ID Validation tool, a warning message indicates that the custom file might contain custom objects where unique IDs are not defined.

Problem

A unique ID is used to uniquely identify an element under its parent. The values or the combinations of values must be unique under its parent instance. A null value or missing value is allowed. Unique identifiers are defined in the following ways:
  • The instance name itself is a unique identifier. For example mktExperimentValidator is a unique identifer.
  • The instance name and the value of an attribute form the unique identifier. In most cases, the attribute used is package. For example, the unique identifier of the element <ExperimentValidator validatorId='xyz' package='mkt'/> should be mktExperimentValidator.
  • The instance name and the combinations of values of attributes form the unique identifier.

When running the OL Unique ID Validation for a custom OpenLaszlo file including .lzx or .def file, there are warnings indicating that the added custom file might contain custom objects where unique ids are not defined.

Example 1:

You add a new lzx file, for examplenewfilename.lzx, in the /LOBTools/WebContent/WEB-INF/src/lzx directory. The file contains the following:

<wcfBaseComboBox id="optionSelector" name="optionSelector" width="235">		
	<catDSITextlistitem text="Gift box" value="11200" selected="true"/>
	<catDSITextlistitem text="Gift wrap" value="2" />
	<catDSITextlistitem text="Free message" value="0" />				
</wcfBaseComboBox>
When you save the file and run the OL Unique ID Validation tool, you receive the following warning message:
The Unique ID for catDSITextlistitem is not defined.

Feature Pack 3Feature Pack 2Example 2:

You make a customization in a certain definition file under /LOBTools/WebContent/config, such as:

<PrimaryObjectDefinition baseDefinitionName="ctBaseLayoutPrimaryObjectDefinition"creatable="true" definitionName="Layout" objectType="Layout">
	<CreateNewObjectTypeFromObjectClientAction displayName="${ctLayoutResources.duplicateLayout}" package="mkt" targetObjectType="Layout"/>
	<CreateNewObjectTypeFromObjectClientAction displayName="${ctLayoutResources.createTemplateFromLayout}" package="mkt" targetObjectType ="LayoutTemplate"/>
</PrimaryObjectDefinition>
After you save the file and run the OL Unique ID Validation tool, you receive a warning message:
  • Feature Pack 2The warning is that the Unique ID for CreateNewObjectTypeFromObjectClientAction is not defined.
  • Feature Pack 3The warning is that the Unique ID for mktCreateNewObjectTypeFromObjectClientAction is not defined. Go to the file /LOBTools/WebContent/properties/custom_def_unique_IDs.properties to define the Unique ID for mktCreateNewObjectTypeFromObjectClientAction.

Solution

Example 1:

If the added file has a suffix with .lzx, you should add unique ID definitions in the file custom_unique_IDs.properties under \LOBTools\WebContent\properties for all the custom objects. If the added file has a suffix with .def, you should add unique ID definitions in the file custom_def_unique_IDs.properties under \LOBTools\WebContent\properties for all the custom objects.

To solve the problem of the unique ID not being defined in OpenLaszlo .lzx files, perform the following steps:
  1. Append the following definition to the file custom_unique_IDs.properties under \LOBTools\WebContent\properties:
    catDSITextlistitem=text 
  2. Run the OL Unique ID Validation tool again.

Feature Pack 3Feature Pack 2Example 2:

To solve the problem of the unique ID not being defined in the definition files, perform the following steps:

  1. Append the following definition to the file custom_def_unique_IDs.properties under \LOBTools\WebContent\properties:
    mktCreateNewObjectTypeFromObjectClientAction=targetObjectType
  2. Run the OL Unique ID Validation tool again.