| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package HTML::GUI::log::eventList; |
|
2
|
|
|
|
|
|
|
|
|
3
|
13
|
|
|
13
|
|
71
|
use warnings; |
|
|
13
|
|
|
|
|
24
|
|
|
|
13
|
|
|
|
|
333
|
|
|
4
|
13
|
|
|
13
|
|
59
|
use strict; |
|
|
13
|
|
|
|
|
25
|
|
|
|
13
|
|
|
|
|
487
|
|
|
5
|
13
|
|
|
13
|
|
13206
|
use UNIVERSAL qw(isa); |
|
|
13
|
|
|
|
|
171
|
|
|
|
13
|
|
|
|
|
65
|
|
|
6
|
13
|
|
|
13
|
|
12870
|
use HTML::GUI::tag; |
|
|
13
|
|
|
|
|
29
|
|
|
|
13
|
|
|
|
|
103
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
HTML::GUI::log::eventList - Create and control a eventList input for webapp |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 VERSION |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Version 0.01 |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
|
19
|
|
|
|
|
|
|
#TODO : creer un objet htmlTag pour ne plus boucler a l'infini sur l'objet widget |
|
20
|
|
|
|
|
|
|
our @ISA = qw(HTML::GUI::tag); |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $SProcessEventList = HTML::GUI::log::eventList->new(); |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 EVENTLIST |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
The eventList module to store all the events we need. |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 PUBLIC METHODS |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=pod |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head3 new |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
create a new eventList |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub new |
|
42
|
|
|
|
|
|
|
{ |
|
43
|
13
|
|
|
13
|
1
|
156
|
my($class, |
|
44
|
|
|
|
|
|
|
) = @_; |
|
45
|
13
|
|
|
|
|
32
|
my $this = {}; |
|
46
|
13
|
50
|
|
|
|
66
|
if (!$this){ |
|
47
|
0
|
|
|
|
|
0
|
return undef; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
13
|
|
|
|
|
36
|
$this->{eventList} = []; |
|
50
|
|
|
|
|
|
|
|
|
51
|
13
|
|
|
|
|
70
|
bless($this, $class); |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=pod |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head3 addEvent |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Description : |
|
60
|
|
|
|
|
|
|
Add $event to the EventList object |
|
61
|
|
|
|
|
|
|
Parameters : |
|
62
|
|
|
|
|
|
|
$event : a HTML::GUI::log::event |
|
63
|
|
|
|
|
|
|
returns : |
|
64
|
|
|
|
|
|
|
1 if the event is effectively added |
|
65
|
|
|
|
|
|
|
0 if there was a problem |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
|
68
|
|
|
|
|
|
|
sub addEvent |
|
69
|
|
|
|
|
|
|
{ |
|
70
|
0
|
|
|
0
|
1
|
|
my($self,$event) = @_; |
|
71
|
|
|
|
|
|
|
|
|
72
|
0
|
0
|
|
|
|
|
if (!isa($event,'HTML::GUI::log::event')){ |
|
73
|
0
|
|
|
|
|
|
return 0; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
0
|
|
|
|
|
|
push @{$self->{eventList}},$event; |
|
|
0
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
return 1; |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=pod |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head3 forget |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Description : |
|
84
|
|
|
|
|
|
|
Erase all events of the eventList |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub forget |
|
89
|
|
|
|
|
|
|
{ |
|
90
|
0
|
|
|
0
|
1
|
|
my($self) = @_; |
|
91
|
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
$self->{eventList}=[]; |
|
93
|
|
|
|
|
|
|
} |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=pod |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head3 getCurrentEventList |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Description : |
|
100
|
|
|
|
|
|
|
Return the EventList object of the proces |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=cut |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub getCurrentEventList |
|
105
|
|
|
|
|
|
|
{ |
|
106
|
0
|
|
|
0
|
1
|
|
return $SProcessEventList; |
|
107
|
|
|
|
|
|
|
} |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=pod |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head3 getHtml |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Description : |
|
114
|
|
|
|
|
|
|
Return the html of the eventList. The HTML is like this one : |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Some errors occured. |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Object label |
|
119
|
|
|
|
|
|
|
Event label. |
|
120
|
|
|
|
|
|
|
...other events... |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Parameters : |
|
124
|
|
|
|
|
|
|
$type : |
|
125
|
|
|
|
|
|
|
'error' : render error events |
|
126
|
|
|
|
|
|
|
'info' : render info events |
|
127
|
|
|
|
|
|
|
'debug' : render debug events |
|
128
|
|
|
|
|
|
|
'all' : render all events |
|
129
|
|
|
|
|
|
|
$visibility : |
|
130
|
|
|
|
|
|
|
'pub' for public, only public events are rendered |
|
131
|
|
|
|
|
|
|
'all' for private, all events (private and public) are rendered |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=cut |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
sub getHtml |
|
137
|
|
|
|
|
|
|
{ |
|
138
|
0
|
|
|
0
|
1
|
|
my($self,$type,$visibility) = @_; |
|
139
|
0
|
|
|
|
|
|
my @displayList = (); |
|
140
|
|
|
|
|
|
|
|
|
141
|
0
|
|
0
|
|
|
|
$type ||= 'all'; |
|
142
|
0
|
|
0
|
|
|
|
$visibility ||= 'pub'; |
|
143
|
|
|
|
|
|
|
|
|
144
|
0
|
0
|
|
|
|
|
if (!scalar @{$self->{eventList}}){ |
|
|
0
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
#no error to display !! |
|
146
|
0
|
|
|
|
|
|
return ''; |
|
147
|
|
|
|
|
|
|
} |
|
148
|
0
|
0
|
|
|
|
|
@displayList = grep {$type eq 'all' || $type eq $_->getType()} |
|
|
0
|
|
|
|
|
|
|
|
149
|
0
|
|
|
|
|
|
@{$self->{eventList}}; |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
#generate HTML for each event !!! |
|
153
|
0
|
|
|
|
|
|
my $listHtml = ''; |
|
154
|
0
|
|
|
|
|
|
my $lastDomainHtml = ''; |
|
155
|
0
|
|
|
|
|
|
foreach my $event (@displayList){ |
|
156
|
0
|
|
|
|
|
|
my $domainHtml = $event->getDtHtml(); |
|
157
|
0
|
0
|
|
|
|
|
if ($lastDomainHtml ne $domainHtml){ |
|
158
|
0
|
|
|
|
|
|
$listHtml .= $domainHtml; |
|
159
|
|
|
|
|
|
|
} |
|
160
|
0
|
|
|
|
|
|
$lastDomainHtml = $domainHtml; |
|
161
|
0
|
|
|
|
|
|
$listHtml .= $event->getDdHtml(); |
|
162
|
|
|
|
|
|
|
} |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
|
165
|
0
|
|
|
|
|
|
$listHtml = $self->getHtmlTag("h2",{class=>("errorList")},$self->escapeHtml('Some errors occured.') ) |
|
166
|
|
|
|
|
|
|
.$self->getHtmlTag("dl",{class=>("errorList")},$listHtml ); |
|
167
|
0
|
|
|
|
|
|
$listHtml = $self->getHtmlTag("div",{class=>("errorList")}, |
|
168
|
|
|
|
|
|
|
$listHtml ); |
|
169
|
0
|
|
|
|
|
|
return $listHtml; |
|
170
|
|
|
|
|
|
|
} |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
sub DESTROY |
|
173
|
|
|
|
|
|
|
{ |
|
174
|
0
|
|
|
0
|
|
|
my($self) = @_; |
|
175
|
|
|
|
|
|
|
|
|
176
|
0
|
|
|
|
|
|
delete $self->{eventList} ; |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
} |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=head1 AUTHOR |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
Jean-Christian Hassler, C<< >> |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=head1 BUGS |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
|
187
|
|
|
|
|
|
|
C, or through the web interface at |
|
188
|
|
|
|
|
|
|
L. |
|
189
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
|
190
|
|
|
|
|
|
|
your bug as I make changes. |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head1 SUPPORT |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
perldoc HTML::GUI::widget |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
You can also look for information at: |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=over 4 |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
L |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=item * CPAN Ratings |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
L |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
L |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=item * Search CPAN |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
L |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=back |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
Copyright 2007 Jean-Christian Hassler, all rights reserved. |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
227
|
|
|
|
|
|
|
under the same terms as Perl itself. |
|
228
|
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=cut |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
1; # End of HTML::GUI::event::eventList |