package RSApache::Response::Ajax;

use strict;
use warnings;

use Apache2::Const qw(OK);

use lib '/app/tools/common/lib';
use Common::WriteXML;
use Common::Assert;

use RSApache::Response;
use base 'RSApache::Response';

use Data::Dumper;

sub _init {
    my ( $self, $xmlHash ) = @_;
    assert( defined $xmlHash );

    $self->{xml} = Common::WriteXML::GetXMLString($xmlHash);
}

sub respond {
    my ( $self, $apache ) = @_;

    $apache->content_type("application/xml");
    $apache->send_http_header();
    print $self->{xml} . "\n";

    return OK;
}

###
1;    # Play nicely.
###
