Idoc Script Application 2-21
2.6.3 Option Lists
An option list is a set of values that can be selected for a metadata field. The following topics describe the use of option lists:
■
Section 2.6.3.1, Internal Option Lists
■
Section 2.6.3.2, Option List Script
■
Section 2.6.3.3, Creating an Option List
2.6.3.1 Internal Option Lists
The Oracle Content Server system maintains the following internal option lists by default:
The securityGroups and docAccounts option lists are filtered according to the current users permissions.
2.6.3.2 Option List Script
The following Idoc Script variables and functions are used to generate and enable option lists:
Metadata Field Option List
Author dDocAuthor docAuthors
Security Group dSecurityGroup securityGroups
Type dDocType docTypes
Account dDocAccount docAccounts
Role dRole roles
Variable or Function Description
optList function
Generates the option list for a metadata field. optionListName
variable Specifies the name of an option list.
fieldIsOptionList variable
Specifies that a metadata field has an option list. fieldOptionListType
variable Specifies the type of option list strict, combo,
multi, or access. hasOptionList
variable Set to the value of the
fieldIsOptionList variable.
This variable is used in conditional statements. defaultOptionListScript
variable Defines a piece of Idoc Script that displays a
standard option list field. optionListScript
variable Overrides the standard implementation of option
list fields as defined by the defaultOptionListScript
variable. optionsAllowPreselect
variable Specifies that a metadata field option list can be
prefilled with its last value. addEmptyOption
variable Specifies that the first value in the option list is
blank. optionListResultSet
variable Specifies a ResultSet that contains option list
values. optionListKey
variable Specifies the name of a ResultSet column that
contains option list values.
2-22 Oracle Fusion Middleware Idoc Script Reference Guide
2.6.3.3 Creating an Option List
To create an option list, you can use one of the following methods:
■
Use the optList
function to generate a basic option list. Note that this only produces output when used with a service that calls loadMetaOptionsList.
For example, this code displays a list of possible authors as an HTML option list: select name=dDocAuthors
optList docAuthors select
■
Use the rsMakeFromList
function to turn the option list into a ResultSet, and then loop over the ResultSet.
For example, this code creates a ResultSet called Authors from the docAuthors option list, and loops over the ResultSet to create an HTML option list. Because
the column name is not specified as a parameter for rsMakeFromList, the column name defaults to row.
rsMakeFromListAuthors,docAuthors select name=dDocAuthors
loop Authors optionrow
endloop select
These code samples are equivalent. Typically, you would use the rsMakeFromList function when you want to parse or evaluate the list options.
2.6.4 Referencing Metadata in Dynamic Server Pages