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

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

use lib '/app/tools/rps/lib';
use RPS::Mechanical::US::MechanicalRun;
use RPS::Payor::Payor;
use RPS::DB::Item::MechanicalRun;
use RPS::Mechanical::Command::Show;
use base 'RPS::Mechanical::Command::Show';


sub cmd  { return 'show'; }
sub area { return 'mechanical'; }

sub _template { return "/app/tools/rps/templates/mechanical/show.xsl"; }
sub _textTemplate { return "/app/tools/rps/templates/mechanical/text/show.xsl"; }

sub _getRunXML
{
    my ($self, $runID, $payorID, $filterBy) = @_;
	return RPS::Mechanical::US::MechanicalRun->new
    (
        mechanicalRunID => $runID, 
        payorID => $payorID, 
        filterBy => $filterBy,
    );
}

sub _getRunDBItem
{
    my ($self, $runID) = @_;
    return RPS::DB::Item::MechanicalRun->Lookup(mechanical_run_id => $runID);
}

sub _getRunLabel
{
    my ($self, $run) = @_;
    return RPS::Mechanical::US::MechanicalRun::GenerateFileLabel($run->label);
}

1;
