InformationSet Definition is a specification of database mapping, Access Limit, Admin Tab etc. Open below XML file for a quick reference :
/development/definition/informationset/emailtemplate.xml
Each InformationSet has base two part Base, Fields.
Base part contain basic data of an informationSet. See below example:
<base mode="db">
<version>0.1.0</version>
<lastupdate>2009-12-01</lastupdate>
<title>Email Template</title>
<admin_tab>developer</admin_tab>
<addons>
<addon>linedtext</addon>
</addons>
<parameters>
<parameter name="listview">Yes</parameter>
<parameter name="add">Yes</parameter>
<parameter name="edit">Yes</parameter>
<parameter name="delete">No</parameter>
<parameter name="view">No</parameter>
</parameters>
<generic-field>
<enabled>No</enabled>
<title>Sort Order</title>
<type>genericTag</type>
<validation/>
<tag-attributes>
<attribute name="id">generic</attribute>
<attribute name="class">app_input</attribute>
</tag-attributes>
</generic-field>
<max_entry>
<limit></limit>
<message><![CDATA[]]></message>
</max_entry>
</base>
Name:
Name is most frequently used data. InformationSet XML file name is always consider as name of it.
Mode:
Mode define the data store process, from appRain version 3.1.0 mode is always set to "db". Example: mode="db"
Version, Lastupdate:
<version> and <lastupdate> tag is used to represent Version and Last Update Date of InformationSet. This information is for Developer reference only.
Title:
Title of informationSet shows in interface.
Admin_tab:
Admin Tab define the menu of admin tab to render. This tab name comes from Interface Builder
Addons:
This tags used to load a specific Addon in data process interface.
Parameter:
This tag is used to restricts window access. See below configuration values
Fields |
Values |
Description |
---|---|---|
listview |
Yes/No |
Grid View access of all entry |
add |
Yes/No |
Add new entry |
edit |
Yes/No |
Edit an exiting entry |
delete |
Yes/No |
Delete an entry |
view |
Yes/No |
View an entry |
Set "Yes" to enable and "No" to disabled.
Generic Field
This filed is deprecate from 3.1.0 and latest version.
Max Entry:
Set maximum row limit in a InformationSet.
Note: Database field automatically create also it change if we modify the field name but it do not delete from Database table if we remove the field definition from XML file. In that case user should manually delete the field in database table.
<field name="templatetype">
<title>Type/Name</title>
<type>inputTag</type>
<parameters>
<parameter name="edit">Yes</parameter>
</parameters>
<validation>
<rule>
<type>notEmpty</type>
<err-message>Please enter tempate type</err-message>
</rule>
</validation>
<selected></selected>
<tag-attributes>
<attribute name="id">type</attribute>
<attribute name="class">app_input</attribute>
</tag-attributes>
</field>
<field name="isfeatured">
<title>Is Featured</title>
<type>radioTag</type>
<validation>
<rule>
<type>notEmpty</type>
<err-message>Field can not left empty</err-message>
</rule>
</validation>
<options>
<option value="Yes">Yes</option>
<option value="No">No</option>
</options>
<selected>No</selected>
<db-attribute>
<attribute name="type">enum</attribute>
<attribute name="length"></attribute>
<attribute name="null"></attribute>
<attribute name="default"></attribute>
</db-attribute>
<tag-attributes>
<attribute name="id">isfeatured</attribute>
<attribute name="class">app_input</attribute>
</tag-attributes>
</field>
Name:
Name is unique among the field in a table. Field name must follow standard rule of database table field naming convention.
Following field name is not allowed for name because these fields generate automatically.
id
adminref
entrydate
lastmodified
See below example:
<field name="templatetype">
Title:
This is title of the field display in interface.
<title>Type/Name</title>
Type:
Type of the Input filed. It can be one of below:
InputTag
TextareaTag
FileTag
SelectTag
RadioTag
InformationSetTag
CategorySetTag
Parameter:
We pass additional value in parameter. Like below
edit
view
delete
richtexteditor : For textareaTag
maxwidth : For fileTag
maxheight : For fileTag.
Validation:
We can set validation for a field. The validation will apply by JavaScript. We can apply following validation:
notEmpty
notDefault
Email
Password
isNumber
alphaNumeric
Options:
Option is used to pass aditons select optons for Select Tag, Radion Button and Check box.
Selected:
Default value set in this field.
Db-Attribute:
Set database field definition. It support standard field available in database specification. If no field specified then by defult set Varchar and length 255.
Tag Attribute:
We set HTML tag attributes here. For example id, class etc.
Searchable:
Allow the field in auto serach module.
Hints:
Display as hints for end user.
Tips:
Some common problem we face like informationSet not found, Not Created, Field note updated etc. Here are some tips that can help you
1.Clear Cache cache if InformationSet not fond.
2.Set DEBUG mode "2" in System Configuration ans see executed SQL at the bottom of the page an analyze it.
3.Check Data type, Field type, Length in db-attribute and check format.
4.Disable InformationSet cache from System Configuration during development to avoid hassle of cache clearing each time.
See below standard example:
<?xml version="1.0" encoding="utf-8"?>
<InformationSet>
<base mode="db">
<version>0.1.0</version>
<lastupdate>2010-03-01</lastupdate>
<title>Country List</title>
<admin_tab>catalog</admin_tab>
<addons />
<parameters />
<generic-field>
<enabled>No</enabled>
<title>Sort Order</title>
<type>genericTag</type>
<validation />
<tag-attributes />
</generic-field>
<max_entry>
<limit></limit>
<message><![CDATA[]]></message>
</max_entry>
<sreach>
<status>No</status>
<field-selected>title</field-selected>
<field-description>shortdesc</field-description>
<parma-link>
<!-- Relative Absolute -->
<type>Relative</type>
<uri><![CDATA[store]]></uri>
</parma-link>
</sreach>
</base>
<fields>
<field name="name">
<title>Name</title>
<type>fileTag</type>
<searchable>Yes</searchable>
<hints />
<validation>
<rule>
<type>isDoc</type>
<err-message>Field can not left empty</err-message>
</rule>
</validation>
<parameters />
<db-attribute>
<attribute name="type">varchar</attribute>
<attribute name="length">50</attribute>
<attribute name="null"></attribute>
<attribute name="default"></attribute>
</db-attribute>
<tag-attributes>
<attribute name="id">title</attribute>
<attribute name="class">app_input</attribute>
</tag-attributes>
</field>
<field name="code">
<title>Code</title>
<type>inputTag</type>
<searchable>Yes</searchable>
<db-attribute>
<attribute name="type">varchar</attribute>
<attribute name="length">10</attribute>
<attribute name="null">NULL</attribute>
<attribute name="default"></attribute>
</db-attribute>
<hints />
<validation>
<rule>
<type>notEmpty</type>
<err-message>Field can not left empty</err-message>
</rule>
</validation>
<parameters />
<tag-attributes>
<attribute name="id">title</attribute>
<attribute name="class">app_input</attribute>
</tag-attributes>
</field>
<field name="shippingstatus">
<title>Shipping Status</title>
<type>radioTag</type>
<options>
<option value="Active">Active</option>
<option value="Inactive">Inactive</option>
</options>
<selected>Active</selected>
<db-attribute>
<attribute name="type ">enum</attribute>
<attribute name="length"></attribute>
<attribute name="null"></attribute>
<attribute name="default"></attribute>
</db-attribute>
<tag-attributes>
<attribute name="id">status</attribute>
<attribute name="class">app_input</attribute>
</tag-attributes>
</field>
<field name="states">
<title>States</title>
<type>textareaTag</type>
<searchable>Yes</searchable>
<db-attribute>
<attribute name="type ">text</attribute>
<attribute name="length"></attribute>
<attribute name="null"></attribute>
<attribute name="default"></attribute>
</db-attribute>
<hints />
<validation />
<parameters>
<parameter name="richtexteditor">No</parameter>
</parameters>
<tag-attributes>
<attribute name="rows">20</attribute>
<attribute name="id">states</attribute>
<attribute name="class">app_input</attribute>
</tag-attributes>
</field>
</fields>
</InformationSet>