Home > Contents > Index >
AssetMaker   |    Cart Tags   |    Errors   |    Miscellany   |    Index

 

SEARCHFORM

Specifies the format of the field (property) and how data is entered into it when it appears on the Advanced Search form. A SEARCHFORM statement is nested within a pair of PROPERTY tags and typically follows the INPUTFORM statement for the property.

If the PROPERTY section does not include a SEARCHFORM statement, the field does not appear on the Advanced Search section.

Typically the SEARCHFORM statement closely matches the INPUTFORM statement regarding the input type and where the options (if any) come from. However, the types do not have to match exactly (although they must be similar, compatible).

AssetMaker uses this SEARCHFORM statements in an asset descriptor file to create the SearchForm.xml, AppendSelectDetails.xml, and SelectSummary.sql files for this asset type. (For information about these elements, see the AssetMaker section in the CSEE Developer's Guide.)

You cannot include upload fields or check boxes on the search forms. You also cannot include select fields if they accept more than one value at a time.

Note

When the SOURCETYPE is "Table," the select does not appear on the SimpleSearch form, but it does appear in the Advanced search for the asset type.

Syntax

The syntax for this tag varies based on the setting for TYPE.

Parameters

TYPE (required)
Input type of the field. It must be set to one of the following values: TEXT, TEXTAREA, SELECT, or RADIO. You cannot set it to UPLOAD or CHECKBOX. For definitions of these input types, see INPUTFORM.

The TYPE for SEARCHFORM must be compatible with the TYPE for INPUTFORM. Typically, it is the same TYPE, but it does not have to be.

DESCRIPTION (required)
Name of the field. The DESCRIPTION for SEARCHFORM should either match or include the DESCRIPTION for PROPERTY. See PROPERTY.

MAXLENGTH (optional)
Maximum number of characters that can be entered in this field. If this parameter is not specified, AssetMaker uses the LENGTH value that you specified with the STORAGE tag to determine how many values can be entered in the field.

Use this parameter when you want to limit users to entering fewer characters in the field than the column can actually hold. Note that you cannot set this value to be greater than the LENGTH specified by the STORAGE tag.

VERB (required when STORAGE TYPE is BIGINT, SMALLINT, INTEGER, DOUBLE, or TIMESTAMP)
Sets the SQL verb that evaluates the value entered in this search field. You can set VERB to any of the following values:
Setting for VERB
Description
    VERB="="
    
is equal to
    VERB="!="
    
is not equal to
    VERB="&060;"
    
is < than
    VERB="&062;"
    
is > than

 

For example, if you set VERB="&060;" and a user enters 4 in the field in the Advanced Search form, CS-Direct searches for assets whose value in that field is less than 4. If VERB is not specified, the SQL verb is "LIKE", by default.

WIDTH (required)
The width of the field in characters when it is displayed in the form. Corresponds to the HTML attribute SIZE.

COLS (required)
The width of the text box in characters. For example, COLS="48".

ROWS (required)
The height of the text box in lines. For example, ROWS="4".

Corresponds to the HTML attribute ROWS.

SOURCETYPE (required)
The source of the options available in the drop-down list for this field.

OPTIONDESCRIPTIONS (required when SOURCETYPE="STRING")
A list of the options that appear in the drop-down list in the form, separated by commas. For example, OPTIONDESCRIPTIONS="red,yellow,blue,green".

OPTIONVALUES (required when SOURCETYPE="STRING")
A list of the values that map to the options specified by the OPTIONDESCRIPTIONS parameter. In other words, you can specify that the options that appear in the drop-down list are "red,yellow,blue,green" but that the values that are written to the database are "r,y,b,g".

Note

If the data type of this field is numeric and you use the OPTIONVALUES parameter to create a string list for CS-Direct to use when populating the field, your list of values must be compatible with the way numeric values are stored in your DBMS.

For example, say that STORAGE TYPE="DOUBLE", SEARCHFORM TYPE="SELECT", and SOURCE="STRING". To specify that one of the values that can be entered in this field is 100,000, you specify "100000" as one of the OPTIONVALUES if your DBMS is SQLServer but you specify "100000.0000000000" if your DBMS is Oracle.

In other words, the format of the values in such a string list must match that of your DBMS. Generally speaking, using a static list of string values is not a good choice for a numeric fields.

TABLENAME (required when SOURCETYPE="TABLE")
The name of the Content Server table that the options and their corresponding values are to be found in. AssetMaker creates a SQL query for this field based on the values you set for TABLENAME, OPTIONDESCKEY, and OPTIONVALUEKEY.

OPTIONDESCKEY (required when SOURCETYPE="TABLE")
The name of the column in the table identified by TABLENAME that contains the options that appear in the drop-down list in the form.

OPTIONVALUEKEY (required when SOURCETYPE="TABLE")
The name of the column in the table identified by TABLENAME that holds the values that are written to the database when the user selects an option from the drop-down list.

SQL (optional when SOURCETYPE="TABLE")
A SQL statement that overrides the SQL query that AssetMaker creates based on the values provided with the previous three parameters. Use the SQL parameter when you want to include additional clauses in the query.

The query is still based on the values provided for the previous three parameters which means that in addition to the additional clauses you include, the statement must specify the table specified by TABLENAME as the source and it must select data from the two columns identified by OPTIONDESCKEY and OPTIONVALUEKEY.

SOURCETYPE (required)
The source of the options available in the drop-down list for this field.

RBDESCRIPTIONS (required when SOURCETYPE="STRING")
A list of the options that appear in next to the check boxes, in the order that you want them to appear, separated by commas. For example, CBDESCRIPTIONS="red,yellow,blue,green".

RBVALUES (required when SOURCETYPE="STRING")
A list of the values that map to the check box options specified by the CBDESCRIPTIONS parameter. In other words, you can specify that the options that appear next to the check boxes are "red,yellow,blue,green" but that the values that are written to the database are "r,y,b,g".

Note

If the data type of this field is numeric and you use the CBVALUES parameter to create a string list for CS-Direct to use as the check box names, your list of values must be compatible with the way numeric values are stored in your DBMS.

For example, if STORAGE TYPE="DOUBLE" and you want one of the values that could be entered in this field to be 100,000, you specify "100000" if your DBMS is SQLServer but you specify "100000.0000000000" if your DBMS is Oracle.

In other words, the format of the values in such a string list must match that of your DBMS. Generally speaking, using a static list of string values is better suited for text fields than it is for numeric fields.

TABLENAME (required when SOURCETYPE="TABLE")
The name of the Content Server table that the names of the radio and their corresponding values are to be found in. AssetMaker creates a SQL query for this field based on the values you set for TABLENAME, RBDESCKEY, and RBVALUEKEY.

RBDESCKEY (required when SOURCETYPE="TABLE")
The name of the column in the table identified by TABLENAME that contains the names that appear next to the radio buttons on the form.

RBVALUE (required when SOURCETYPE="TABLE")
The name of the column in the table identified by TABLENAME that holds the values that are written to the database when the user selects the radio button.

SQL (optional when SOURCETYPE="TABLE")
A SQL statement that overrides the SQL query that AssetMaker creates based on the values provided with the previous three parameters. Use the SQL parameter when you want to include additional clauses in the query.

The query is still based on the values provided for the previous three parameters which means that in addition to the additional clauses you include, the statement must specify the table specified by TABLENAME as the source and it must select data from the two columns identified by RBDESCKEY and RBVALUEKEY.

INSTRUCTION (required)
A short help message that appears near the field in the CS-Direct New or Edit forms. Format is yyyy-mm-dd hh:mm.

Example

This code fragment includes the text field named "Title" on the Advanced Search form for the asset type:

This code fragment includes the text box field named "Author's Note" on the Advanced Search form for the asset type:

This code fragment includes a select box named "Mimetype" on the Advanced Search form for the asset type. The field's drop-down list is populated by a SQL query:

This code fragment tells includes a set of check boxes named "Ground," "Next Day," and "2nd Day" on the Advanced Search form for the asset type:

This code fragment includes a set of radio options named "Ground," "2nd Day," and "Next Day" on the Advanced Search form for the asset type:

This code fragment includes a numeric field named "Height" on the Advanced Search form for the asset type. Notice that the VERB argument is specified because the STORAGE TYPE is set to INTEGER:

  Home > Contents > Index >

FatWire Miscellaneous Reference
Copyright 2005 by FatWire Software
All rights reserved.