Home > Contents > Index >
Generates a valid URL to an asset, rendered through a template, with optional wrapper page support. User-defined arguments will be packed if wrapperpage is specified. A vanity URL will be used if available.
<RENDER.GETTEMPLATEURL [ADDSESSION="true|false"] [ASSEMBLER="uri assembler shortform"] [AUTHORITY="authority value"] [C="asset type"] [CID="asset id"] [CONTAINER="servlet|portlet"] [CONTEXT="context override"] [d="Device Group Suffix"] [resolvetemplatefordevice="A boolean value indicating whether parameter 'd' should be ignored or not."] [DEPTYPE="exists|none"] [DYNAMIC="true|false"] [FRAGMENT="fragment value"] OUTSTR="theURLVariable" [PACKEDARGS="stringFromPACKARGStag"] [SATELLITE="true|false"] [SCHEME="scheme value"] SITE="site name" SLOTNAME="name of slot" TID="caller Template or CSElement id" [TNAME="target Template or CSElement name"] [TTYPE="caller Template or CSElement"] [WRAPPERPAGE="name of uncached wrapper page"] [WEBROOTNAME="webroot%quot;] /> </RENDER.GETTEMPLATEURL>
addsession
(optional)true
means to encode session IDs in the URL. If this parameter is not specified, it is set to true
by default.
assembler
(optional)
authority
(optional, required if scheme is set) scheme
. URLs are of the form scheme://authority/path?query#fragment
. For most purposes, authority corresponds to host:port
for the given application. Specifying scheme
and authority
allows for fully-qualified URLs to be created, which is useful for sites with multiple domains and in other cases.c
(optional, required for explicit mode)c
, cid
, and tname
are set, then context
data is ignored. cid
(optional, required for explicit mode)c
, cid
, and tname
are set, then context
data is ignored. container
(optional)servlet
should be sufficient. Legal values are servlet
and portlet
. context
(optional, required for context mode)c
, cid
, and tname
are not specified, then this attribute value will be examined to determine which template will be used and which asset for which a URL will be generated. If this value is not specified, then an ICS variable of the same name will be examined for the same purpose. If no context
value can be located, then the URL will not be generated, and this tag will do nothing. Future versions of Sites will provide an interface that allows the context
data to be set automatically. Manually overriding this value should be considered an advanced technique.d
(optional)resolvetemplatefordevice
(optional)deptype
(optional)exists
, or none
. exists
(default) specifies that any version of the asset satisfies the dependency condition; none
specifies no approval dependency on the asset.
dynamic
(optional)true
means to create a dynamic URL even if rendermode
is set to export
. false
means to create a static URL if rendermode
is set to export
. If this parameter is not specified, it is set to false
by default.
fragment
(optional)http://www.myhost.com/foo.html#thirdParagraph
.
outstr
(required)packedargs
(optional)satellite
(optional) true
(Satellite Server URL) and false
(Sites URL).
scheme
(optional, required if authority is set)http
or https
. If this is left blank (and authority
is left blank) then the URL will be relative to the current scheme and authority. site
(required)slotname
(required)slotname
attribute.tid
(required) ttype
should be set to CSElement
. tname
(optional, required for explicit mode)c
and cid
are set. If these three attributes are not set, the called template will be determined by looking at context
data. ttype
(optional)Template
or a CSElement
. The default value is Template
, and CSElement
is the other legal value. See tid
. wrapperpage
(optional)packedargs
. Such arguments will need to be unpacked before accessing. Standard arguments such as c
, cid
, and p
will be preserved and not packed.webrootname
(optional)This tag is the preferred method for generating a URL to an asset (provided that the asset is being rendered through a Template, which is the recommendation). It effectively replaces RENDER.GETPAGEURL
in most (but certainly not all) cases.
Instances of this tag must contain information about who the caller is in order to operate correctly. The caller must be either another Template or a CSElement. This tag will not operate correctly without valid information about the caller. (see tid
& ttype
above).
RENDER.GETTEMPLATEURL
operates in two modes: explicit mode and context mode.
In explicit mode, c
, cid
, and tname
are explicitly specified as attributes to the tag. In essence, the asset identified by c
and cid
will be the subject of the URL along with the template named tname
. If tname starts with "/
" then the typeless template corresponding to tname
will be used. Otherwise, the template corresponding to the specified tname
and asset type ("c
") will be called. Usually, the template name will correspond to a typeless layout template, which will dispatch to typed templates to render the actual asset. Explicit mode is the only mode that is currently supported.
In context mode, the context
attribute (which defaults to an ICS variable of the same name if not present) will be examined to determine the template and asset to paired in the URL. Context mode support is not currently enabled in the Sites interface, however future versions may include it.
The possible values of errno
include:
Value |
Description |
---|---|
-10004 |
A required parameter is missing . |
The following example is in JSP, but the XML syntax is analogous. The following example is the entire content of the FirstSite Mark II Product_C Link template. It constructs a URL back to the specified product through an uncached wrapper and a layout template.
In this tag, most of the attribute values are set from other variables in the variable space, either because they have been passed in, or because they have been explicitly looked up. The following table describes the origin of the ICS variables referenced below.
Variable name | Origin |
---|---|
site | The site variable is set as a resarg in all of the templates and SiteEntry assets. As such, it can be expected to be set correctly to the name of the current site. |
tid | The tid variable is set in the resargs of the called template. Because this code is in a Template, the tid attribute is set to the value of the tid variable. If this code had been located in a CSElement, this attribute would have been set to the value of the eid variable and the ttype attribute would also have been set to CSElement . See above for details. |
c | The c variable is specified on the URL and is passed unchanged into the Layout template. |
cid | The cid variable is specified on the URL and is passed unchanged into the Layout template. |
<%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld" %><%@ taglib prefix="ics" uri="futuretense_cs/ics.tld" %><%@ taglib prefix="render" uri="futuretense_cs/render.tld" %><%@ taglib prefix="string" uri="futuretense_cs/string.tld" %><%@ taglib prefix="assetset" uri="futuretense_cs/assetset.tld"%><cs:ftcs> <%-- Record a compositional dependency for the template so that pagelets generated by this template are managed properly --%> <ics:if condition='<%=ics.GetVar("tid")!=null%>'> <ics:then> <render:logdep cid='<%=ics.GetVar("tid")%>' c="Template"/> </ics:then> </ics:if> <%-- Create an assetset so we can retrieve values from this asset for use in the link --%> <assetset:setasset name="ProductSet" type='<%=ics.GetVar("c")%>' id='<%=ics.GetVar("cid")%>' /> <%-- Look up the attribute type name (we know it is Product_A but for replication support we must look it up --%> <render:lookup key="ProductAttrType" varname="ProductAttrType" site='<%=ics.GetVar("site")%>' tid='<%=ics.GetVar("tid")%>'/> <%-- Look up the name of the name attribute (we know it is "name" but for replication support we must look it up --%> <render:lookup key="NameAttrName" match=":x" varname="NameAttrName" site='<%=ics.GetVar("site")%>' tid='<%=ics.GetVar("tid")%>'/> <%-- Retrieve the name of the product --%> <assetset:getattributevalues name="ProductSet" attribute='<%=ics.GetVar("NameAttrName")%>' listvarname="NameList" typename='<%=ics.GetVar("ProductAttrType")%>' /> <%-- Look up the name of the layout template and of the wrapper SiteEntry --%> <render:lookup site='<%=ics.GetVar("site")%>' varname="LayoutVar" key="Layout" tid='<%=ics.GetVar("tid")%>'/> <render:lookup site='<%=ics.GetVar("site")%>' varname="WrapperVar" key="Wrapper" tid='<%=ics.GetVar("tid")%>' match=":x"/> <%-- Construct a standard URL for this product. The layout template will dispatch to the typed tempmlate that will render this product in its detailed view. --%> <render:gettemplateurl outstr="aUrl" tid='<%=ics.GetVar("tid")%>' slotname="Product_CLink" site='<%=ics.GetVar("site")%>' c='<%=ics.GetVar("c")%>' cid='<%=ics.GetVar("cid")%>' tname='<%=ics.GetVar("LayoutVar")%>' wrapperpage='<%=ics.GetVar("WrapperVar")%>' > </render:gettemplateurl> <%-- Render the link. Be sure to stream the name and URL using the render:stream tag in order to ensure xhtml-compliance of the response --%> <a href='<string:stream variable="aUrl"/>'> <string:stream list='NameList' column="value" /> </a> </cs:ftcs>
Home > | Contents > | Index > | ||
Oracle XML Tag Reference |