Removing a validation rule

You can remove a validation rule from the Management Center user interface. For example, you can change a required field into an optional field.

Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Complete one of the following steps:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > commerce > Management_Center_component > objectDefinitions, where Management_Center_component is the name of the tool you want to customize.
    • Introduced in Feature Pack 2In the Enterprise Explorer view, expand LOBTools > WebContent > config > commerce > Management_Center_component > objectDefinitions, where Management_Center_component is the name of the tool you want to customize.
  3. Locate the file that contains the validation rule that you want to remove. Open the file and locate:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1the object definition class that contains the validation rule
    • Introduced in Feature Pack 2the object definition that contains the validation rule
  4. Delete the validation rule from the object definition. There are three ways that validation rules can be specified. Each is removed in a different way.
    1. A validation rule can be specified with one of these property definition attributes: maximumSize, maxValue, minValue, required or type. To remove this type of validation rule, delete the attribute from the property definition declaration.
    2. A validation rule can be specified by declaring:
      To remove this type of validation rule, delete the validator declaration. For example:
      Option Description
      Delete <extNoSpaceValidator/> from the property definition
      <wcfPropertyDefinition 
       displayName="${catalogResources.categoryCode_DisplayName.string}" 
       propertyName="identifier" type="string required="true" maximumSize="254">
       <extNoSpacesValidator/>
      </wcfPropertyDefinition>
      Delete <NoSpacesValidator package="ext"/> from the property definition.
      <PropertyDefinition
         displayName="${catalogResources.categoryCode_DisplayName}"
         propertyName="identifier" type="string" required="true" maximumSize="254">
         <NoSpacesValidator package="ext"/>
      </PropertyDefinition> 
    3. A validation rule can be specified by declaring:
      • WebSphere Commerce Version 7.0.0.0Feature Pack 1an instance of a class that extends wcfValidator as a child element of an object definition (lzx/commerce/foundation/restricted/ObjectDefinition.lzx/wcfObjectDefinition)
      • Introduced in Feature Pack 2a definition element that extends wcfValidator as a child element of an object definition (lzx/commerce/foundation/restricted/ObjectDefinition.lzx/wcfObjectDefinition)
      To remove this type of validation rule, delete the validator declaration. For example:
      Option Description
      Delete <catOfferPriceMinimumQuantityUniquenessValidator/> from the property definition
      <class name="catBaseCatalogGroupSKUPrimaryObjectDefinition" 
        extends="wcfPrimaryObjectDefinition"
        baseType="catBaseCatalogEntryPrimaryObjectDefinition" 
        isBaseDefinition="true"
        objectGroups="CatalogEntry,SKUs,CatalogGroupSKUs" 
        idProperty="catentryId"
        propertiesClass="catCatalogGroupSKUProperties" 
        displayName="${catalogResources.displayNameCategoryLevelSKU.string}"
        newDisplayName="${catalogResources.displayNameNewCategoryLevelSKU.string}"
        displayNameProperty="partnumber" 
        searchType="FindAllCatalogEntries"
        helpLink="tasks/tpngen1s.htm">
      
      ...
      
      <!--- 
      Validator to check for duplicates in the offer price minimum quantity values.
      -->
        <catOfferPriceMinimumQuantityUniquenessValidator/>
      
      </class>
      Delete <OfferPriceMininmumQuantityUniquenessValidator package="cat"/> from the property definition
      <PrimaryObjectDefinition
      	definitionName=
      		"catBaseCatalogGroupSKUPrimaryObjectDefinition" 
      	baseDefinitionName="catBaseCatalogEntryPrimaryObjectDefinition"
      	isBaseDefinition="true"
      	objectGroups="CatalogEntry,SKUs,CatalogGroupSKUs"
      	idProperty="catentryId"
      	propertiesClass="catCatalogGroupSKUProperties" 
      	displayName="${catalogResources.displayNameCategoryLevelSKU}"
         	newDisplayName="${catalogResources.displayNameNewCategoryLevelSKU}"
      	displayNameProperty="partnumber"
         	searchType="FindAllCatalogEntries"
         	helpLink="tasks/tpngen1s.htm">
         
      	...
      	<!--
         		Validator to check for duplicates in the offer price
      		minimum quantity values.
      	-->
         	<OfferPriceMinimumQuantityUniquenessValidator package="cat"/> 
      
      </PrimaryObjectDefinition>

What to do next

After you complete your customization:
Version Steps
  1. Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the workspace_dir\LOBTools\WebContent directory. This setting is the default environment setting.
  2. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  3. Deploy your changes to your production environment.
Introduced in Feature Pack 2
  1. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  2. Deploy your changes to your production environment.