Oracle® Fusion Middleware Technical Reference Guide for Site Studio 11g Release 1 (11.1.1) Part Number E10615-01 |
|
|
View PDF |
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.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.
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
placeholderName
: The name of the placeholder. Required.
dataFileDocName
: The dDocName of the data file to associate with the placeholder.
templateDocName
: The dDocName of the region template or subtemplate to associate with the placeholder.
placeholderDefinitionDocName
: The dDocName of the placeholder definition to map to the placeholder.
regionDefinitionDocName
: The dDocName of the region definition to associate with the region template named in templateDocName
.
placeholderActions
: The allowed actions of the placeholder definition, as follows:
E
allows contributor update
P
allows workflow approve
R
allows workflow reject
I
allows viewing docInfo
S
allows switching the data file
U
allows viewing the web usage report
T
allows viewing the web tracker report
M
allows updating the docInfo
V
allows switching the region template
N
allows remove content
Each selection corresponds to the checkbox for the action in the design view of the placeholder definition in Designer.
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")-->
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
dDocName
: the dDocName of the data file containing the elementName
. If a dDocName is not specified, then the current data file associated with the placeholder is used.
elementName
: The name of the element. Required.
Code Example
<!--$wcmElement("elementName")--> <!--$wcmElement("dDocName", "elementName")-->
Description
This function defines the start of a List element.
Parameters
elementName
: The name of the list element. Required.
Code Example
<!--$wcmListStart("elementName")-->
Description
This function defines the end of a list element.
Parameters
elementName
: The name of the list element. Required.
Code Example
<!--$wcmListEnd("elementName")-->
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
listName
: The name of the list element. If wcmListElement is used between wcmListStart
and wcmListEnd
then listName
can be omitted.
elementName
: The name of the element within the list used to construct the listElement.
rowNum
: The row position of the elementName
within the listName
.
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")-->
Description
This script retrieves the number of rows in the list element. An integer value is returned.
Parameters
listName
: The name of the list element. If wcmListRowCount
is used between wcmListStart
and wcmListEnd
then listName
can be omitted.
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")-->
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
elementName
: The name of the element within the list used to construct the listElement
Code Example
<!--$wcmDynamicList("elementName")-->
Example within context:
<!--$if wcmDynamicList("dynamicList")--> <!--$executeService("SS_GET_SEARCH_RESULTS")--> <!--$loop SearchResults--> <!--$xml(dDocTitle)--><br /> <!--$endloop--> <!--$endif-->
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
dDocName
: The dDocName for the data file.
expression
: The XPath expression (to identify a specific node or nodes of the XML data file).
Returns
The contents of the element are returned.
Code Example
queryVal = <!--$wcmIncludeElement("datafiledDocName", "wcm:root/wcm:element[@name='elementName']/node()")-->
Description
Used to create a dynamic conversion of a native document.
Parameters
ruleName
: The name of the rule as defined in the ConversionsDefinition file. Required.
dataFileDocName
: The dDocName of the native document to convert.
pageNum
: The page number within the native document to convert.
conversionsDefinitionDocName
: The dDocName of the conversion definition.
conversionType
: Possible type values = [simple
|full
|rule
|engine
|command
].
conversionTemplate
: The dDocName of the template. Valid only when using conversionType="full"
.
conversionLayout
: The dDocName of the layout. Valid only when using conversionType="full"
.
conversionRuleName
: The name of the rule. Valid only when using conversionType="rule"
.
conversionCommand
: A piece of Idoc Script executed in the context of the page. Valid only when using conversionType="command"
.
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")-->
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
fragmentInstanceId
: The ID of the fragment instance on the page. Used to differentiate fragments that have multiple pages of returns, such as dynamic lists. The ID allows the dynamic lists to display different 'pages' of query results. For instance, one fragment can be on page 1 of its query results, while the other can display page 3 of its own results. If the same ID is used for both fragments, then clicking to a particular page of results for one query will cause the other fragment to display the same page number of its own results.
fragmentDocName
: The dDocName of the fragment library.
fragmentId
: The ID of fragment within the named library.
snippetId
: The ID of snippet within the named fragment.
tagProperties
: The named value pairs of properties of the fragment.
Code Example
<!--$wcmFragment("fragmentInstanceID", "fragmentDocName", "fragmentID", "snippetID", "ssTheme=default", "ssHoverColor=", "ssTextColor=", "ssFocusColor=", "ssShowHome=true", "ssShowNext=false", "ssClassName=IDocNavTabsTop")-->
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
type
: The type of link, entered as one of the following: [nodelink
| link
| resource
|rendition
]
nodelink
is used to create links to sections, which by default end with index.htm
.
link
is used to create links to content, which by default end with <contentId>
.
resource
is used to link to weblayout static resources, such as images.
rendition
is used to link to Digital Asset Manager (DAM) renditions.
nodeId
: the ID of the node referenced. Used only when the type is set to either nodelink
or link
.
siteId
: the site ID of the Web site referenced. Used only when the type is set to either nodelink
or link
.
dDocName
: the dDocName of the content referenced. Used only when the type is set to either link
or resource
.
path
: the path to the content referenced. Used only when the type is set to either link
or resource
.
renditionName
: the name of the rendition linked to. Used only when the type is set to rendition
.
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 "ssWeblayoutUrl".
Links to a DAM rendition:
<!--$wcmUrl('rendition', dDocName, 'smallimage')-->
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
dDocName
: The dDocName of XML data file.
expression
: XPath expression (to identify a specific node or nodes of the XML data file).
Returns
The content of the element listed in the Xpath.
Code Example
<!--$ssIncludeXml("dDocName", "expression"--> <!--$ssIncludeXml("dDocName", "wcm:portal/wcm:element[@name = "eleName"]/node()"-->
Description
This script extension retrieves a DOC_INFO result set for the named dDocName.
Parameters
dDocName
: the identifier of the document whose DOC_INFO should be retrieved.
Returns
A boolean value indicating the success of the operation.
Code Example
<!--$ssGetDocInfo("MyDocName")--> <!--$if ssGetDocInfo("MyDocName")--> <!--$endif-->
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
dDocName
: The dDocName of XML data file.
expression
: XPath expression (to identify a specific node or nodes of the XML data file).
Returns
The integer value of the number of rows in the list.
Code Example
<!--$ssIncludeXml("dDocName", "expression"--> <!--$ssIncludeXml("dDocName", 'wcm:portal/wcm:element[@name = "eleName"]'-->
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
dDocName1
: dDocName of native document to convert.
dDocName2
: dDocName of template to use in conversion.
dDocName3
: dDocName of layout template to use in conversion.
dcPageNum
: The page number of the document to convert (optional).
Returns
An HTML string snippet of the document conversion.
Code Example
<!--$ssIncDynamicConversion("dDocName1", "dDocName2", "dDocName3", "3")-->
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
dDocName
: The dDocName of native document to convert.
rule
: The name of Dynamic Converter rule to use.
dcPageNum
: The page number of the document to convert (optional).
Returns
An HTML string snippet of the document conversion.
Code Example
<!--$ssIncDynamicConversionByRule("dDocName", "rule", "1")-->
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
dDocName
: The dDocName of native document to convert.
dcPageNum
: The page number of the document to convert (optional).
Returns
An HTML string snippet of the document conversion.
Code Example
<!--$ssIncDynamicConversionByRulesEngine("dDocName", "1")-->
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
dDocName
: The dDocName of native document to convert.
dcPageNum
: the page number of the document to convert (optional).
Returns
An HTML string snippet of the document conversion.
Code Example
<!--$ssIncInlineDynamicConversion("dDocName", "1")-->
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
dDocName
: The dDocName of document to test.
Returns
Boolean value [1 | 0].
Code Example
<!--$Variable = ssIsNativeDoc("dDocName")-->
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()-->
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
nodeId
: The nodeId
of the section to be queried (optional). If omitted, the current section is used.
name
: The property name.
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') -->
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
siteId
: The siteId of the Web site to be queried (optional).
nodeId
: The nodeId of the section to be queried.
Returns
The return value is one of the following:
0: Site node for an HCSP/JSP type site.
2: Section node for an HCSP/JSP type site.
100: Site node for an ASP type site.
102: Section node for an ASP type site.
Code Example
<!--$ssGetWebsiteNodeType("siteId", "nodeId")--> <!--$Variable = ssGetWebsiteNodeType("nodeId")-->
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()-->
Description
This script extension can be used to split a string into segments based on a specified delimiter.
Parameters
string
: The string to be split.
delimiter
: The delimiter used to split the string (for example ",").
name
: The name of the result set to store the results of the split operation.
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")-->
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:
siteId
: The unique identifier for the Web site.
Returns
The Web site name (label) of the siteId
.
Code Example
<!--$ssGetWebsiteName("siteId")-->
Description
This script extension can be used to obtain a site property for any Web site on the content server.
Parameters
siteId
: The unique identifier for the Web site.
propertyName
: The name of the property whose value is required.
Returns
The property listed in propertyName
, as a string.
Code Example
<!--$ssGetSiteProperty("siteId" , "propertyName")-->
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
siteId
: The unique identifier for the Web site
Returns
The Id of the first node.
Code Example
<!--$Variable = ssGetFirstNodeId("siteId")-->
Description
This script extension can be used to obtain the identifier (nodeId) of a node relative to a given node.
Parameters
siteId
: The unique identifier for the Web site.
nodeId
: The unique identifier for the context node.
relative
: The relationship; must be one of: [child
|parent
|prior
|next
].
respectContribOnly
: A boolean value [yes
|no
]; the default is yes
(optional).
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")-->
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
siteId
: the unique identifier for the Web site
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 (see "SSAdditionalNavResultSetFields" for more information):
nodeId
: the unique identifier for the node.
parentNodeId
: the unique identifier for the parent node.
label
: the label for the node.
level
: the depth of the node in the site hierarchy. The root section has a level of 0.
href
: the site relative path-based URL to the nodes primary page.
Code Example
<!--$ssLoadSiteNavResultSet("siteId")-->
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
siteId
: The unique identifier for the Web site.
nodeId
: A unique identifier for a node.
Returns
A full friendly URL relative to the server.
Code Example
<!--$ssGetServerRelativeUrl("siteId" , "nodeId")-->
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
siteId
: The unique identifier for the Web site.
nodeId
: A unique identifier for a node.
Returns
A full friendly URL relative to the server, not including the page name.
Code Example
<!--$ssGetServerRelativePath("siteId" , "nodeId")-->
This script extension can be used to obtain the urlPageName for a specified node.
Parameters
siteId
: The unique identifier for the Web site.
nodeId
: A unique identifier for a node.
Returns
The urlPageName of the node. Usually this is index.htm.
Code Example
<!--$ssGetUrlPageName("siteId")-->
Description
This script extension can be used to obtain the label for a specified node.
Parameters
siteId
: The unique identifier for the Web site.
nodeId
: A unique identifier for a node.
Returns
The label of the specified node.
Code Example
<!--$ssGetNodeLabel("siteId" , "nodeId")-->
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
siteId
: The unique identifier for the Web site.
nodeId
: A unique identifier for a node.
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")-->
Description
This script extension can be used to generate a ResultSet containing a list of all available Web sites.
Parameters
resultSetName
: the name for the generated ResultSet.
Returns
The list of all available Web sites on the server is returned in a ResultSet.
Code Example
<!--$ssGetServerRelativePath("resultSetName")-->
Description
This script extension is used to generate a path-based URL to a named document. This is deprecated in preference of wcmUrl
(see "wcmUrl").
For more information, see "Using Server-Side Script Links".
Parameters
dDocName
: the dDocName of the managed item.
targetNodeId
: a unique identifier for a node to use as the target context (optional).
targetSiteId
: the unique identifier for the Web site to use as the target context (optional).
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")-->
Description
This script extension is used to generate a path-based URL to a specified node. This is deprecated in preference of wcmUrl
(see "wcmUrl").
For more information, see "Using Server-Side Script Links".
Parameters
nodeId
: A unique identifier for a node.
siteId
: A unique identifier for the Web site containing the node (optional).
Returns
The friendly link to the primary (or landing) page of a node.
Code Example
<!--$ssNodeLink("nodeId" , "siteId")--> <!--$ssNodeLink("nodeId")-->
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 "wcmUrl").
For more information, see "Using Server-Side Script Links".
Parameters
targetId
: Either the path to a file or the dDocName value of the file.
Returns
A path-based weblayout URL.
Code Example
<!--$ssWeblayoutUrl('mydocname')--> <!--$ssWeblayoutUrl('groups/public/documents/adacct/mydocname.jpg')-->