#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package BookPub::Help::Command::DownloadSalesFileGuide;
use strict;
use warnings;

use lib '/app/tools/bookpub/lib';
use base 'BookPub::Command';
use BookPub::App;

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

sub cmd  { return 'sales_file_guide'; }
sub area { return 'help'; }

use constant kPath => "/app/tools/bookpub/docs/help/bookpub_sales_file_guide.pdf";

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

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

    my $fullPath       = kPath;
    my $prettyFileName = 'Sales File Management Process for eBooks.pdf';

    my $fh = new IO::Handle;
    open( $fh, "$fullPath" ) or die "ERROR: Unable to open $fullPath for reading: $!";

    my $contentType = 'application/octet-stream';

    $response = RSApache::Response::Download->new( $fh, $contentType, $prettyFileName );
    return $response;
}

1;
