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

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

use lib '/app/tools/rps/lib';
use RPS::ArtistContract::ArtistContractList;
use RPS::XMLCommand;
use base 'RPS::XMLCommand';


sub cmd  { return 'search_artist_contract'; }
sub area { return 'artist_contract'; }

use constant kTemplate => "/app/tools/rps/templates/artist_contract/index.xsl";

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

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

    my $query = $self->getParam('query');
    my $limit = $self->getParam('limit');
    my $albumID = $self->getParam('album_id');
    my $trackID = $self->getParam('track_id');

    my $list = RPS::ArtistContract::ArtistContractList->new(query => $query, limit => $limit, albumID => $albumID, trackID => $trackID);

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

	return $response;
}



1;
