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

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

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


sub _template { assert(0, 'override this'); }
sub _getRunList
{
    my ($self) = @_;
    assert(0, 'override this');
}

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

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

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

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


1;
