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

use lib '/app/tools/common/lib';
use lib '/app/tools/bookpub/lib';
use Common::DB::Item::OnixCode;
use Common::RSApp;
use Common::Util;
use Common::Assert;
use Common::FormObject;

use base 'Common::XMLObject';

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

    $self->SUPER::_init(%args);

    my %properties;
    if ( $args{dbItem} ) {
        $self->_propertiesFromDBItem( \%properties, $args{dbItem} );
    } else {
        $self->_propertiesFromDefaults( \%properties );
    }

    $self->_initProperties( \%properties );

    return $self;
}

sub _propertiesFromDBItem {
    my ( $self, $hrProperties, $dbItem ) = @_;

    $hrProperties->{code_list}   = $dbItem->code_list;
    $hrProperties->{code_value}  = $dbItem->code_value;
    $hrProperties->{description} = $dbItem->description;
    $hrProperties->{notes}       = $dbItem->notes;
}

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

    # Not editable...
    $self->{CodeList}    = $props->{code_list};
    $self->{CodeValue}   = $props->{code_value};
    $self->{Description} = $props->{description};
    $self->{Notes}       = $props->{notes};
}

sub _propertiesFromDefaults {
    my ( $self, $hrProperties ) = @_;
}

###
1;    #
###
