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

use strict;
use warnings;

use lib '/app/tools/common/lib';
use lib '/app/tools/bookpub/lib';
use BookPub::Catalog::BookContributorList;
use BookPub::Catalog::BookSubjectList;
use BookPub::Catalog::AudienceCode;
use BookPub::Catalog::Imprint;

use Common::RSApp;
use Common::Util;
use Common::Assert;
use Common::FormObject;
use Common::DB::Item::Language;

use base 'BookPub::Catalog::Book';

# NOTE:  This class is not intended to be used for 'list displays' and other situations
# where we want to display a set of books.   Use this class when we've drilled into a
# single book, and we want to present everything about that book.

sub _initProperties {
    my ( $self, $props ) = @_;

    $self->SUPER::_initProperties($props);

    #    if ($props->{imprint_id})
    #    {
    #        $self->{Imprint} = BookPub::Catalog::Imprint->new(imprintID => $props->{imprint_id});
    #    }

    $self->{AudienceCode} = BookPub::Catalog::AudienceCode->new( audienceCodeID => $props->{audience_code_id} );

    $self->{ContributorHash} = BookPub::Catalog::BookContributorList->new( bookID => $props->{book_id} );
    $self->{SubjectHash} = BookPub::Catalog::BookSubjectList->new( bookID => $props->{book_id} );

    if ( $props->{language_code} ) {
        my $lang = Common::DB::Item::Language->Lookup( part1 => $props->{language_code} );
        $self->{LanguageName} = $lang->name();
    }

}

###
1;    #
###
