#------------------------------------------------------------
# Copyright (C) 2009 RoyaltyShare, Inc.   All Rights Reserved
#------------------------------------------------------------
package Support::BookPub::Command::Services;
use strict;
use warnings;

use lib '/app/tools/common/lib';
use RSApache::Response::XSLT;
use Common::DB::Item::Client;

use lib '/app/tools/support/lib';
use Support::BookPub::ServiceList;

use base 'Support::Command::Submit';

sub cmd  { return 'service_settings' }
sub area { return 'bookpub'; }

use constant kTemplate => "/app/tools/support/templates/bookpub/service.xsl";

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

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

    my $list = new Support::BookPub::ServiceList();
    $self->saveOnSubmit($list);

    $list = new Support::BookPub::ServiceList() if ( $self->isSubmit );

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

1;
