line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SSIS::Package::ConnectionManagerFactory;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1024
|
use 5.010;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
42
|
|
4
|
1
|
|
|
1
|
|
6
|
use Mouse;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1172
|
use SSIS::Package::ConnectionManager::ADONET;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
50
|
|
7
|
1
|
|
|
1
|
|
583
|
use SSIS::Package::ConnectionManager::EXCEL;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
8
|
1
|
|
|
1
|
|
518
|
use SSIS::Package::ConnectionManager::FILE;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
9
|
1
|
|
|
1
|
|
541
|
use SSIS::Package::ConnectionManager::FLATFILE;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
10
|
1
|
|
|
1
|
|
593
|
use SSIS::Package::ConnectionManager::MSMQ;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
11
|
1
|
|
|
1
|
|
535
|
use SSIS::Package::ConnectionManager::OLEDB;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
12
|
1
|
|
|
1
|
|
607
|
use SSIS::Package::ConnectionManager::SMOServer;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
13
|
1
|
|
|
1
|
|
621
|
use SSIS::Package::ConnectionManager::SMTP;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
14
|
1
|
|
|
1
|
|
544
|
use SSIS::Package::ConnectionManager::ADO;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
15
|
1
|
|
|
1
|
|
583
|
use SSIS::Package::ConnectionManager::MSOLAP100;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
32
|
|
16
|
1
|
|
|
1
|
|
585
|
use SSIS::Package::ConnectionManager::CACHE;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
17
|
1
|
|
|
1
|
|
556
|
use SSIS::Package::ConnectionManager::FTP;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
24
|
|
18
|
1
|
|
|
1
|
|
587
|
use SSIS::Package::ConnectionManager::HTTP;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
19
|
1
|
|
|
1
|
|
582
|
use SSIS::Package::ConnectionManager::MULTIFLATFILE;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
20
|
1
|
|
|
1
|
|
584
|
use SSIS::Package::ConnectionManager::MULTIFILE;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
29
|
|
21
|
1
|
|
|
1
|
|
494
|
use SSIS::Package::ConnectionManager::ODBC;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
22
|
1
|
|
|
1
|
|
490
|
use SSIS::Package::ConnectionManager::WMI;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
23
|
1
|
|
|
1
|
|
504
|
use SSIS::Package::ConnectionManager::SQLMOBILE;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
569
|
use XML::Simple ; #qw(:strict);
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
use Data::Dumper;
|
29
|
|
|
|
|
|
|
use Data::Printer;
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
use Carp;
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
SSIS::Package::ConnectionManagerFactory - Factory class for SSIS package connection managers by Ded MedVed
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 VERSION
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Version 0.01
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
use autodie qw(:all);
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#TODO 0.
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub make {
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my ($self) = shift;
|
51
|
|
|
|
|
|
|
croak 'Invalid call' unless defined $self;
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $rh_args = $_[0];
|
54
|
|
|
|
|
|
|
my $objType = $rh_args->{type} ;
|
55
|
|
|
|
|
|
|
my $objectData = $rh_args->{objectData} ;
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# fix up crappy invalid character in .net name;
|
58
|
|
|
|
|
|
|
if ($objType =~ m{ \A ADO\.NET}x ) { $objType = "ADONET" } ;
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $connectManager;
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
if ($objType =~ m{\A (ADO|ADONET|CACHE|EXCEL|FILE|FTP|FLATFILE|HTTP|MSMQ|MSOLAP100|MULTIFILE|MULTIFLATFILE|ODBC|OLEDB|SMOServer|SMTP|SQLMOBILE|WMI) \z}x ) {
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my @connstr;
|
65
|
|
|
|
|
|
|
my $connstr;
|
66
|
|
|
|
|
|
|
my @name;
|
67
|
|
|
|
|
|
|
my $name;
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
if ($objType eq 'FTP' ) {
|
70
|
|
|
|
|
|
|
@connstr = grep { $_->{'DTS:Name'} eq 'ConnectionString' } @{$objectData->{'DTS:ConnectionManager'}->{'DTS:FtpConnection'}->{'DTS:Property'}};
|
71
|
|
|
|
|
|
|
$connstr = $connstr[0]->{content};
|
72
|
|
|
|
|
|
|
}
|
73
|
|
|
|
|
|
|
elsif ($objType eq 'HTTP' ) {
|
74
|
|
|
|
|
|
|
@connstr = grep { $_->{'DTS:Name'} eq 'ConnectionString' } @{$objectData->{'DTS:ConnectionManager'}->{'DTS:HttpConnection'}->{'DTS:Property'}};
|
75
|
|
|
|
|
|
|
$connstr = $connstr[0]->{content};
|
76
|
|
|
|
|
|
|
}
|
77
|
|
|
|
|
|
|
elsif ($objType eq 'WMI' ) {
|
78
|
|
|
|
|
|
|
$connstr = $objectData->{'WmiConnectionManager'}->{'ConnectionString'};
|
79
|
|
|
|
|
|
|
}
|
80
|
|
|
|
|
|
|
elsif ($objType eq "MSMQ" ) {
|
81
|
|
|
|
|
|
|
$connstr = $objectData->{'MsmqConnectionManager'}->{'ConnectionString'};
|
82
|
|
|
|
|
|
|
}
|
83
|
|
|
|
|
|
|
elsif ($objType eq "SMOServer" ) {
|
84
|
|
|
|
|
|
|
$connstr = $objectData->{'SMOServerConnectionManager'}->{'ConnectionString'};
|
85
|
|
|
|
|
|
|
}
|
86
|
|
|
|
|
|
|
elsif ($objType eq "SMTP" ) {
|
87
|
|
|
|
|
|
|
$connstr = $objectData->{'SmtpConnectionManager'}->{'ConnectionString'};
|
88
|
|
|
|
|
|
|
}
|
89
|
|
|
|
|
|
|
else {
|
90
|
|
|
|
|
|
|
if ( ref($objectData->{'DTS:ConnectionManager'}->{'DTS:Property'}) eq 'ARRAY' ) {
|
91
|
|
|
|
|
|
|
@connstr = grep { $_->{'DTS:Name'} eq 'ConnectionString' } @{$objectData->{'DTS:ConnectionManager'}->{'DTS:Property'}};
|
92
|
|
|
|
|
|
|
$connstr = $connstr[0]->{content};
|
93
|
|
|
|
|
|
|
}
|
94
|
|
|
|
|
|
|
else {
|
95
|
|
|
|
|
|
|
$connstr = $objectData->{'DTS:ConnectionManager'}->{'DTS:Property'}->{content};
|
96
|
|
|
|
|
|
|
}
|
97
|
|
|
|
|
|
|
}
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
my @valrefs = map { ( $_->{'DTS:Name'},$_->{'content'} ) ;} @{$rh_args->{properties}};
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# add connection string
|
102
|
|
|
|
|
|
|
push @valrefs, 'ConnectionString' , $connstr ;
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
$connectManager = "SSIS::Package::ConnectionManager::${objType}"->new( { (@valrefs) } );
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
}
|
107
|
|
|
|
|
|
|
else {
|
108
|
|
|
|
|
|
|
croak "Unknown connection type $objType.";
|
109
|
|
|
|
|
|
|
}
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
return $connectManager ;
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
}
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
1 ;
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
__DATA__
|