#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::LabelContract::Command::Search;
use strict;
use warnings;

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

use lib '/app/tools/rps/lib';
use RPS::Payor::PayorList;

use RPS::SearchCommand;
use base 'RPS::SearchCommand';

sub cmd  { return 'search'; }
sub area { return 'label_contract'; }

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

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

    my $response = $self->SUPER::execute(
        dbClass  => 'RPS::DB::Item::LabelContract',
        xmlClass => 'RPS::LabelContract::LabelContract',
        xmlTag   => 'LabelContract',
        loadSubs => 1,
        pageSize => 30
    );
    return $response if $response;

    $self->{xml}{PayorList} = RPS::Payor::PayorList->new();

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

    return $response;
}

1;
