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

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

use lib '/app/tools/admin/lib';
use Admin::Permission::Form;
use Admin::Command;
use base 'Admin::Command';

use Data::Dumper;

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

sub cmd  { return "show"; }
sub area { return "jobqueue"; }

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 $jobAgeFilter = $self->getParam('age');

    $jobAgeFilter = 0 unless $jobAgeFilter;

    $self->{xml}{MaxJobAge} = $jobAgeFilter;

    # I think all we'll do at first is just render the page.
    #
    # We may add static XML elements as we go, but for the most part
    # I think we'll be using ajax.
    #
    $response = RSApache::Response::XSLT->new( $self->{xml}, kTemplate );

    return $response;
}

1;

