#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package Admin::JobLogReader::Command::Read;

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

use lib '/app/tools/admin/lib';
use Admin::JobLogReader::JobLog;
use Admin::Command;
use base 'Admin::Command';

use Data::Dumper;

use constant kTemplate => '/app/tools/admin/templates/joblog/index.xsl';

sub cmd  { return "read"; }
sub area { return "joblog"; }

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

    # Give any inherited methods the first crack at this.
    # (This checks for login and basic access permissions).
    #
    my $response = $self->SUPER::execute();
    return $response if $response;

    my $logID = $self->getParam('log_id');
    my $page  = $self->getParam('page');

    $self->{xml}{JobLog} = Admin::JobLogReader::JobLog->new( job_log_id => $logID, page => $page );

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

    return $response;
}

1;

