OpenAPI 1.0

com.aquafold.openapi
Interface AQResponse


public interface AQResponse

An instance of this interface is available to the script via aqua.response alias. An HTML output constructed by writing to this object will be inserted into a web page serviced by the script.


Method Summary
 void addMetaTag(String name, String value)
          Sets the value of META tag.
 void addMetaTagHttpEquiv(String name, String value)
          Sets the value of META HTTP-EQUIV tag.
 void clearMetaTags()
          Clears previously set meta tags.
 String getContentType()
          Returns HTTP response content type.
 AQDashboard getDashboard()
          Returns the Dashboard object when a script is executed within the Aqua Data Server environment.
 String getHeader(String name)
          Returns the value of the specified HTTP response header.
 String getStatus()
          Returns HTTP response status code.
 String getTitle()
          Returns the value of TITLE tag.
 void redirect(String uri)
          Redirects the browser to the specified URI.
 void sendBinary(String contentType, String filename, byte[] data)
          Sends binary data with the specified content type.
 void setContentType(String contentType)
          Sets HTTP response content type.
 void setHeader(String name, String value)
          Sets HTTP response header.
 void setTitle(String title)
          Sets the TITLE tag for HTML responses.
 AQResponse write(Object x)
          Writes a string returned by the object's toString() method to the HTML response.
 AQResponse writeImageLink(String path)
          Writes an image hyperlink.
 AQResponse writeLink(String text, String url)
          Writes a hyperlink.
 AQResponse writeText(String text)
          Writes a sanitized string to the HTML response.
 

Method Detail

write

AQResponse write(Object x)
Writes a string returned by the object's toString() method to the HTML response. The characters are written as is.

Parameters:
x -

writeText

AQResponse writeText(String text)
Writes a sanitized string to the HTML response. Any symbols that are used to represent HTML syntax will be escaped so as not to affect the HTML rendering in the browser.

Parameters:
text - Text string to write.

writeLink

AQResponse writeLink(String text,
                     String url)
Writes a hyperlink.

Parameters:
text - User-visible text.
url - Link URL.

writeImageLink

AQResponse writeImageLink(String path)
Writes an image hyperlink.

Parameters:
path - Absolute image file path.

sendBinary

void sendBinary(String contentType,
                String filename,
                byte[] data)
Sends binary data with the specified content type. Any text string accumulated so far is discarded. This method can be called only once.

Parameters:
contentType - HTTP Content type string. Example: "image/png"
filename - Attachment file name. A non-null parameter will trigger "Save As" dialog in the browser instead of simply rendering a resource in a window.
data - Binary data.

redirect

void redirect(String uri)
Redirects the browser to the specified URI.

Parameters:
uri - Resource URI.

getDashboard

AQDashboard getDashboard()
Returns the Dashboard object when a script is executed within the Aqua Data Server environment.


setHeader

void setHeader(String name,
               String value)
Sets HTTP response header.

Parameters:
name -
value -

getHeader

String getHeader(String name)
Returns the value of the specified HTTP response header.

Parameters:
name -

setContentType

void setContentType(String contentType)
Sets HTTP response content type.

Parameters:
contentType -

getContentType

String getContentType()
Returns HTTP response content type.


getStatus

String getStatus()
Returns HTTP response status code.


setTitle

void setTitle(String title)
Sets the TITLE tag for HTML responses. The value of title will be ignored if a response is binary.

Parameters:
title - Title string.

getTitle

String getTitle()
Returns the value of TITLE tag.


addMetaTag

void addMetaTag(String name,
                String value)
Sets the value of META tag. This method applies only to HTML responses.

Parameters:
name - ASCII tag name.
value - Meta tag value string.

addMetaTagHttpEquiv

void addMetaTagHttpEquiv(String name,
                         String value)
Sets the value of META HTTP-EQUIV tag. This method applies only to HTML responses.

Parameters:
name - ASCII tag name.
value - Meta tag value string.

clearMetaTags

void clearMetaTags()
Clears previously set meta tags.


OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.