Home > Contents > Index >
Template Tags TOC | Alpha TOC | Tag Family TOC | Purpose TOC | Annotated TOC | Index
render:getbloburl
Creates a BlobServer URL without embedding it in an HTML tag. A vanity URL will be used if available.
Syntax
<render:getbloburl outstr="VariableName
" [blobtable="blobTable
"] [blobkey="primaryKeyName
"] [blobwhere="primaryKeyValue
"] [blobcol="column name
"] [c="asset type
"] [cid="asset id
"] [asset="asset instance name
"] [field="asset field name
"] [blobheader="MIMEtype
"] [blobnocache="false
"] [addsession="true
"] [dynamic="true
"] [csblobid="session variable value"] [assembler="uri assembler shortform"] [container="servlet|portlet"] [fragment="fragment value"] [parentid="parent to log this blob as a dependency"] [satellite="true|false"] [scheme="scheme value"] [authority="authority value"] [preferredfile="filename"] [preferreddir="path"] [webrootname="webroot%quot;] > [<render:argument name="argname
" value="argvalue
"/>] [<render:argument name="blobheadernameN
" value="argvalue
"/>] [<render:argument name="blobheadervalueN
" value="argvalue
"/>] </render:getbloburl>Attributes
outstr
(required)- Input. Name of the variable that stores the URL generated by this tag.
blobtable
(optional)- Input. Name of the Sites table that stores assets of this type. For example,
blobtable="ImageFile"
.blobkey
(required, if blobtable set)- Input. Name of the column used as the primary key. Typically this is
id
.blobwhere
(required, if blobtable set)- Input. Object ID of the asset.
blobcol
(required, if blobtable set)- Input. Name of the column that contains the binary data. For example, for the imagefile asset type,
blobcol="urlpicture"
.field
(required, if blobtable not set)- Input. The name of an asset field containing binary data to be served.
asset
(optional)- Input. Name of an asset instance.
c
(required, if asset and blobtable not set)- Input. An asset type name. Automatically logs dependency for blob against the asset when specified with
cid
.cid
(required, if asset and blobtable not set)- Input. An asset identifier. Automatically logs dependency for blob against the asset when specified with
c
.blobheader
(optional)- Input. Mimetype for returned data, in the form
description/extension
. For example, the mimetype for a GIF image isimage/gif
.blobnocache
(optional)- Input. Specifies whether to disable blob caching. A value of
true
prevents the blob and the header from being cached.addsession
(optional)- Input. Specifies whether to include session IDs in the URL when a browser is set to reject cookies.
true
means to encode session IDs in the URL. If this parameter is not specified, it is set totrue
by default.dynamic
(optional)- Input. Specifies whether to create a static or a dynamic URL for the asset when the page is being rendered by the Export to Disk publishing method.
true
means to create a dynamic URL even ifrendermode
is set toexport
.false
means to create a static URL if rendermode is set toexport
. If this parameter is not specified, it is set tofalse
by default.csblobid
(optional)- Value of this parameter must correspond to a session variable of the same name when BlobServer security is on. When a request is made to the BlobServer, the
img src
service parameter sends a new request to the application server after the browser reads the containing page. BlobServer then verifies if thecsblobid
parameter was set. When BlobServer security is set to true and thecsblobid
value matches the session variable value, the blob is served. If the values do not match, a security violation is reported and no blob is servedassembler
(optional)- Short form name for uri assembler class. Specifying an assembler overrides the default assembler used by Sites to construct URLs. Omitting this value will cause URLs generated by this tag to use the assembler registered with the highest priority in the request property file.
container
(optional)- Override attribute that specifies whether the URL will be generated for a servlet container or a portlet container. By default, the current container will be used. For practical purposes, leaving this blank or setting it to
servlet
should be sufficient. Legal values areservlet
andportlet
.fragment
(optional)- Optional attribute to specify a fragment on the URL. Fragments, sometimes known as anchors, allow browsers to advance to a specific location in a single web page. ex.
http://www.myhost.com/foo.html#thirdParagraph
.parentid (optional)
- The id against which this blob should be logged as a dependency. When a blob is cached, an item dependency can be recorded against the cache key to provide a content-based identifier for accessing the cached blob. When coupled with an asset identifier, this can allow blobs to be flushed when an asset is updated. Valid syntax is
asset-
assetid:
assettype. This parameter also supports a comma-separated list of parentids. For example, asset-35739459345:Media_Csatellite
(optional)- Override attribute that forces the URL generated to be a URL for either Satellite Server or Sites. By default, the URL will automatically be set to whatever the containing page is set to. Legal values are
true
(Satellite Server URL) andfalse
(Sites URL).scheme
(optional, required if authority is set)- Attribute that allows the scheme to be set in the URL. The scheme in the case of most URLs refers to the protocol and is usually set to either
http
orhttps
. If this is left blank (andauthority
is left blank) then the URL will be relative to the current scheme and authority.authority
(optional, required if scheme is set)- Attribute that allows the user to specify a fully-qualified URL, when used in conjunction with
scheme
. URLs are of the formscheme://authority/path?query#fragment
. For most purposes, authority corresponds tohost:port
for the given application. Specifyingscheme
andauthority
allows for fully-qualified URLs to be created, which is useful for sites with multiple domains and in other cases.preferredfile
(optional)- Attribute to specify a preferred filename. Only used for static publishing.
preferreddir
(optional)- Attribute to specify the preferred directory path. Only used for static publishing.
webrootname
(optional)- Name of WebRoot to be used for retrieving vanity URL.
Parameters
render:argument (optional)
- Input. Name/value modifiers for the blob. Special values to
render:argument
include:
blobheadernameN
(optional)- Specifies HTTP header variables to suit your needs, The
blobheadername
parameter is used in conjunction with theblobheadervalue
parameter to produce name/value pairs. This parameter represents the variable name.blobheadervalueN
(optional)- Used in conjunction with
blobheadername
to specify and represent HTTP header variable values.Description
This tag creates a BlobServer URL.
If rendermode is set to
export,
the tag creates a static URL; that is, a file name for an HTML file. It creates the URL based on the parameters described in the following section. These are a set of arguments that specify the table the blob is stored in, the name of the column that contains the binary data, the name of the primary key of the table, the value in that column to use to identify the object, and so on.If
rendermode
is set tolive
, the tag creates a dynamic URL according to the current assembler.Based on this information,
render:getbloburl
creates a URL for the blob asset and returns it to the element that requested it in a variable specified by theoutstr
parameter. The requesting element can then use the variable in an HTML tag to create the link.To create BlobServer URL embedded in an HTML tag, use the render:satelliteblob tag.
You can use the
blobheadername
andblobheadervalue
arguments to specify http headers in the BlobServer response. For example, you can specify the content-type as follows:blobheadername1="Content-Type" blobheadervalue1="image/gif"If you want to use http headers to prevent browser caching of BlobServer requests for all browsers, use both HTTP 1.0 and HTTP 1.0 cache control directives. In the following example, the first header (Cache-Control:no-cache) is the HTTP 1.1 directive and the second header (Pragma:no-cache) is the HTTP 1.0 directive.
blobheadername1="Cache-Control" blobheadervalue1="no-cache" blobheadername2="Pragma" blobheadervalue2="no-cache"NOTE: The table name containing the blob, the primary key of the table, the id of the table row, and the column name that contains the binary data are all optional parameters. The same information can be provided to this tag by specifying an asset type, id and field name, or an asset instance object name and field name. However, there is an advantage to using the latter forms. If the owning asset is changed, Blob Server will invalidate the cached blob, but only if it was served via one of the asset forms of the render:getbloburl tag.
Error Numbers
There are no possible
errno
for this tag.Examples
This code creates a BlobServer URL for an ImageFile asset identified through an ID passed in with
blobwhere='<%=ics.GetVar("asset:id")%>'
and stores it in a variable named "theURL
":<render:getbloburl blobtable="ImageFile" blobcol="urlpicture" blobheader='<%=ics.GetVar("asset:mimetype")%>' blobkey="id" blobwhere='<%=ics.GetVar("asset:id")%>' outstr="theURL"/>This code does the same for a basic asset and logs the dependency for the blob against the asset so that when the corresponding ImageFile asset is modified the blob is also flushed:
<render:getbloburl c="ImageFile" field="urlpicture" blobheader='<%=ics.GetVar("asset:mimetype")%>' cid='<%=ics.GetVar("asset:id")%>' outstr="theURL"/>This code does the same for a flex asset and logs the dependency for the blob against the asset so that when the corresponding Media_C asset is modified the blob is also flushed:
<render:getbloburl c="Media_C" field="FSII_ImageFile" blobheader='<%=ics.GetVar("asset:mimetype")%>' cid='<%=ics.GetVar("asset:id")%>' outstr="theURL"/>This code does the same, except uses an already-loaded ImageFile asset instead:
<asset:load name="myasset" type="ImageFile" objectid='<%=ics.GetVar("asset:id")%>'/> <render:getbloburl asset="myasset" field="urlpicture" blobheader='<%=ics.GetVar("asset:mimetype")%>' outstr="theURL"/>It is recommended to use parameters
blobtable
,blobkey
,blobcol
, andblobwhere
when creating the url instead ofc
andcid
. Also log the blob dependency usingparentid
attribute.See Also
render:satelliteblob
render:packargs
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.