#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::Publisher::BaseAgentList;


use strict;
use warnings;
use Carp;

use lib '/app/tools/common/lib';
use Common::Assert;


use lib '/app/tools/rps/lib';
use Common::FormObject;


use base 'Common::FormObject';

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

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


	$self->{Agent} = [];
	my $collection = $self->_publisherDB()->GetAllAgents();

	while ($collection->hasNext())
	{
		my $obj = $collection->next();

        my $publisherID = $self->_publisherID();
        my $agentXML =
        {
            AgentID => $obj->$publisherID,
            Name => $obj->publisher_name
        };
		push @{$self->{Agent}}, $agentXML;
	}

	return $self;
}

sub _listProperties
{
	return
	{
		Agent=> 1
	};
}



1;


