Document Tree
Document Properties
Kbid
2474P9
Last Modified
04-Feb-2020
Added to KB
20-Jun-2013
Public Access
Everyone
Status
Online
Doc Type
References
Product
  • ICM 7.10
  • ICM 11
  • ICM 12
ISML Tag - ISBINARY
NameISBINARY

Short Description

defines templates for binary pipeline output

Table of Contents

Product Version

6.5

Product To Version

 

Status

Introduction

The <ISBINARY> tag allows you to define templates that generate binary pipeline output. This makes it possible, for example, to return PDF documents or image files as pipeline result.
In a template, the <ISBINARY> tag can only be combined with tags that affect the HTTP header, such as <ISCONTENT> and <ISCACHE> . All text content is ignored.

Note

The ISML designer is responsible, to set the correct <ISCONTENT> MIME type in a template using <ISBINARY>.

Syntax

<isbinary
(
file = "( {String} | {ISML expression} )" |
stream = "{ISML expression}" |
resource = "( {String} | {ISML expression} )" |
byte = "{ISML expression}"
)
[ downloadname = "( {String} | {ISML expression} )" ]
>

Example

The following sample reads the content from a pdf file and sends it as response:

<ISBINARY file="d:/foobar.pdf"/>

The next sample reads the content from an InputStream and sends it as response:

<ISBINARY stream="#aStreamObject#"/>

The next sample reads the content from a resource found in the classpath and sends it as response:

<ISBINARY resource="com/intershop/beehive/core/dbinit/internal/icon.gif"/>

Finally, the sample below sends a byte array as response, e.g. can be read from a persistent object (blob):

<ISBINARY bytes="#MyObject:bytes#"/>

Next, a complete ISML template example is shown. The template returns a PDF documents which is read from the file foobar.pdf. Note that the content is made cacheable.

<ISCONTENT type="application/pdf">
<ISCACHE type="relative" hour="24">
<ISBINARY file="D:/foobar.pdf"/>

If the optional "downloadname" attribute is set, a header like:

response.setHeader("Content-Disposition", "attachment; filename=\""downloadname"\"");

is generated into the JSP code. The header is used to force the browser to display a file download dialog with the given download file name.

Note

Make sure that the content type is set to something different than "text/html" or "image/gif" (e.g. <iscontent type="application/octet-stream">) because some browsers first evaluate the content type and display the content instead of offering a download dialog as desired.

Typically, templates generating binary pipeline output are included in other templates. For example, assume the snippet above defines a template referenced by the interaction end node of the pipeline BinaryOutput-PDF. In a different template, you can then create a link to the document foobar.pdf by calling the pipeline as shown below:

<iscontent type = "text/html">
This is text
<a href="#URL(Action('BinaryOutput-PDF'))#">View the foobar.pdf file</a>
This is text

Attributes

One of the following attributes is required.

file

file = filename | ISML expression

Specifies a filename referencing a binary file, e.g. an image, to be read and sent as response.

stream

stream = ISML expression

Specifies a java.io.InputStream object to be read and sent as response.

resource

resource = string | ISML expression

Specifies a binary resource found in the classpath, e.g., com/intershop/beehive/core/dbinit/internal/icon.gif.

bytes

bytes = ISML expression

Specifies a bytes array (bytes) object containing binary content to be read and sent as response.

Reference - ISML Tags

Disclaimer
The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.
The Intershop Knowledge Portal uses only technically necessary cookies. We do not track visitors or have visitors tracked by 3rd parties. Please find further information on privacy in the Intershop Privacy Policy and Legal Notice.
Home
Knowledge Base
Product Releases
Log on to continue
This Knowledge Base document is reserved for registered customers.
Log on with your Intershop Entra ID to continue.
Write an email to supportadmin@intershop.de if you experience login issues,
or if you want to register as customer.