package APE::InputControllerFactory::ConcreteInputController::DNIND_InputController;

$APE::InputControllerFactory::ConcreteInputController::DNIND_InputController::VERSION = '0.1';

use base qw(APE::InputControllerFactory::ConcreteInputController::DefaultExoApeInputController);
use strict;
use warnings;

use APE::InputControllerFactory::Plugin::UniqueRequirementCreator;


=head1 NAME

APE::InputControllerFactory::ConcreteInputController::DNIND_InputController
- an input controller that knows how to lookup data for a DNA plate
containing individuals instead of DNA tubes which is standard.


=head1 SYNOPSIS

use APE::InputControllerFactory::ConcreteInputController::DNIND_InputController

my $object = APE::InputControllerFactory::ConcreteInputController::DNIND_InputController->new
  (atomicProcessContainer => $atomicProcessContainer,
   parentProcessId        => $parentProcessId,
   rules                  => {});


=head1 DESCRIPTION

This input controller knows how to lookup data for a DNA (type:DN)
plate that does not contain the standard DNA tube, but instead
contains individuals.


=head1 CONSTANTS

=over 5

=item TRUE

This is a boolean true constant.

=cut

use constant TRUE  => 1;


=item FALSE

This is a boolean false constant.

=cut

use constant FALSE => 0;


=item LOGIN

The login string used to connect to the database.

=cut

use constant LOGIN => 'snp';


=back

=head1 CONSTRUCTOR

=over 5

=item $object = APE::InputControllerFactory::ConcreteInputController::DNIND_InputController->new(option => value,...?);

The following arguments may be passed to the constructor so are
options for all derived classes of type Entity.

=over 5

=item example

Required. An example option.

=back

=cut

my %_attributes = (
		   ## XXX fill in attributes
		   );


=head2 INSTANTIATION PROCESS

The new method for this object calls the _init() method on $self. If
$self is a derived class then it's _init() method will be called
giving it the chance to remove any arguments it requires from the
%args hash. If there is no _init() method in the derived class then
the _init() method in this class is called.

Derived classes implementing a _init() method should return the %args
hash to the base class:

package Derived::Class;

sub _init {
   my ($self,%args) = @_;
   my $argument = delete $args{classArgument};
   return $self->SUPER::_init(%args);
}


=head1 METHODS

=over 10

=item $plate->_init(%args);

Private method. This method is called by the new method during object
instantiation (see the INSTANTIATION process). The method removes any
of the arguments required by the object from the %args hash and
returns it.

See the INSTANTIATION section for information on how to use this
method in a derived class.

=cut

sub _init {
    my ($self,%args) = @_;
    foreach my $arg (keys(%args)) {
	$self->{"_".$arg} = delete $args{$arg}
	  if exists $_attributes{$arg};
    }

    ## Check for required attributes.
    foreach my $requiredArg (qw//) {
	die "Error: argument '$requiredArg' is required"
	  unless $self->{"_".$requiredArg};
    }

    $args{description} = "";

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


=item example_get_method

XXX fill in attribute get method documentation.

=cut

foreach my $attName (keys(%_attributes)) {
    no strict 'refs';
    *{__PACKAGE__ . "::get\u$attName"} = sub { $_[0]->{"_".$attName} }
}


=item $inputController->createRequirements()

Uses the APE::InputControllerFactory::Plugin::UniqueRequirementCreator
plugin class to create the RequirementContainer and Requirement
objects for this InputController.

=cut

sub createRequirements {
    my $self = shift;
    my $option = APE::InputControllerFactory::Plugin::UniqueRequirementCreator->new
      (controller => $self);
    $option->run();
}


1;

=back

=head1 ALSO SEE

APE::AtomicProcess,
APE::InputControllerFactory::ConcreteInputController::InputController,
APE::InputControllerFactory::ConcreteInputController::DNTODN_InputController


=head1 AUTHOR

Simon Holroyd <holroyd@sanger.ac.uk>

=cut

