Idoc Script Application 2-3
2.3.1 Includes
An include defines pieces of code that are used to build the Oracle Content Server web pages. Includes are defined once in a resource file and then referenced by as many
template files as necessary. The system leverages includes very heavily.
Includes make it easier for you to customize your instance using component architecture and dynamic server pages. For more information on includes and
customization, see Oracle Fusion Middleware Developers Guide for Oracle Universal Content Management.
■
An include is defined in an HTM resource file using the following format: dynamichtml name
code end
■
An include is called from an HTM template file using the following Idoc Script format:
include name
■
Includes can contain Idoc Script and valid HTML code, including JavaScript, Java applets, cascading style sheets, and comments.
■
Includes can be defined in the same file as they are called from, or they can be defined in a separate file.
■
Standard includes are defined in the ucm_home_diridcresourcescoreidocstd_ page.idoc file.
■
HDA and CFG files are not script enabled, therefore using an include statement in either of these types of files is not supported.
For more information, see the following sections:
■
Section 2.3.1.1, Include Example
■
Section 2.3.1.2, Super Tag
■
Section 2.3.1.3, Super Tag Example
■
Section 2.4, Special Keywords
■
Section 2.4.1, Keywords Versus Functions
2.3.1.1 Include Example
One of the most common includes is the body definition element dynamichtml body_def. This include sets the page background color, the color of hyperlinks, and
the background image. The following is an example of code located in the ucm_home_ diridcresourcescoreidocstd_page.idoc file:
dynamichtml body_def --Background image defined as part of body tag---
body if background_image
background=HttpImagesRootbackground_image elseif colorBackground
bgcolor=colorBackground endif
if xpedioLook link=663399 vlink=CC9900
else link=000000 vlink=CE9A63 alink=9C3000
2-4 Oracle Fusion Middleware Idoc Script Reference Guide
endif marginwidth=0 marginheight=0 topmargin=0 leftmargin=0
end Most of the standard template resource files for example, ucm_home_
diridcresourcescoretemplatespne_home_page.htm contain the following Idoc Script code near the top of the page:
include body_def When the Oracle Content Server system resolves a template page containing this code,
it looks for the dynamichtml body_def definition and replaces the placeholder code with the code in the definition.
2.3.1.2 Super Tag
The super tag is used to define exceptions to an existing include. The super tag tells the include to start with an existing include and then add to it or modify using the
specified code.
■
The super tag uses the following syntax: dynamichtml my_resource
include super.my_resource exception code
end
■
You can use the super tag to refer to a standard include or a custom include. The super tag incorporates the include that was loaded last.
■
You can specify multiple super tags to call an include that was loaded earlier than the last version. For example, to make an exception to the standard body_def
include in two different components, you can use the following syntax in the one that is loaded last:
include super.super.body_def
■
The super tag is particularly useful when making small customizations to large includes or when you customize standard code that is likely to change from one
software version to the next. When you upgrade to a new version of Oracle Content Server software, the super tag ensures that your components are using
the most recent version of the include, modifying only the specific code you require to customize your instance.
2.3.1.3 Super Tag Example