#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
#------------------------------------------------------------
package Support::SaleFileExplorer::Command::Main;
use strict;
use warnings;

use lib '/app/tools/support/lib';
use base 'Support::Command::Submit';
use Support::SaleFileExplorer::PeriodList;

use lib '/app/tools/common/lib';

use RSApache::Response::XSLT;

sub cmd  { return 'main'; }
sub area { return 'sale_file_explorer'; }

use constant kTemplate => "/app/tools/support/templates/sale_file_explorer/main.xsl";

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

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

    # !!! I think that eventually this command will take an optional
    # 'anchor' parameter, which will be used to filter results.
    # But to start, we'll just show all periods, and let this
    # thing build dynamically.
    #
    $self->{xml}{Periods} = Support::SaleFileExplorer::PeriodList->new();

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

    return $response;
}

1;
