The syntax for the <product_code>.xml is shown in the following code snippet:
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> |
...
<validate> |
...
<FUNCTIONCODE_ACTIONCODE> |
...
<fieldType attribute1="value" attribute2="value" ... attributen="value"> FIELD_NAME1 </fieldType> |
...
. |
...
. |
...
. |
...
<fieldType attribute1="value" attribute2="value" ... attributen="value"> FIELD_NAMEn </fieldType> |
...
<collection name="COLLECTION1" mandatory="true"> |
...
<fieldType attribute1="value" attribute2="value" ... attributen="value"> FIELD_NAME1 </fieldType> |
...
. |
...
. |
...
. |
...
<fieldType attribute1="value" attribute2="value" ... attributen="value"> FIELD_NAMEn </fieldType> |
...
<collection name="COLLECTION2" mandatory="false"> |
...
<fieldType attribute1="value" attribute2="value" ... attributen="value"> FIELD_NAME1 </fieldType> |
...
</collection> |
...
</collection> |
...
</FUNCTIONCODE_ACTIONCODE> |
...
</validate> |
Â
The <product_code>.xml file must contain the following tags for validating the data at server-side:
...
- The <FUNCTIONCODE_ACTIONCODE> tag consists of the following tags:
- The <fieldType> tag is used to identify the fields that need validation. Independent <fieldType> tags must be specified for every field that is required to be validated. The attributes of the <fieldType> tag enable you to define the validations for any specific field.
- The <collection> tag is used to identify the container fields that encompass other fields within it. As mentioned in the above point, independent <fieldType> tags must be specified for every field within the container field that requires validation.
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
The details of the attributes of the <fieldType> tag and their values are provided in the following table:
Attribute | Acceptable Values |
---|---|
Type |
|
mandatory |
|
inclusive | Indicates that the special characters provided as the value for this attribute must be considered as valid input. |
specialCharacter | Indicates that the special characters provided as the value for this attribute must NOT be considered as valid input. |
size | Indicates the value length i.e., the number of characters that can be provided as the input. |
multiline |
|
Sample Validation Code:
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> |
...
<validate> <CRWGT_CREAT_ |
...
WGT> <fieldType type="XA" mandatory="true" specialCharacter="" size="8" multiline="false">INPUT_PRODUCT</ |
...
fieldType> <fieldType type="XA" mandatory="true" specialCharacter="" size="6" multiline="false">INPUT_SUB_PRODUCT</ |
...
fieldType> <fieldType type="XA" mandatory="true" specialCharacter="" size="5" multiline="false">INPUT_FUNCTION_CODE</ |
...
fieldType> <fieldType type="XAN" mandatory="true" inclusive=""_ specialCharacter=" " size="40" multiline="false">WIDGET_ID</ |
...
fieldType> <fieldType type="XA" mandatory="true" specialCharacter="" size="1" multiline="false">CONTAINER_FLAG</ |
...
fieldType> <fieldType type="XA" mandatory="true" inclusive="," size="6" multiline="false">CHANNEL_ID</ |
...
fieldType> <collection name="WIDGET_DEF" mandatory="true"> |
...
<fieldType type="XAN" mandatory="true" inclusive=""_ specialCharacter=" " size="40" multiline="false">WIDGET_ID</ |
...
fieldType> <fieldType type="XAN" mandatory="true" inclusive=" "_ size="40" multiline="false">WGT_DISPLAY_NM</ |
...
fieldType> <fieldType type="XA" mandatory="true" specialCharacter="" size="1" multiline="false">CONTAINER_FLAG</ |
...
fieldType> <fieldType type="XAN" mandatory="true" inclusive="-"_ specialCharacter=" " size="20" multiline="false">BUNDLE_KEY</ |
...
fieldType> <fieldType type="XA" mandatory="true" inclusive="," size="6" multiline="false">CHANNEL_ID</ |
...
fieldType> <fieldType type="XA" mandatory="true" specialCharacter="" size="1" multiline="false">WGT_RESIZE_IND</ |
...
fieldType> <fieldType type="XA" mandatory="true" specialCharacter="" size="1" multiline="false">WIDGET_HEADER_IND</ |
...
fieldType> <fieldType type="N" mandatory="false" specialCharacter="" size="38" multiline="false">WGT_HT_IN_PIXELS</ |
...
fieldType> <fieldType type="N" mandatory="false" specialCharacter="" size="38" multiline="false">NO_OF_ROWS</ |
...
fieldType> <fieldType type="XA" mandatory="true" specialCharacter="" size="1" multiline="false">IN_CATALOGUE_IND</ |
...
fieldType> <fieldType type="XAN" mandatory="false" inclusive=""_ specialCharacter=" " size="60" multiline="false">OD_PRODUCT</ |
...
fieldType> <fieldType type="XAN" mandatory="false" inclusive=""_ specialCharacter=" " size="60" multiline="false">OD_SUB_PRODUCT</ |
...
fieldType> <fieldType type="XAN" mandatory="false" inclusive=""_ specialCharacter=" " size="60" multiline="false">OD_FUNCTION</ |
...
fieldType> </collection> <collection name="WIDGET_BBAR" mandatory="false"> |
...
<fieldType type="N" mandatory="false" size="3" multiline="false">POSITION</ |
...
fieldType> <fieldType type="XAN" mandatory="false" inclusive=""_ size="24" multiline="false">BBAR_BTN_ID</ |
...
fieldType> <fieldType type="XAN" mandatory="false" inclusive=" "_ size="25" multiline="false">BTN_DISPLAY_NM</ |
...
fieldType> <fieldType type="XA" mandatory="false" specialCharacter="" size="1" multiline="false">BTN_TYPE_IND</ |
...
fieldType> </ |
...
collection> </CRWGT_CREAT_ |
...
WGT> <VSBLTY_IS_MENUID_ |
...
UNIQUE> <fieldType type="XA" mandatory="true" specialCharacter="" size="8" multiline="false">INPUT_PRODUCT</ |
...
fieldType> <fieldType type="XA" mandatory="true" specialCharacter="" size="9" multiline="false">INPUT_SUB_PRODUCT</ |
...
fieldType> <fieldType type="XA" mandatory="true" specialCharacter="" size="9" multiline="false">INPUT_FUNCTION_CODE</ |
...
fieldType> <fieldType type="XAN" mandatory="true" inclusive=""_ size="40" multiline="false">ITEM_ID</ |
...
fieldType> </VSBLTY_IS_MENUID_ |
...
UNIQUE> </ |
...
validate> |