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
SEARCHFORMstatement is nested within a pair ofPROPERTYtags and typically follows theINPUTFORMstatement for the property.If the
PROPERTYsection does not include aSEARCHFORMstatement, the field does not appear on the Advanced Search section.Typically the
SEARCHFORMstatement closely matches theINPUTFORMstatement 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
SEARCHFORMstatements in an asset descriptor file to create theSearchForm.xml,AppendSelectDetails.xml, andSelectSummary.sqlfiles for this asset type. (For information about these elements, see the AssetMaker section in the Sites 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.
TYPE="TEXT"
<SEARCHFORM
TYPE="TEXT" DESCRIPTION="NameOfProperty" MAXLENGTH="length" WIDTH="width"/>
TYPE="TEXTAREA"
<SEARCHFORM
TYPE="TEXTAREA" DESCRIPTION="NameOfProperty" MAXLENGTH="length" COLS="width of text box" ROWS="height of text box"/>
TYPE="SELECT"
<SEARCHFORM
TYPE="SELECT" DESCRIPTION="NameOfProperty" [VERB="SQL verb"] SOURCETYPE="STRING|TABLE" OPTIONDESCRIPTIONS="xxx,yyy,zzz" OPTIONVALUES="x,y,z" TABLENAME="table name" OPTIONDESCKEY="column name" OPTIONVALUEKEY="column name" [SQL="SQL statement"]/>
TYPE="RADIO"
<SEARCHFORM
TYPE="RADIO" DESCRIPTION="NameOfProperty" [VERB="SQL verb"] SOURCETYPE="STRING|TABLE" RBDESCRIPTIONS="xxx,yyy,zzz" RBVALUES="x,y,z" TABLENAME="table name" RBDESCKEY="column name" RBVALUEKEY="column name" [SQL="SQL statement"]/>
TYPE="ELEMENT"
<SEARCHFORM
TYPE="ELEMENT" WIDTH="width" REQUIRED="YES|NO" DEFAULT="default value" INSTRUCTION="help for the form" />Parameters
Parameters For All Types
TYPE (required)- Input type of the field. It must be set to one of the following values:
TEXT,TEXTAREA,SELECT, orRADIO. You cannot set it toUPLOADorCHECKBOX. For definitions of these input types, see INPUTFORM.
- The
TYPEforSEARCHFORMmust be compatible with theTYPEforINPUTFORM. Typically, it is the sameTYPE, but it does not have to be.
DESCRIPTION (required)- Name of the field. The
DESCRIPTIONforSEARCHFORMshould either match or include theDESCRIPTIONforPROPERTY. See PROPERTY.
MAXLENGTH (optional)- Maximum number of characters that can be entered in this field. If this parameter is not specified, AssetMaker uses the
LENGTHvalue that you specified with theSTORAGEtag 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
LENGTHspecified by theSTORAGEtag.
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
VERBto 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, Sites searches for assets whose value in that field is less than 4. If VERB is not specified, the SQL verb is "LIKE", by default.
TEXT Parameters
(TYPE="TEXT")
WIDTH (required)- The width of the field in characters when it is displayed in the form. Corresponds to the HTML attribute
SIZE.
TEXTAREA Parameters
(TYPE="TEXTAREA")
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.
SELECT Parameters
(TYPE="SELECT")
SOURCETYPE (required)- The source of the options available in the drop-down list for this field.
- To specify the options, set
SOURCETYPEtoSTRING. and then use the next two parameters in this section (OPTIONDESCRIPTIONSandOPTIONVALUES).- To specify a query that obtains the list dynamically from a database table, set
SOURCETYPEtoTABLEand then use the last four parameters in this section (TABLENAME,OPTIONDESCKEY,OPTIONVALUEKEY, andSQL).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
OPTIONDESCRIPTIONSparameter. 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
OPTIONVALUESparameter to create a string list for Sites 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",andSOURCE="STRING". To specify that one of the values that can be entered in this field is 100,000, you specify "100000" as one of theOPTIONVALUESif 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 Sites 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, andOPTIONVALUEKEY.
OPTIONDESCKEY (required when SOURCETYPE="TABLE")- The name of the column in the table identified by
TABLENAMEthat 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
TABLENAMEthat 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
TABLENAMEas the source and it must select data from the two columns identified byOPTIONDESCKEYandOPTIONVALUEKEY.
RADIO Parameters
(TYPE="RADIO")
SOURCETYPE (required)- The source of the options available in the drop-down list for this field.
- To specify the options, set
SOURCETYPEtoSTRING. and then use the next two parameters in this section (RBDESCRIPTIONSandRBVALUES).- To specify a query that obtains the list dynamically from a database table, set
SOURCETYPEtoTABLEand then use the last four parameters in this section (TABLENAME,RBDESCKEY,RBVALUEKEY, andSQL).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
CBDESCRIPTIONSparameter. 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
CBVALUESparameter to create a string list for Sites 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 Sites 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, andRBVALUEKEY.
RBDESCKEY (required when SOURCETYPE="TABLE")- The name of the column in the table identified by
TABLENAMEthat 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
TABLENAMEthat 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
TABLENAMEas the source and it must select data from the two columns identified byRBDESCKEYandRBVALUEKEY.
ELEMENT Parameters
(TYPE="ELEMENT")
INSTRUCTION (required)- A short help message that appears near the field in the Sites 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:
<PROPERTY NAME="title" DESCRIPTION="Title">
<STORAGE TYPE="VARCHAR" LENGTH="255"/> <INPUTFORM TYPE="TEXT" WIDTH="48" MAXLENGTH="44" REQUIRED="YES" DEFAULT="Enter the title here"/> <SEARCHFORM TYPE="TEXT" DESCRIPTION="Title contains" WIDTH="48" MAXLENGTH="44"/></PROPERTY>This code fragment includes the text box field named "Author's Note" on the Advanced Search form for the asset type:
<PROPERTY NAME="authorsnote" DESCRIPTION="Author's Note">
<STORAGE TYPE="VARCHAR" LENGTH="125"/> <INPUTFORM TYPE="TEXTAREA" COLS="48" ROWS="2" MAXLENGTH="100" REQUIRED="YES" DEFAULT=""/> <SEARCHFORM TYPE="TEXTAREA" DESCRIPTION= "Author's Note contains" COLS="48" ROWS="2" MAXLENGTH="100"/></PROPERTY>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:
<PROPERTY NAME="mimetype" DESCRIPTION="Mimetype">
<STORAGE TYPE="VARCHAR" LENGTH="36"/> <INPUTFORM TYPE="SELECT" SOURCETYPE="TABLE" TABLENAME="mimetype" OPTIONDESCKEY="description" OPTIONVALUEKEY="mimetype" SQL="SELECT mimetype, description FROM mimetype WHERE keyword = 'stylesheet' AND isdefault = 'y'"/> <SEARCHFORM DESCRIPTION="Mimetype" TYPE="SELECT" SOURCETYPE="TABLE" TABLENAME="mimetype" OPTIONDESCKEY="description" OPTIONVALUEKEY="mimetype" SQL="SELECT mimetype, description FROM mimetype WHERE keyword = 'stylesheet' AND isdefault = 'y'"/></PROPERTY>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:
<PROPERTY NAME="shipping" DESCRIPTION="Shipping option">
<STORAGE TYPE="VARCHAR" LENGTH= "36"/> <INPUTFORM TYPE="CHECKBOX" SOURCETYPE="STRING" CBDESCRIPTIONS="Ground, 2nd Day, Next Day" CBVALUES="O,1,2"/> <SEARCHFORM TYPE="CHECKBOX" DESCRIPTION="Shipping is" SOURCETYPE="STRING" CBDESCRIPTIONS="Ground, 2nd Day, Next Day" CBVALUES="O,1,2"/></PROPERTY>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:
<PROPERTY NAME="shipping" DESCRIPTION="Shipping option">
<STORAGE TYPE="VARCHAR" LENGTH= "36"/> <INPUTFORM TYPE="RADIO" SOURCETYPE="STRING" RBDESCRIPTIONS="Ground, 2nd Day, Next Day" RBVALUES="O,1,2"/> <SEARCHFORM TYPE="RADIO" DESCRIPTION="Shipping is" SOURCETYPE="STRING" RBDESCRIPTIONS="Ground, 2nd Day, Next Day" RBVALUES="O,1,2"/></PROPERTY>This code fragment includes a numeric field named "Height" on the Advanced Search form for the asset type. Notice that the
VERBargument is specified because theSTORAGETYPEis set toINTEGER:<PROPERTY NAME="height" DESCRIPTION="Height">
<STORAGE TYPE="INTEGER" LENGTH="4"/> <INPUTFORM TYPE="TEXT" WIDTH="4" MAXLENGTH="4" REQUIRED="NO" DEFAULT=""/> <SEARCHFORM DESCRIPTION="Height" TYPE="TEXT" WIDTH="4" MAXLENGTH="4" VERB="="/></PROPERTY>
Home > Contents > Index > ![]()
Oracle Miscellaneous Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.