line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hyper::Developer::Generator::Control::Container; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1768
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
6
|
use version; our $VERSION = qv('0.01'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
534
|
use Class::Std; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use base qw(Hyper::Developer::Generator::Control::ContainerFlow); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Hyper::Config::Reader::Container; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my %create_template_of :ATTR(:init_arg); |
13
|
|
|
|
|
|
|
my %create_code_of :ATTR(:init_arg); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub BUILD { |
16
|
|
|
|
|
|
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$self->set_type('package'); |
19
|
|
|
|
|
|
|
$self->set_sub_path('/Control/Container/'); |
20
|
|
|
|
|
|
|
$self->set_suffix('pm'); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub create { |
26
|
|
|
|
|
|
|
my $self = shift; |
27
|
|
|
|
|
|
|
my $ident = ident $self; |
28
|
|
|
|
|
|
|
my $usecase = $self->get_usecase(); |
29
|
|
|
|
|
|
|
my $service = $self->get_service(); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $config = Hyper::Config::Reader::Container->new({ |
32
|
|
|
|
|
|
|
base_path => $self->get_base_path(), |
33
|
|
|
|
|
|
|
config_for => $self->get_namespace() . "::Control::Container::${service}::C${usecase}", |
34
|
|
|
|
|
|
|
}); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $data_ref = $self->_get_data_ref_of_steps( |
37
|
|
|
|
|
|
|
$config->get_steps() |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $attr_ref = $config->get_attributes(); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
if ( %{$data_ref} ) { |
43
|
|
|
|
|
|
|
if ( $create_code_of{$ident} ) { |
44
|
|
|
|
|
|
|
$self->SUPER::create({ |
45
|
|
|
|
|
|
|
data => { |
46
|
|
|
|
|
|
|
attributes => $attr_ref, |
47
|
|
|
|
|
|
|
step_data => $data_ref, |
48
|
|
|
|
|
|
|
}, |
49
|
|
|
|
|
|
|
name => "_C$usecase", |
50
|
|
|
|
|
|
|
template => 'Generator/Control/_container.tpl', |
51
|
|
|
|
|
|
|
force => 1, |
52
|
|
|
|
|
|
|
}); |
53
|
|
|
|
|
|
|
$self->SUPER::create({ |
54
|
|
|
|
|
|
|
data => { |
55
|
|
|
|
|
|
|
attributes => $attr_ref, |
56
|
|
|
|
|
|
|
step_data => $data_ref, |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
name => "C$usecase", |
59
|
|
|
|
|
|
|
template => 'Generator/Control/container.tpl', |
60
|
|
|
|
|
|
|
}); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
if ( $create_template_of{$ident} ) { |
63
|
|
|
|
|
|
|
$self->set_type('template'); |
64
|
|
|
|
|
|
|
$self->set_suffix('htc'); |
65
|
|
|
|
|
|
|
$self->SUPER::create({ |
66
|
|
|
|
|
|
|
data => { |
67
|
|
|
|
|
|
|
attributes => $attr_ref, |
68
|
|
|
|
|
|
|
step_data => $data_ref, |
69
|
|
|
|
|
|
|
}, |
70
|
|
|
|
|
|
|
name => "C$usecase", |
71
|
|
|
|
|
|
|
template => 'Generator/Control/Container/template.tpl', |
72
|
|
|
|
|
|
|
}); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
return $self; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |