#---------------------------------------------------------------
# ____                   _ _         ____  _
#|  _ \ ___  _   _  __ _| | |_ _   _/ ___|| |__   __ _ _ __ ___
#| |_) / _ \| | | |/ _` | | __| | | \___ \| '_ \ / _` | '__/ _ \
#|  _ < (_) | |_| | (_| | | |_| |_| |___) | | | | (_| | | |  __/
#|_| \_\___/ \__, |\__,_|_|\__|\__, |____/|_| |_|\__,_|_|  \___|
#            |___/             |___/
#
# Copyright (C) 2009 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#---------------------------------------------------------------
package BookPub::Catalog::Command::SearchBookSubject;
use strict;
use warnings;

use lib '/app/tools/common/lib';
use RSApache::Response::XML;

use lib '/app/tools/bookpub/lib';
use BookPub::Catalog::BISACSubjectList;
use BookPub::XMLCommand;
use base 'BookPub::XMLCommand';

sub cmd  { return 'search_book_subject'; }
sub area { return 'catalog'; }

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

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

    my $query = $self->getParam('query');
    my $limit = $self->getParam('limit');

    my $list = BookPub::Catalog::BISACSubjectList->new( query => $query, limit => $limit );

    $response = RSApache::Response::XML->new($list);

    return $response;
}

1;
