#---------------------------------------------------------------
# ____                   _ _         ____  _
#|  _ \ ___  _   _  __ _| | |_ _   _/ ___|| |__   __ _ _ __ ___
#| |_) / _ \| | | |/ _` | | __| | | \___ \| '_ \ / _` | '__/ _ \
#|  _ < (_) | |_| | (_| | | |_| |_| |___) | | | | (_| | | |  __/
#|_| \_\___/ \__, |\__,_|_|\__|\__, |____/|_| |_|\__,_|_|  \___|
#            |___/             |___/
#
# Copyright (C) 2009 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#---------------------------------------------------------------
package BookPub::Catalog::ContributorList;
use strict;
use warnings;

use lib '/app/tools/common/lib';
use Common::Assert;
use lib '/app/tools/bookpub/lib';
use BookPub::DB::Item::Contributor;
use BookPub::Catalog::Contributor;

use base 'Common::FormObject::List::NumericPaged';

sub _itemName { return 'Contributor'; }

sub _getCollection {
    my ( $self, %args ) = @_;

    my $currentPage = $args{currentPage};
    $currentPage = 1 unless $currentPage;

    my $collection = BookPub::DB::Item::Contributor->GetAllSortedByNameInverted();
    return $collection;
}

sub _getObj {
    my ( $self, $dbItem ) = @_;
    assert($dbItem);

    return BookPub::Catalog::Contributor->new( dbItem => $dbItem, readOnly => 1 );
}

1;
