TROIKA.ASP - the MVC framework

ResponseAdapter.js

Summary

Contains ResponseAdapter class.

This is part of Troika.ASP Framework - web development MVC framework for ASP 3.0. Please visit www.troika-asp.com for more details.



Version: $Revision: 1.4 $

Author: Pavel Chuchev pav@troika-asp.com


Class Summary
ResponseAdapter This class adapts the native ASP Response object to Troika.ASP Response object.

/**
* @fileoverview Contains <tt>ResponseAdapter</tt> class.
*
* <p>
* This is part of Troika.ASP Framework - web development MVC framework for ASP 3.0.
* Please visit {@link http://www.troika-asp.com www.troika-asp.com} for more details.
* </p>
*
* @author Pavel Chuchev pav@troika-asp.com
* @version $Revision: 1.4 $
*/
/**
* Constructs a new instance of <tt>ResponseAdapter</tt> class.
*
* @class This class adapts the native ASP Response object to Troika.ASP Response object.
*
* @constructor
*/
function ResponseAdapter() {

}
/**
* Redirects the user to a different URL.
*
* @param {String} path The new URL.
*/
ResponseAdapter.prototype.redirect = function (path) {

    Response.Redirect(path);
};
/**
* Writes a specified string to the output.
*
* @param {String} str The string to write.
*/
ResponseAdapter.prototype.write = function (str) {

    Response.Write(str);
};
/**
* Adds a new HTTP header and a value to the HTTP response.
*
* @param {String} name The name of the new header variable.
* @param {String} value The initial value of the new header variable.
*/
ResponseAdapter.prototype.addHeader = function (name, value) {

    Response.AddHeader(name, value);
};
/**
* Appends the name of a character-set to the content-type header in the Response object.
* Default character set is ISO-LATIN-1
*
* @param {String} value The string that specifies a character set for the page.
*/
ResponseAdapter.prototype.setCharset = function (value) {

    Response.Charset = value;
};
/**
* Sets the HTTP content type for the response object.
*
* @param {String} value The string describing the content type.
*/
ResponseAdapter.prototype.setContentType = function (value) {

    Response.ContentType = value;
};
/**
* Specifies the value of the status line returned by the server.
*
* @param {String} value The three-digit number and a description of that code, like 404 Not Found.
*/
ResponseAdapter.prototype.setStatus = function (value) {

    Response.Status = value;
};
/**
* Writes data directly to the output without any character conversion.
*
* @param {String} data The binary information to be sent.
*/
ResponseAdapter.prototype.binaryWrite = function (data) {

    Response.BinaryWrite(data);
};
/**
* Sends buffered HTML output immediately.
*/
ResponseAdapter.prototype.flush = function () {

    Response.Flush();
};
/**
* Sets a cookie value. If the cookie does not exist, it will be created, and take the value that is specified.
*
* @param {String} name The name of the cookie.
* @param {String} value The cookie value.
* @param {String} expires The date when the cookie expires. If no date is specified, the cookie will expire when the session ends.
* @param {String} domain The cookie is sent only to requests to this domain.
* @param {String} path If set, the cookie is sent only to requests to this path. If not set, the application path is used.
*/
ResponseAdapter.prototype.setCookie = function (name, value, expires, domain, path) {

    Response.Cookies(name) = value;///jslint:ignore  
    if (expires) {

        Response.Cookies(name).Expires = expires;///jslint:ignore
    }

    if (domain) {

        Response.Cookies(name).Domain = domain;///jslint:ignore
    }

    if (path) {

        Response.Cookies(name).Path = path;///jslint:ignore
    }
};

TROIKA.ASP - the MVC framework

www.troika-asp.com
Documentation generated on Sun Jun 15 17:59:32 2008