| Win32-SqlServer-DTS documentation | Contained in the Win32-SqlServer-DTS distribution. |
perldoc.perldoc.
Win32::SqlServer::DTS::TaskFactory - a Perl abstract class to create DTS Package Tasks in a polymorphic way
use Win32::SqlServer::DTS::TaskFactory;
# $task is a unknow DTS Task object
my $new_task = Win32::SqlServer::DTS::TaskFactory::create($task);
print $new_task->to_string, "\n";
Win32::SqlServer::DTS::TaskFactory creates Win32::SqlServer::DTS::Task subclasses objects depending on the type of the DTS Package Task object
passed as a reference.
Nothing.
Expects a DTSTask object passed as a parameter.
Returns a object from a subclass of Win32::SqlServer::DTS::Task depending on the CustomTaskID property from the Task
object passed as a parameter.
perldoc.perldoc.Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
Copyright (C) 2006 by Alceu Rodrigues de Freitas Junior
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
| Win32-SqlServer-DTS documentation | Contained in the Win32-SqlServer-DTS distribution. |
package Win32::SqlServer::DTS::TaskFactory;
use 5.008008; use strict; use warnings; use Carp; use Win32::SqlServer::DTS::TaskTypes; our $VERSION = '0.02';
sub create { my $task = shift; my $type_converted = Win32::SqlServer::DTS::TaskTypes::convert( $task->CustomTaskID ); if ( defined($type_converted) ) { # using DOS directory separator my $location = 'Win32\\SqlServer\\DTS\\Task\\' . $type_converted . '.pm'; my $new_class = 'Win32::SqlServer::DTS::Task::' . $type_converted; require $location; return $new_class->new( $task ); } else { croak $task->CustomTaskID . ' is not a implemented Win32::SqlServer::DTS::Task subclass'; } } 1; __END__