Fields and resources types builder
Library is the base conception and home node of the C-Gator resource tree. Every library contains its own set of resource types, queries as well as the resources of provided types. For example, the Site Structure library has got such resource types as a folder, an image, a file, a page, etc. You can learn more about resource sample types in C-Gator Designer's Guide. The C-Gator basic kit includes these standard resource types set.
However, the most powerful feature of the C-Gator system is the ability to create own libraries and resource types enlarging the standard set by that way.
Sometimes there is no point in creating library and write its resource types from zero. For exapmle, the Site Structure library is multipurpose and can be used to create sites in different domains. For such cases C-Gator provides the function of a library export into external file (XML or ZIP) with following import of the library.

Resource type is the essence defining basic properties of all resources of a certain type, allowable actions with this resource and the C-Gator interface features for work with this resource type.
Resource type has got a set of properties:

All resource types of one library share the same set of fields. At that each fields' set of resource types is a subset of a library fields set. A flag to the left of each field's name specifies a field availability for this resource type.

You can specify a set of tabs for the resource type. These tabs will be seen during the resource creation and editing. You can edit this list — add new tabs, change or delete exsistent ones. The switch in the right upper corner shows for which editor the fields set is being spesified — for the resource editor or for the multiple properties editor.

For every tab the following data should be specified:
- list of fields displayed on the tab (from the list of fields of this resource type)
- list of actions — a set of graphic buttons, each of them relates to a certain command (e.g., delete resource, save changes, block for editing, publish, etc.)
Every resource contains a set of characteristics (properties) attributable for resources of this type only. These characteristics' values are saved in fields. Every field stores a separate value of its type. For example, the field "date of creation" of DateTime type stores the value «29.08.2004». Also, every resource has got a set of multiple properties — details with their own set of adjustable fields.

C-Gator supports the varied set of resource types fields and multiple properties:
| Text |
Text field is a text line in free format. The additional parameter “max number of symbols” sets the number of signs acceptable in the field (not more than 255 symbols). |
| Note |
Text multi-line field with unlimited number of symbols. |
| Number |
Real value of binary accuracy (64-bit IEEE). |
| Integer |
Integral value with meanings from -2 147 483 648 to 2 147 483 647. Real limits are set by additional parameters –“Minimal value” and “Maximal value”. |
| DateTime |
Date within the limits of January 1, 1753 – December 31, 9999; and time within the accuracy of 1/300 seconds. |
| Boolean |
Logical field — “true” and “false” values. |
| Currency |
Amount of money in rubles or in other currency. |
| Choice |
Field value is taken from the fixed values list. |
| Multichoice |
Field value — one or several ones from the fixed values list. |
| Guid |
Unique 128-bit value,used for identification. |
| RatingScale |
Rating used for polls and voting. |
| Status |
Resource status in processing — e.g, “ pending”, “ published”, etc. |
| File |
Field stores the content of a file chosen by user. |
| Url |
Pointer to another resource of the same site or out of it. |
| Calculated |
Computable field. Field value is calculated within the formula (SQL-expression). |
| Counter |
Field - counter with availability to change values. |
| Lookup |
Field value is taken from the list derived from another resource. |
| User |
System user, the value is taken from all users list. |
The list of library fields includes all fields, which can be used for identification of resource types of the library. The list of all fields available in the library is in the Fields List tab.
A simple flat table is used for all library resources records' storage. Every resource type uses a set of fields, which are subsets of the library fields set.
Practically all over the system, where you see a list of something, this list is a set of records (selections) retreived under a query. The query describes in XML view the selection of resource fields or multiple fields.
The main task of the query is to determine conformance between names of resource types fields and the flat table's rows where data is finally saved.
For example, the query to news line is as follows:
|
<?xml version="1.0" encoding="utf-16"?> <View QuerySource="2"> <ViewFields> <fieldref name="title" /> <fieldref name="date" /> <fieldref name="description" /> <fieldref name="content" /> <fieldref name="published" /> </ViewFields> <OrderBy>date desc,title</OrderBy> <Query> <and> <cond oper="geq"> <expr fieldref="date" /> <expr value="CAST(CONVERT(VARCHAR(20), DATEADD(day, 2-DATEPART(weekday, getDate()), getdate()), 112) + ' 00:00' as Datetime)" /> </cond> |
The query to news line displayed on the website:

|