2-24 Oracle Fusion Middleware Idoc Script Reference Guide
For example, if you wanted to return search results in a format that can be read in an Excel Spreadsheet, you could create a resource include that returns a comma-delimited
list of entries. You could then save the returned file to your hard drive, and then open it up in Excel. Another useful trick would be to create a resource include that formats
the response into a record set that can be read in as a file by the IdcCommandX utility, or the BatchLoader. Such an include could be used with a search result, or an Active
Report created with the Weblayout Editor, to build up batch files specific to arbitrary queries against the database or against the search index.
■
MergeInclude variables are cached differently than normal resource includes. Therefore, you must restart the Oracle Content Server instance if you make
changes to the resource include. This can be bypassed if you execute a docLoadResourceInclude function to dynamically load different includes
from within the MergeInclude.
■
The content type of the returned data is textplain and not texthtml for data returned by a MergeInclude. Some clients such as Internet Explorer and many
versions of Netscape still display plain text as html if you have valid HTML in the response, others clients may not. If you experience problems, you may need to
manually set the content type when you link to it.
2.8 Scoped Local Variables
Scoped local variables are a special kind of local variable, used to override how metadata is drawn to the page. These variables are scoped to a specific metadata field
by separating them with a colon.
For example, to hide the title and comments fields, you would set the following flags: dDocTitle:isHidden=1
xComments:isHidden=1 These flags must be set early in the page in the URL or by overriding the include std_
doc_page_definitions. In the following list, all flags affect the display of the field xFieldName:
■
xFieldName:groupHeader: This is set in Content Profiles if this field is the first field in a group. It contains the HTML and Idoc Script to use for the group header.
■
xFieldName:hasOptionList: Allows the field to contain a custom option list, instead of using the default option list. Must be used with the
xFieldName:optionListName variable or xFieldName:optionListScript variable.
■
xFieldName:include: Used to set the value for fieldInclude to the name of a custom resource include. This resource will be used throughout the page,
including the JavaScript and the HTML. This flag is used rarely. If needed, use the std_namevalue_field include file as a guide for making a custom include.
■
xFieldName:isExcluded: Set to true to exclude a field from the page completely. It will not be displayed as a field, or as a hidden input field. The field
will be completely absent from the page.
■
xFieldName:isHidden: Set to TRUE to hide a field on the page. On pages with form posts, the field will still be present. However, it will only exist as a hidden
INPUT field. The value of the field will be blank, unless xFieldName or
Idoc Script Application 2-25
fieldValue is defined. This will enable you to create pages with default values that cannot be changed.
■
xFieldName:isInfoOnly: Set to TRUE to display only the value of a field. This is used instead of xFieldName:isHidden to show the user what default values
are being submitted.
■
xFieldName:isRelocated: Set to TRUE to stop the automatic display of a field on the HTML page. By default, all fields on the page have a specific order. To
reorder them, you must set this flag, then display the field manually.
-- hide the comments field -- xComments:isRelocated = 1
loop DocMetaDefinition strTrimWsincstd_meta_field_display
endloop -- now turn off relocation, and display it --
xComments:isRelocated = fieldName=xComments, fieldCaption=Comments, fieldType=Memo
include std_display_field
■
xFieldName:isRequired: Set to TRUE to turn this field into a required field. This flag must be set in std_doc_page_definitions, before the JavaScript
validation code is drawn to the page.
■
xFieldName:maxLength: Similar to fieldWidth, this sets the maximum length of a text input field. This is usually greater than fieldWidth, and must be less
than the width of the field in the database.
■
xFieldName:noSchema: Set to TRUE to disable a schema option list for a field. Required if you want to generate option lists in a custom, dynamic way.
■
xFieldName:optionListName: This flag can only be set if a field is an option list. You can override which option list to use to display values:
xCountry:hasOptionList = 1 xCountry:noSchema = 1
xCountry:optionListName = securityGroups loop DocMetaDefinition
strTrimWsincstd_meta_field_display endloop
■
xFieldName:optionListScript: Similar to optionListName, except it can be used to render Idoc Script instead of explicitly defined option lists. This allows
the option list to be drawn with a ResultSet instead:
xCountry:hasOptionList = 1 xCountry:noSchema = 1
xCountry:optionListScript = rsMakeFromListGROUPS, securityGroups
select\n loop GROUPS
optionrow endloop\n
select loop DocMetaDefinition
strTrimWsincstd_meta_field_display endloop
2-26 Oracle Fusion Middleware Idoc Script Reference Guide
■
xFieldName:rowClass: Used in std_nameentry_row. It sets a Cascading Style Sheet class for the table row that contains this field.
xComments:rowClass=xuiPageTitleText loop DocMetaDefinition
strTrimWsincstd_meta_field_display endloop
■
xFieldName:rowStyle: Same as rowClass, but this can be used to create inline styles. For example, to hide the Comments field with DHTML, use the following
code:
xComments:rowStyle=display:none loop DocMetaDefinition
strTrimWsincstd_meta_field_display endloop
This is useful when you want to hide and display fields dynamically without a page reload.
3
Master List: Idoc Script by Type 3-1
3
Master List: Idoc Script by Type
This chapter describes the different types of Idoc Script variables and functions, and groups the variables and functions by type.
■
Section 3.1, Conditional Dynamic Variables