Custom Validation for the Admin Application

This section defines how you configure the custom validation for the KonaKart Admin application

CustomValidaton.properties file

From release 2.2.3.0 of KonaKart it is possible to modify the default field validation in certain parts of the Admin App.

A new properties file is provided, called CustomValidation.properties. You will find this in the classes directory of the konakartadmin webapp.

The format and description of this file is defined within the file itself, but an extract is as follows:


# ------------------------------------------------------------------
#
#  K O N A K A R T   C U S T O M   V A L I D A T I O N
#
# ------------------------------------------------------------------
# Parameters to define custom validation in the KonaKart Admin App
# ------------------------------------------------------------------

# ------------------------------------------------------------------
# If no custom validations are defined (or this file is removed) the
# default validation rules are used in the KonaKart Admin App.
#
# If you define custom validations in this file they will override
# the default rules defined in the KonaKart Admin App.
# Therefore, you only need to define the custom validation rules
# that are different to the defaults.
# ------------------------------------------------------------------

# ------------------------------------------------------------------
# If your intention is to increase the number of characters allowed
# in the database for a certain quantity, you will have to modify 
# the characteristics of that column in the database first.   If you
# then wish to validate the attribute in the KonaKart Admin App to
# allow for the increased column width... you also need to add your
# custom validation to this file
# ------------------------------------------------------------------

# ------------------------------------------------------------------
# Format:
#
# ClassName.Attribute = [min];[max]
#
# If min or max are not specified they will not be checked.
# 

Therefore, if you wanted to change the validation on the Product SKU field in the Admin App, you would specify:


Product.sku               = 1;18

Fields Supported by Custom Validation

Only a certain subset of fields can have their validation overridden in this way, but if you need other fields to be made available for validation please get in touch with support at KonaKart.

Currently you can define validation rules for the following fields:


Address.company
Address.custom1
Address.custom2
Address.custom3
Address.custom4
Address.custom5
Address.postcode
Address.street_address
Address.suburb

Category.name
Category.image
Category.custom1
Category.custom2
Category.custom3

CustGroup.priceId

Customer.email_address
Customer.custom1
Customer.custom2
Customer.custom3
Customer.custom4
Customer.custom5
Customer.telephone
Customer.fax

Order.custom1
Order.custom2
Order.custom3
Order.custom4
Order.custom5
Order.number

Order_Status_History.comment

Product.contentType
Product.custom1
Product.custom2
Product.custom3
Product.custom4
Product.custom5
Product.description
Product.quantity
Product.model
Product.name
Product.priceId
Product.sku
Product.weight

Manufacturer.name

All of these fields appear (commented out) in the default CustomValidation.properties file in the default installation for ease of reference.