1.1 Basic Interface

Top  Previous  Next

For the sake of the simplicity, let us assume a house has only the following properties:

 

1. address

2. age of home

3. central air

4. for sale/ for rent

5. price

Let us try to create a form-based interface for listing of such houses.

For each house property we create a database field of an appropriate type.

Name

Type

Example/Descritption

address

String

Lincoln st. 246

age of home

Integer

1, 2, …, 10, … ,15,… etc.  

central air

Yes/No flag

Yes - has central air, No - no central air

for sale/ for rent

List

for sale, for rent

price

Float

42,000

 

 

Next step is to create form for creating listings, which we will call the input form. This step is trivial. The form will include all of the above database fields. As described further in this manual, one can arrange fields in any order and split form fields into groups.

Similarly, we can create display form and search form. However, in these cases we can have options how to display the field value and how to set search criteria for the field. For example, criterion for the age of home can be set in at least four ways:

1.

must be equal to an exact number;

 

 

2.

must be greater or equal to certain number;

3.

must be less or equal to certain number;

4.

must lay in range between two certain numbers.

 

Criteria for the price can be set in same manner excluding the exact value criterion, which cannot be used due to nature of the floating point number format. Search criteria applicable to a particular database field depend on the type of the field. The above example refers to integer number, and any field of this type, not only the age of home. The Database Field Type Reference chapter at the end of the manual gives comprehensive description of system types and their possible search variants.

 

We haven't yet mentioned display forms. We need to create a display form for the system to be able to display listing information. The display form in our case is simple and contains all the fields of the database, i.e. address, age of home, central air, for sale/ for rent and price.

 

Please note that form do not necessarily have to contain all of the database fields. In our simple example, both input form and display form will contain all database fields. However, we can create search form containing only age of home and central air fields, if know that only these fields are used in 99% of all searches. Still to satisfy the other 1% of searches we can create another search with fields price, age of home and other database fields. Thus, we will have two search forms in our interface, to which we will assign different URLs on our site and different locations in the menu of the site.

Now, to make our interface complete, we need to link forms together. Since system allows many form of one type to be present in the system, we need to tell the system which display form to use when showing search results. We have only one display form for now; hence, both search forms is assigned the same (and only) display form. Now system knows how to display search results. To be able to edit found listing, the system should know what form to use for editing. Obviously, the input form, which is used to enter data of listing to the database can as well be used for editing the data. Finally we assign only our input form to only our display form. Now when our form is linked we can find the listing using search forms, see listing data and switch to editing the listing.