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

use strict;
use warnings;

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

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

sub cmd  { 'booksummary' }
sub area { 'dashboard' }

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

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

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

    unless ($response) {
        $self->{xml}{Form} = BookPub::Dashboard::Module::BookSummary->new( %{ $self->getParams() } );

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

    return $response;
}

1;
