#------------------------------------------------------------
# Copyright (C) 2010 RoyaltyShare, Inc.   All Rights Reserved
#------------------------------------------------------------
package BookPub::Dashboard::Command::AjaxHello;

use strict;
use warnings;

use lib '/app/tools/bookpub/lib';
use BookPub::Dashboard::Module::HelloAjax;

use lib '/app/tools/common/lib';
use RSApache::Response::XSLT;
use base 'RSApache::Command::XMLCommand';

sub cmd  { 'helloajax' }
sub area { 'dashboard' }

use constant kTemplate => "/app/tools/bookpub/templates/dashboard/ajaxhello.xsl";

sub execute {
    my ($self) = @_;

    my $response = $self->SUPER::execute();

    unless ($response) {
        my $form = BookPub::Dashboard::Module::HelloAjax->new();

        $self->{xml}{Form} = $form;
        $response = RSApache::Response::XSLT->new( $self->{xml}, kTemplate );
    }

    return $response;
}

1;
