Skip Headers
Oracle® Fusion Middleware Technical Reference Guide for Site Studio
11g Release 1 (11.1.1)

Part Number E10615-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

9 Idoc Script Extensions

Site Studio uses several Idoc Script extensions that are used to run a web site:

Note:

These script extensions are subject to change with each release of Site Studio.

9.1 About Idoc Script Extensions

Idoc Script is the server-side custom scripting language for Oracle Content Server. It enables you to reference variables, conditionally include content in HTML pages, and loop over results returned from queries.

When a component is installed on Oracle Content Server, the component can add extensions to the Idoc Script and variables, allowing for further customization.

Idoc Script is used primarily for the presentation of HTML templates and configuration settings. The Site Studio component adds a number of script extensions which are described in this section.

9.2 wcmPlaceholder

Description

The wcmPlaceholder() function defines an area on the page that will hold content. The actual content that the placeholder will display depends upon the data file, subtemplate, and other web site objects associated with the placeholder.

Parameters

If you use parameters that do not work together (for example, specifying a subtemplate as well as a region definition), then the script will execute based on the order of parameters listed above.

Code Examples

<!--$wcmPlaceholder("placeholderName")-->

<!--$wcmPlaceholder("placeholderName","dataFileDocName=dDocName", "templateDocName=[region template dDocName|subtemplate dDocName]","placeholderDefinitionDocName=dDocName",
"regionDefinitionDocName=dDocName", placeholderActions=EPRISUTMVN")-->

9.3 wcmElement

Description

The wcmElement() script inserts an element in a region template. The element does not have to be listed in the region definition.

This script allows you to retrieve out of the data file the content associated with the named element. This is only for WYSIWYG, Image, Text, and Custom elements. The content of the element that is inserted will be further evaluated in the scope of the current layout page and therefore can include further server-side Idoc Script, if necessary.

Parameters

Code Example

<!--$wcmElement("elementName")-->

<!--$wcmElement("dDocName", "elementName")-->

9.4 wcmListStart

Description

This function defines the start of a List element.

Parameters

Code Example

<!--$wcmListStart("elementName")-->

9.5 wcmListEnd

Description

This function defines the end of a list element.

Parameters

Code Example

<!--$wcmListEnd("elementName")-->

9.6 wcmListElement

Description

This performs the same function as wcmElement but it is for placing static list element content into the region template. This script allows you to retrieve out of the data file the content associated with the named static list element. The content of the element that is inserted will be further evaluated in the scope of the current layout page and therefore can include further server-side Idoc Script, if necessary.

Parameters

Code Example

<!--$wcmListElement("Wysiwyg", rowNum)-->

The above example uses only elementName and rowNum.

Example within context:

<!--$wcmListStart("StaticList")-->
<!--$wcmListIndex = 0-->
<!--$wcmListNumRows = wcmListRowCount()-->
<table><!--$loopwhile wcmListIndex < wcmListNumRows-->
<tr>
<td><!--$wcmListElement("Wysiwyg", wcmListIndex)--></td>
<td><!--$wcmListElement("plaintext", wcmListIndex)--></td>
</tr>
<!--$wcmListIndex = wcmListIndex + 1-->
<!--$endloop--></table>
<!--$wcmListEnd("StaticList")-->

9.7 wcmListRowCount

Description

This script retrieves the number of rows in the list element. An integer value is returned.

Parameters

Code Example

<!--$wcmListRowCount("listName")-->

Example within context:

<!--$wcmListStart("listName")-->
<!--$wcmListIndex = 0-->
<!--$wcmListNumRows = wcmListRowCount()-->
<table><!--$loopwhile wcmListIndex < wcmListNumRows-->
<tr>
<td><!--$wcmListElement("Wysiwyg", wcmListIndex)--></td>
<td><!--$wcmListElement("plaintext", wcmListIndex)--></td>
</tr>
<!--$wcmListIndex = wcmListIndex + 1-->
<!--$endloop--></table>
<!--$wcmListEnd("listName")-->

9.8 wcmDynamicList

Description

Prepares the service binder for a call to SS_GET_SEARCH_RESULTS by retrieving the search parameters from the named dynamic list element. It returns a Boolean indicating success or failure.

Parameters

Returns

This returns a Boolean value indicating success or failure.

Code Example

<!--$wcmDynamicList("elementName")-->

Example within context:

<!--$if wcmDynamicList("dynamicList")-->
<!--$executeService("SS_GET_SEARCH_RESULTS")-->
<!--$loop SearchResults-->
<!--$xml(dDocTitle)--><br />
<!--$endloop-->
<!--$endif-->

9.9 wcmIncludeElement

Description

This script allows the contents of an element to be displayed outside the context of the region. When an element is in the context of a region (that is, in a region template), then there is an implied data file association based on that region template.

With wcmIncludeElement, you can force a data file association when the element is outside the context of a region.

Parameters

Returns

The contents of the element are returned.

Code Example

queryVal = <!--$wcmIncludeElement("datafiledDocName", "wcm:root/wcm:element[@name='elementName']/node()")-->

9.10 wcmDynamicConversion

Description

Used to create a dynamic conversion of a native document.

Parameters

Returns

The HTML generated by the dynamic conversion based on the parameters.

Code Example

Using the default:

<!--$wcmDynamicConversion("ruleName")-->

Including a type value:

<!--$wcmDynamicConversion("ruleName","dataFileDocName=dDocName","pageNum=number","conversionsDefinitionDocName=dDocName", "conversionType=engine")-->

9.11 wcmGetListAsResultSet

Description

This tag is used to retrieve the static list content, and the content available as a ResultSet.

Parameters

Returns

This returns a Boolean value indicating success or failure.

Code Example

<!--$wcmGetListAsResultSet("dDocName","List_Element","name_of_ResultSet","false")-->
<!--$wcmGetListAsResultSet("List_Element", "name_of_ResultSet")-->

9.12 wcmFragment

Description

This tag is used on templates to add a fragment. If the tag is used on a region template or subtemplate, only the first drop-point snippet will be used.

Parameters

Code Example

<!--$wcmFragment("fragmentInstanceID", "fragmentDocName", "fragmentID", "snippetID", "ssTheme=default", "ssHoverColor=", "ssTextColor=", "ssFocusColor=", "ssShowHome=true", "ssShowNext=false", "ssClassName=IDocNavTabsTop")-->

9.13 wcmUrl

Description

This is a single script which can be used to make all link formats. Legacy sites required three different scripts to generate the different types of links available in Site Studio.

Parameters

Code Example

Links to sections; by default these links end with index.htm.

<!--$wcmUrl('nodelink',nodeId)-->
<!--$wcmUrl('nodelink',nodeId,siteId)-->

Links to content; by default these links end with a contentId.

<!--$wcmUrl('link','dDocName')-->
<!--$wcmUrl('link','dDocName','nodeId')-->
<!--$wcmUrl('link','dDocName",'nodeId','siteId')-->

Links to weblayout static resources; for example, images.

<!--$wcmUrl('resource','dDocName')-->
<!--$wcmUrl('resource','groups/public/documents/adacct/mydocname.jpg')-->

See also Section 9.40, "ssWeblayoutUrl."

Links to a DAM rendition:

<!--$wcmUrl('rendition', dDocName, 'smallimage')-->

9.14 ssIncludeXml

Description

This script extension is a core Site Studio method that allows any element within a managed XML file to be extracted and returned in an Idoc string variable, which can be placed directly on a web page as an HTML snippet. The content of the XML node that is being extracted will be further evaluated in the scope of the current layout page and therefore can include further server-side Idoc Script, if necessary.

Parameters

Returns

The content of the element listed in the Xpath.

Code Example

<!--$ssIncludeXml("dDocName", "expression"-->

<!--$ssIncludeXml("dDocName", "wcm:portal/wcm:element[@name = "eleName"]/node()"-->

9.15 ssGetDocInfo

Description

This script extension retrieves a DOC_INFO result set for the named dDocName.

Parameters

Returns

A boolean value indicating the success of the operation.

Code Example

<!--$ssGetDocInfo("MyDocName")-->

<!--$if ssGetDocInfo("MyDocName")-->
<!--$endif-->

9.16 ssGetXmlNodeCount

Description

This script extension returns a count of the number of repeating instances of a given element within a managed XML file. This is used primarily in the implementation of static list fragments to display a set of repeating contribution elements.

Parameters

Returns

The integer value of the number of rows in the list.

Code Example

<!--$ssGetXmlNodeCount("dDocName", "expression"-->

<!--$ssGetXmlNodeCount("dDocName", 'wcm:portal/wcm:element[@name = "eleName"]'-->

9.17 ssIncDynamicConversion

Description

This script extension can be used to perform a dynamic conversion of a native document where the resulting HTML is returned in an Idoc string variable that can be placed directly on a web page in the form of an HTML snippet. This method allows the caller to specify the managed conversion template and conversion layout to be used.

Parameters

Returns

An HTML string snippet of the document conversion.

Code Example

<!--$ssIncDynamicConversion("dDocName1", "dDocName2", "dDocName3", "3")-->

9.18 ssIncDynamicConversionByRule

Description

This script extension, like the ssIncDynamicConversion extension, can be used to perform a dynamic conversion of a native document where the resulting HTML is returned in an Idoc string variable that can be placed directly on a web page, in the form of an HTML snippet.

Unlike ssIncDynamicConversion, this extension uses a specified rule from the Dynamic Converter rules engine in order to decide which conversion template to use. It therefore does not require the caller to specify a managed conversion template or conversion layout.

Parameters

Returns

An HTML string snippet of the document conversion.

Code Example

<!--$ssIncDynamicConversionByRule("dDocName", "rule", "1")-->

9.19 ssIncDynamicConversionByRulesEngine

Description

This script extension, like the ssIncDynamicConversion extension, can be used to perform a dynamic conversion of a native document where the resulting HTML is returned in an Idoc string variable that can be placed directly on a web page, in the form of an HTML snippet.

Unlike ssIncDynamicConversion, this extension uses the normal Dynamic Converter rules engine in order to decide which conversion template to use. It therefore does not require the caller to specify a managed conversion template or conversion layout.

Parameters

Returns

An HTML string snippet of the document conversion.

Code Example

<!--$ssIncDynamicConversionByRulesEngine("dDocName", "1")-->

9.20 ssIncInlineDynamicConversion

This script extension, like the ssIncDynamicConversion extension, can be used to perform a dynamic conversion of a native document where the resulting HTML is returned in an Idoc string variable that can be placed directly on a web page, in the form of an HTML snippet. Unlike ssIncDynamicConversion, this extension uses a built-in blank template for the dynamic conversion and therefore does not require the caller to specify a managed conversion template or conversion layout.

Parameters

Returns

An HTML string snippet of the document conversion.

Code Example

<!--$ssIncInlineDynamicConversion("dDocName", "1")-->

9.21 ssIsNativeDoc

Description

This script extension can be used to detect whether a managed document is to be considered a native document, and thus available for dynamic conversion, or a contributor data file, which requires no conversion.

The comparison is not an inclusive test for a native document; the test is an exclusive test for data files. The return of yes as a result means that the document was shown to not be a data file.

Parameters

Returns

Boolean value [1 | 0].

Code Example

<!--$Variable = ssIsNativeDoc("dDocName")-->

9.22 ssRandom

Description

This script extension is used to generate a random number.

Parameters

It has no parameters.

Returns

A non-negative integer value random number.

Code Example

<!--$ssRandom()-->
<!--$Variable = ssRandom()-->

9.23 ssGetNodeProperty

Description

This script extension can be used to obtain a node property for either the current section or an explicitly specified section. It is typically used to access custom node properties.

Parameters

Returns

Returns the value of the specified property. If "label" is used, the section label will be returned, but other properties can be specified.

Code Example

For example, the following command will retrieve the section label for the current section:

<!--$ssGetNodeProperty('label')-->

While the following command will retrieve the section label for section 474:

<!--$ssGetNodeProperty('474', 'label') -->

9.24 ssGetWebsiteNodeType

Description

This script extension can be used to tell the difference between a site node (the root of the hierarchy) and a regular section node. It can also tell the difference between an ASP and a non-ASP site or section node.

Parameters

Returns

The return value is one of the following:

Code Example

<!--$ssGetWebsiteNodeType("siteId", "nodeId")-->
<!--$Variable = ssGetWebsiteNodeType("nodeId")-->

9.25 ssGetCoreMajorVersion

Description

This script extension can be used to obtain the major version of the underlying content server.

Parameters

It has no parameters.

Returns

Oracle Content Server major version number.

Code Example

<!--$Variable = ssGetCoreMajorVersion()-->

9.26 ssSplitString

Description

This script extension can be used to split a string into segments based on a specified delimiter.

Parameters

Returns

The return value is an integer indicating the number of segments that were split out of the supplied string. The extension also generates a ResultSet with one column, named String, listing the split strings.

Code Example

<!--$ssSplitString("ABC;123;XYZ" , ";" , "StorageRows")-->

9.27 ssGetWebsiteName

Description

This script extension can be used to obtain the web site name for any web site on the content server.

Parameters

The parameters are:

Returns

The web site name (label) of the siteId.

Code Example

<!--$ssGetWebsiteName("siteId")-->

9.28 ssGetSiteProperty

Description

This script extension can be used to obtain a site property for any web site on the content server.

Parameters

Returns

The property listed in propertyName, as a string.

Code Example

<!--$ssGetSiteProperty("siteId" , "propertyName")-->

9.29 ssGetFirstNodeId

Description

This script extension can be used to obtain the identifier (nodeId) for the root node of any web site on the content server.

Parameters

Returns

The Id of the first node.

Code Example

<!--$Variable = ssGetFirstNodeId("siteId")-->

9.30 ssGetRelativeNodeId

Description

This script extension can be used to obtain the identifier (nodeId) of a node relative to a given node.

Parameters

Returns

The nodeId of the node that has the stated relationship to the context node, or an empty string if there is no node with that stated relationship.

Code Example

<!--$Variable = ssGetRelativeNodeId("siteId" , "nodeId" , "child" , "no")-->

9.31 ssLoadSiteNavResultSet

Description

This script extension can be used to create a "SiteStudioNavNodes" ResultSet in the Idoc execution environment that will contain the active hierarchy for any web site on the content server.

Parameters

Returns

A ResultSet of the web site hierarchy, called "SiteStudioNavNodes."

The "SiteStudioNavNodes" ResultSet has 5 or more columns, depending on the settings of the configuration flag SSAdditionalNavResultSetFields (For more information, see Section 12.14, "SSAdditionalNavResultSetFields"):

Code Example

<!--$ssLoadSiteNavResultSet("siteId")-->

9.32 ssGetServerRelativeUrl

Description

This script extension can be used to generate a server relative URL to the primary layout for a specified node, including the trailing urlPageName (usually index.htm).

Parameters

Returns

A full friendly URL relative to the server.

Code Example

<!--$ssGetServerRelativeUrl("siteId" , "nodeId")-->

9.33 ssGetServerRelativePath

Description

This script extension can be used to generate a server relative URL to the primary layout for a specified node, excluding the trailing urlPageName (usually index.htm).

Parameters

Returns

A full friendly URL relative to the server, not including the page name.

Code Example

<!--$ssGetServerRelativePath("siteId" , "nodeId")-->

9.34 ssGetUrlPageName

This script extension can be used to obtain the urlPageName for a specified node.

Parameters

Returns

The urlPageName of the node. Usually this is index.htm.

Code Example

<!--$ssGetUrlPageName("siteId")-->

9.35 ssGetNodeLabel

Description

This script extension can be used to obtain the label for a specified node.

Parameters

Returns

The label of the specified node.

Code Example

<!--$ssGetNodeLabel("siteId" , "nodeId")-->

9.36 ssGetNodeLabelPath

Description

This script extension can be used to obtain a "/" separated string relative to the root of the web site that can be used for a GUI label (for example, "/products/servers/web server").

Parameters

Returns

The script returns a string separated by "/" of the folders in the stated node in the stated web site.

Code Example

<!--$ssGetNodeLabelPath("siteId" , "nodeId")-->

9.37 ssGetAllSites

Description

This script extension can be used to generate a ResultSet containing a list of all available web sites.

Parameters

Returns

The list of all available web sites on the server is returned in a ResultSet.

Code Example

<!--$ssGetServerRelativePath("resultSetName")-->

9.38 ssLink

Description

This script extension is used to generate a path-based URL to a named document. This is deprecated in preference of wcmUrl (see Section 9.13, "wcmUrl").

For more information, see Section 4.3, "Using Server-Side Script Links."

Parameters

Returns

A string which is the friendly link to a specific piece of content.

Code Example

<!--$ssLink("dDocName" , "targetSiteId")-->
<!--$ssLink("dDocName")-->
<!--$ssLink("dDocName" , "targetNodeId" , "targetSiteId")-->

9.39 ssNodeLink

Description

This script extension is used to generate a path-based URL to a specified node. This is deprecated in preference of wcmUrl (see Section 9.13, "wcmUrl").

For more information, see Section 4.3, "Using Server-Side Script Links."

Parameters

Returns

The friendly link to the primary (or landing) page of a node.

Code Example

<!--$ssNodeLink("nodeId" , "siteId")-->
<!--$ssNodeLink("nodeId")-->

9.40 ssWeblayoutUrl

Description

This script extension is used to determine the full web address of a file from either the path or dDocName. This is most typically used for paths to images in data files. This is deprecated in preference of wcmUrl (see Section 9.13, "wcmUrl").

For more information, see Section 4.3, "Using Server-Side Script Links."

Parameters

Returns

A path-based weblayout URL.

Code Example

<!--$ssWeblayoutUrl('mydocname')-->
<!--$ssWeblayoutUrl('groups/public/documents/adacct/mydocname.jpg')-->