Home > Contents > Index >
Template Tags TOC   |    Alpha TOC   |    Tag Family TOC   |    Purpose TOC   |    Annotated TOC   |    Index 

 

render:satelliteblob

Retrieves a blob from a table or from the CS-Satellite cache.

Syntax

<render:satelliteblob
       [assembler="uri assembler shortform"]
       [asset="asset instance name"]
       [authority="authority value"]
       [blobcol="column name"]
       [blobheader="MIMEtype"]
       [blobkey="primaryKeyName"]
       [blobnocache="true|false"]
       [blobtable="blobTable"]
       [blobwhere="primaryKeyValue"]
       [c="asset type"]
       [cachecontrol="expirationDateAndTime"] 
       [cid="asset id"]
       [container="servlet|portlet"]
       [csblobid="session variable value"]
       [field="asset field name"]
       [fragment="fragment value"]
       [parentid="parent to log this blob as a dependency"]
       [satellite="true|false"]
       [scheme="scheme value"]
       [service="HTMLtagName"]
       />

      [<render:argument name="argname" value="argvalue"/>]

</render:satelliteblob>

Attributes

assembler (optional)
Short form name for uri assembler class. Specifying an assembler overrides the default assembler used by Content Server 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.
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 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.
service (optional)
Input. Start of the HTML tag to hold the reference to the blob. For example, if the blob is an image, use service="img src". The default value is img src.
blobtable (optional)
Input. Name of the CS-Direct 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".
blobnocache (optional)
True or false. If set to true, the blob will not be cached on either CS or SS. The default value is false.
c (required, if asset and blobtable not set)
Input. An asset type name.
cid (required, if asset and blobtable not set)
Input. An asset identifier.
asset (optional)
Input. Name of an asset instance.
field (required, if blobtable not set)
Input. The name of an asset field containing binary data to be served.
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, rather than requiring the cache key to do so. This is useful in cache management. When coupled with an asset identifier, this can allow blobs to be flushed when an asset is updated.
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 are servlet and portlet.
blobheader (required)
Mimetype for returned data, in the form description/extension. For example, the mimetype for a GIF image is image/gif.
cachecontrol (optional)
Input. Determines for how long to cache the blob. See satellite:blob for details about this parameter.
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 the csblobid parameter was set. When BlobServer security is set to true and the csblobid 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 served.
satellite (optional)
Override attribute that forces the URL generated to be a URL for either Satellite Server or Content Server. By default, the URL will automatically be set to whatever the containing page is set to. Legal values are true (Satellite Server URL) and false (Content Server 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 or https. If this is left blank (and authority is left blank) then the URL will be relative to the current scheme and authority.

Arguments

render:argument (optional)
Input. Name/value modifiers for the HTML tag.

Description

This tag is the CS-Direct equivalent of the CS-Satellite satellite:blob tag, with the following exception:

You can use the blobheadername and blobheadervalue parameters 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"

To determine how long to cache a page or pagelet, these criteria are evaluated in this order:

  1. A value passed in using the cachecontrol parameter.
  2. If there is no value in cachecontrol, the value in the satellite.blob.cachecontrol.default property, found in the futuretense.ini property file, is used.
  3. If there is no value in satellite.page.cachecontrol.default, the value of the expiration property, located in the satellite.properties property file, is used.

We recommend that the cachecontrol attribute be set for all blobs. If all blobs will have the same expiry, then consider setting the satellite.blob.cachecontrol.default property instead. Because the cache is actively managed when compositional dependencies are properly recorded, blobs can be set to never expire. This ensures that they always remain in cache, and the cache manager will ensure that they remain up-to-date..

errno

None.

Examples

This code creates an HTML <img> tag. The src attribute is the blob in the ImageFile table identified through the ID passed in with blobwhere='<%=ics.GetVar("asset:id")%>' and both its horizontal and vertical spacing are at five pixels:

<render:satelliteblob 
        blobtable="ImageFile" 
        blobkey="id" 
        blobcol="urlpicture" 
        blobwhere='<%=ics.GetVar("asset:id")%>' 
        blobheader='<%=ics.GetVar("asset:mimetype")%>' 
        service="img src">
    <render:argument name="alt" value='<%=ics.GetVar("asset:alttext")%>'/>
    <render:argument name="hspace" value="5"/>
    <render:argument name="vspace" value="5"/>
</render:satelliteblob>

This code does the same, but the cached blob will be invalidated when the corresponding ImageFile asset is changed:

<render:satelliteblob 
        c="ImageFile" 
        field="urlpicture"
        cid='<%=ics.GetVar("asset:id")%>' 
        blobheader='<%=ics.GetVar("asset:mimetype")%>' 
        service="img src">
    <render:argument name="alt" value='<%=ics.GetVar("asset:alttext")%>'/>
    <render:argument name="hspace" value="5"/>
    <render:argument name="vspace" value="5"/>
</render:satelliteblob>

This code does the same, but uses an already-loaded ImageFile asset instead:

<asset:load 
       name="myasset" 
       type="ImageFile" 
       objectid='<%=ics.GetVar("asset:id")%>'
       />
<render:satelliteblob 
        asset="myasset" 
        field="urlpicture" 
        blobheader='<%=ics.GetVar("asset:mimetype")%>' 
        service="img src">
    <render:argument name="alt" value='<%=ics.GetVar("asset:alttext")%>'/>
    <render:argument name="hspace" value="5"/>
    <render:argument name="vspace" value="5"/>
</render:satelliteblob>

See Also

satellite:blob

  Home > Contents > Index >

FatWire JSP Tag Reference
Copyright 2005,2006,2007 by FatWire Software
All rights reserved.