line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
XML::Filter::XML_Directory_2RSS - SAX2 filter for generating RSS from the output of XML::Directory::SAX |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use IO::File; |
10
|
|
|
|
|
|
|
use XML::SAX::Writer; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use XML::Directory::SAX; |
13
|
|
|
|
|
|
|
use XML::Filter::XML_Directory_2RSS; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $rss = "/path/to/rss.xml"; |
16
|
|
|
|
|
|
|
my $directory = "/path/to/some/directory"; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $output = IO::File->new(">$rss"); |
21
|
|
|
|
|
|
|
my $writer = XML::SAX::Writer->new(Output=>$output); |
22
|
|
|
|
|
|
|
my $filter = XML::Filter::XML_Directory_2RSS->new(Handler=>$writer); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# Various RSS meta data methods |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$rss->uri("http://www.foo.com/rss.xml"); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
$rss->channel_data({title => "foo", |
29
|
|
|
|
|
|
|
link => "http://foo.com", |
30
|
|
|
|
|
|
|
subject => "bar", |
31
|
|
|
|
|
|
|
descripion => "foo is to bar as bar is to foo"}); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$rss->generator($0); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# Set up one or more events for affecting the |
36
|
|
|
|
|
|
|
# data describe in your RSS document |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$rss->callbacks({link => \&do_link}); |
39
|
|
|
|
|
|
|
$rss->handlers({title=>MySax::Title->new(Handler=>$writer)}); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Describe items to be explicily excluded (or included) |
42
|
|
|
|
|
|
|
# in your RSS document. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
$rss->exclude(exclude=>["RCS","CVS"],ending=>["~"]); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# Parse parse parse |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $directory = XML::Directory::SAX->new(Handler => $filter, |
49
|
|
|
|
|
|
|
detail => 2, |
50
|
|
|
|
|
|
|
depth => 1); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
$directory->order_by("a"); |
53
|
|
|
|
|
|
|
$directory->parse_dir($directory); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub do_link { |
58
|
|
|
|
|
|
|
my $link = shift; |
59
|
|
|
|
|
|
|
$link =~ s!$directory!http://www.foo.com!s; |
60
|
|
|
|
|
|
|
return $link; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
SAX2 filter for generating RSS from the output of XML::Directory::SAX. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 NOTES |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=over |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item * |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This package has very limited support for RSS modules. I'm workin' on it. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=back |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
package XML::Filter::XML_Directory_2RSS; |
80
|
1
|
|
|
1
|
|
84909
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
81
|
|
|
|
|
|
|
|
82
|
1
|
|
|
1
|
|
5
|
use base qw (XML::Filter::XML_Directory_2RSS::Base); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
469
|
|
83
|
1
|
|
|
1
|
|
767
|
use XML::Filter::XML_Directory_2RSS::Items; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
54
|
|
84
|
|
|
|
|
|
|
|
85
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
2390
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$XML::Filter::XML_Directory_2RSS::VERSION = '0.9.1'; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 OBJECT METHODS |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 $pkg->encoding($enc) |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Set the encoding type for your RSS document. Default is I |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=cut |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub encoding { |
98
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
99
|
0
|
|
|
|
|
|
$self->{'__encoding'} = $_[0]; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head2 $pkg->uri($uri) |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Set the URI for your RSS document. This is the value of the I attribute. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=cut |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub uri { |
109
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
110
|
0
|
|
|
|
|
|
$self->{'__uri'} = $_[0]; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 $pkg->channel_data(\%args) |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Set channel data for your RSS document. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Valid arguments are : |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=over |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=item * |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
B |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
String. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item * |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
B |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
String. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item * |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
B |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
String. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item * |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
B |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
String. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=item * |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
B |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
String. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item * |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
B |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
String. |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item * |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
B |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
String. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=item * |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
B |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
Array reference. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=back |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Proper support for RSS 1.0 modules is in the works. |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=cut |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
sub channel_data { |
176
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
177
|
0
|
|
|
|
|
|
my $args = shift; |
178
|
|
|
|
|
|
|
|
179
|
0
|
0
|
|
|
|
|
if (ref($args) ne "HASH") { |
180
|
0
|
|
|
|
|
|
return undef; |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
|
183
|
0
|
|
|
|
|
|
foreach (keys %$args) { |
184
|
0
|
0
|
|
|
|
|
unless ($_ =~ /^(title|link|subject|description|dc:publisher|dc:rights|dc:creator|dc:language)$/) { |
185
|
0
|
|
|
|
|
|
carp "'$_' is an unknown element. Skipping.\n"; |
186
|
0
|
|
|
|
|
|
delete $args->{$_}; |
187
|
|
|
|
|
|
|
} |
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
|
190
|
0
|
0
|
0
|
|
|
|
if (($args->{'dc:language'}) && (ref($args->{'dc:language'}) ne "ARRAY")) { |
191
|
0
|
|
|
|
|
|
carp "dc:language mus be passed as an array reference. Skipping.\n"; |
192
|
0
|
|
|
|
|
|
delete $args->{'dc:language'}; |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
|
195
|
0
|
|
|
|
|
|
$self->{'__channel'} = $args; |
196
|
0
|
|
|
|
|
|
return 1; |
197
|
|
|
|
|
|
|
} |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head2 $pkg->image(\%args) |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
Set image data for your RSS document. |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
Valid arguments are : |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=over |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=item * |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
B |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
String. |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=item * |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
B |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
String. |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
=item * |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
B |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
String. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=back |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=cut |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
sub image { |
230
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
231
|
0
|
|
|
|
|
|
my $args = shift; |
232
|
|
|
|
|
|
|
|
233
|
0
|
0
|
|
|
|
|
if (ref($args) ne "HASH") { |
234
|
0
|
|
|
|
|
|
return undef; |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
|
237
|
0
|
|
|
|
|
|
foreach (keys %$args) { |
238
|
0
|
0
|
|
|
|
|
unless ($_ =~ /^(title|url|link)$/) { |
239
|
0
|
|
|
|
|
|
carp "'$_' is an unknown element. Skipping.\n"; |
240
|
0
|
|
|
|
|
|
delete $args->{$_}; |
241
|
|
|
|
|
|
|
} |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
|
244
|
0
|
|
|
|
|
|
$self->{'__image'} = $args; |
245
|
0
|
|
|
|
|
|
return 1; |
246
|
|
|
|
|
|
|
} |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=head2 $pkg->textinput(\%args) |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
Set textinput data for your RSS document. |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
Valid arguments are : |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=over |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
=item * |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
B |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
String. |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=item * |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
B |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
String. |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
=item * |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
B |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
String. |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
=item * |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
B |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
String. |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=back |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
=cut |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
sub textinput { |
285
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
286
|
0
|
|
|
|
|
|
my $args = shift; |
287
|
|
|
|
|
|
|
|
288
|
0
|
0
|
|
|
|
|
if (ref($args) ne "HASH") { |
289
|
0
|
|
|
|
|
|
return undef; |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
|
292
|
0
|
|
|
|
|
|
foreach (keys %$args) { |
293
|
0
|
0
|
|
|
|
|
unless ($_ =~ /^(title|descripion|name|link)$/) { |
294
|
0
|
|
|
|
|
|
carp "'$_' is an unknown element. Skipping.\n"; |
295
|
0
|
|
|
|
|
|
delete $args->{$_}; |
296
|
|
|
|
|
|
|
} |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
|
299
|
0
|
|
|
|
|
|
$self->{'__textinput'} = $args; |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
} |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
=head2 $pkg->generator($agent) |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
Set generator agent data for your RSS document. |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
Currently this is really only used by the Syndic8 project, but it's a good idea so we'll add hooks it for. |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
=cut |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
sub generator { |
312
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
313
|
0
|
|
|
|
|
|
$self->{'__generator'} = $_[0]; |
314
|
|
|
|
|
|
|
} |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
=head2 $pkg->exclude(%args) |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
This method is inherited from I. See docs for details. |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=head2 $pkg->include(%args); |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
This method is inherited from I. See docs for details. |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
=head2 $pkg->handlers(\%args) |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
A is a valid SAX2 thingy for assigning the I or I element of an RSS item. Thingies are like any other SAX2 thingy with a few requirements : |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=over |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
=item * |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
Must inherit from XML::SAX::Base. |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=item * |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
It's handler must be the same one passed to the XML_Directory_2RSS filter. |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
=item * |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
It must define a I method. |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
=back |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
# If this... |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
my $writer = XML::SAX::Writer->new(); |
347
|
|
|
|
|
|
|
my $rss = XML::Filter::XML_Directory_2RSS->new(Handler=>$writer); |
348
|
|
|
|
|
|
|
$rss->handler({title=>MySAX::TitleHandler->new(Handler=>$writer)}); |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
# Called this... |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
package MySAX::TitleHandler; |
353
|
|
|
|
|
|
|
use base qw (XML::SAX::Base); |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
sub parse_uri { |
356
|
|
|
|
|
|
|
my ($pkg,$path,$title) = @_; |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
$pkg->SUPER::start_prefix_mapping({Prefix=>"me",NamespaceURI=>"..."}); |
359
|
|
|
|
|
|
|
$pkg->SUPER::start_element({Name=>"me:woot"}); |
360
|
|
|
|
|
|
|
$pkg->SUPER::characters({Data=>&get_title_from_file($path)}); |
361
|
|
|
|
|
|
|
$pkg->SUPER::end_element({Name=>"me:woot"}); |
362
|
|
|
|
|
|
|
$pkg->SUPER::end_prefix_mapping({Prefix=>"me"}); |
363
|
|
|
|
|
|
|
} |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
# Then the output would look like this... |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
-
|
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
I Got My Title From the File |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
... |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
Valid arguments are : |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
=over |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
=item * |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
B |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
Object. |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
The handler's I method is passed the absolute path of the file and the filename itself. |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
If no handler, or callback, is defined then the filename will be assigned to the title element. |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
=item * |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
B |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
Object. |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
The handler's I method is passed the absolute path of the file. |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
If no handler, or callback, is defined then the description element will be left empty. |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
=back |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
Handlers have a higher precedence than callbacks. |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=cut |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
# See XML::Filter::XML_Directory_2RSS::Base |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
=head2 $pkg->callbacks(\%args) |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
Register one of more callbacks for your RSS document. |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
Callbacks are like I except that they are code references instead of SAX2 thingies. |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
A code reference might be used to munge the I value of an item into a URI suitable for viewing in a web browser. |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
Valid arguments are |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
=over |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
=item * |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
B |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
Code reference. |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
Code references will be passed the absolute path of the file and the filename itself. |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
If no callback, or handler, is defined then the filename will be assigned to the title element. |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
=item * |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
B |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
Code reference. |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
Code references will be passed the absolute path of the file. |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
If no callback is defined then the absolute path of the file will be assigned to the link element. |
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
=item * |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
B |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
Code reference. |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
Code references will be passed the absolute path of the file. |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
If no callback, or handler, the descripion element will be left empty. |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
=back |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
Callbacks have a lower precedence than handlers. |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
=cut |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
# See XML::Filter::XML_Directory_2RSS::Base |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
sub start_document { |
458
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
459
|
|
|
|
|
|
|
|
460
|
0
|
|
|
|
|
|
$self->SUPER::start_document(); |
461
|
0
|
|
0
|
|
|
|
$self->SUPER::xml_decl({Version => "1.0", |
462
|
|
|
|
|
|
|
Encoding => ($self->{'__encoding'} || "UTF-8")}); |
463
|
|
|
|
|
|
|
|
464
|
0
|
|
|
|
|
|
$self->start_default_namespaces(); |
465
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"rdf:RDF"}); |
466
|
|
|
|
|
|
|
|
467
|
0
|
|
|
|
|
|
return 1; |
468
|
|
|
|
|
|
|
} |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
sub end_document { |
471
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
472
|
|
|
|
|
|
|
|
473
|
0
|
|
|
|
|
|
$self->add_textinput(); |
474
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"rdf:RDF"}); |
475
|
0
|
|
|
|
|
|
$self->end_default_namespaces(); |
476
|
0
|
|
|
|
|
|
$self->SUPER::end_document(); |
477
|
|
|
|
|
|
|
|
478
|
0
|
|
|
|
|
|
return 1; |
479
|
|
|
|
|
|
|
} |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
sub start_element { |
482
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
483
|
0
|
|
|
|
|
|
my $data = shift; |
484
|
|
|
|
|
|
|
|
485
|
0
|
0
|
|
|
|
|
$self->on_enter_start_element($data) || return; |
486
|
|
|
|
|
|
|
|
487
|
0
|
0
|
|
|
|
|
if ($data->{Name} =~ /^(file|directory)$/) { |
488
|
0
|
|
|
|
|
|
$self->start_item($data); |
489
|
|
|
|
|
|
|
} |
490
|
|
|
|
|
|
|
|
491
|
0
|
|
|
|
|
|
return 1; |
492
|
|
|
|
|
|
|
} |
493
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
sub end_element { |
495
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
496
|
0
|
|
|
|
|
|
my $data = shift; |
497
|
|
|
|
|
|
|
|
498
|
0
|
|
|
|
|
|
$self->on_enter_end_element($data); |
499
|
|
|
|
|
|
|
|
500
|
0
|
0
|
|
|
|
|
if ($data->{Name} eq "head") { |
501
|
0
|
|
|
|
|
|
$self->add_meta_data(); |
502
|
|
|
|
|
|
|
} |
503
|
|
|
|
|
|
|
|
504
|
0
|
0
|
0
|
|
|
|
if (($self->{'__start'}) && |
|
|
|
0
|
|
|
|
|
505
|
|
|
|
|
|
|
($self->{'__rlevel'} > $self->{'__start'}) && |
506
|
|
|
|
|
|
|
(! $self->{'__skip'})) { |
507
|
|
|
|
|
|
|
|
508
|
0
|
0
|
|
|
|
|
if ($data->{Name} =~ /^(file|directory)$/) { |
509
|
0
|
|
|
|
|
|
$self->prune_cwd($data); |
510
|
0
|
|
|
|
|
|
$self->end_item($data); |
511
|
|
|
|
|
|
|
} |
512
|
|
|
|
|
|
|
} |
513
|
|
|
|
|
|
|
|
514
|
0
|
|
|
|
|
|
$self->on_exit_end_element($data); |
515
|
|
|
|
|
|
|
} |
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
sub characters { |
518
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
519
|
0
|
|
|
|
|
|
my $data = shift; |
520
|
|
|
|
|
|
|
|
521
|
0
|
|
|
|
|
|
$self->on_characters($data); |
522
|
|
|
|
|
|
|
} |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
sub start_item { |
525
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
526
|
0
|
|
|
|
|
|
my $data = shift; |
527
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
# am i a child? |
529
|
|
|
|
|
|
|
|
530
|
0
|
0
|
0
|
|
|
|
if (($self->{'__wasa'} eq "directory") && |
531
|
|
|
|
|
|
|
($self->{'__ima_level'} > $self->{'__wasa_level'})) { |
532
|
|
|
|
|
|
|
|
533
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"thr:children"}); |
534
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"rdf:Seq"}); |
535
|
0
|
|
|
|
|
|
$self->{'__children'}->{($self->{'__wasa_level'})} = 1; |
536
|
|
|
|
|
|
|
} |
537
|
|
|
|
|
|
|
|
538
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name => "item", |
539
|
|
|
|
|
|
|
Attributes => $self->rdf_about($self->make_link($data))}); |
540
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
# title element |
542
|
|
|
|
|
|
|
|
543
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"title"}); |
544
|
|
|
|
|
|
|
|
545
|
0
|
0
|
|
|
|
|
if ($self->{'__handlers'}{'title'}) { |
|
|
0
|
|
|
|
|
|
546
|
0
|
|
|
|
|
|
$self->{'__handlers'}{'description'}->parse_uri($self->build_uri()); |
547
|
|
|
|
|
|
|
} |
548
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
elsif ($self->{'__callbacks'}{'title'}) { |
550
|
0
|
|
|
|
|
|
$self->SUPER::characters({Data=>&{$self->{'__callbacks'}{'title'}}($self->build_uri(),$data->{Attributes}->{'{}name'}->{Value})}); |
|
0
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
} |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
else { |
554
|
0
|
|
|
|
|
|
$self->SUPER::characters({Data=>$data->{Attributes}->{'{}name'}->{Value}}); |
555
|
|
|
|
|
|
|
} |
556
|
|
|
|
|
|
|
|
557
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"title"}); |
558
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
# link element |
560
|
|
|
|
|
|
|
|
561
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"link"}); |
562
|
0
|
|
|
|
|
|
$self->SUPER::characters({Data=>$self->make_link($data)}); |
563
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"link"}); |
564
|
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
# description element |
566
|
|
|
|
|
|
|
|
567
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"description"}); |
568
|
|
|
|
|
|
|
|
569
|
0
|
0
|
|
|
|
|
if ($self->{'__handlers'}{'description'}) { |
|
|
0
|
|
|
|
|
|
570
|
0
|
|
|
|
|
|
$self->{'__handlers'}{'description'}->parse_uri($self->build_uri()); |
571
|
|
|
|
|
|
|
} |
572
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
elsif ($self->{'__callbacks'}{'description'}) { |
574
|
0
|
|
|
|
|
|
$self->SUPER::characters({Data=>&{$self->{'__callbacks'}{'description'}}($self->build_uri())}); |
|
0
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
} |
576
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
else { } |
578
|
|
|
|
|
|
|
|
579
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"description"}); |
580
|
|
|
|
|
|
|
|
581
|
0
|
|
|
|
|
|
return 1; |
582
|
|
|
|
|
|
|
} |
583
|
|
|
|
|
|
|
|
584
|
|
|
|
|
|
|
sub end_item { |
585
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
586
|
0
|
|
|
|
|
|
my $data = shift; |
587
|
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
# do i have children? |
589
|
|
|
|
|
|
|
|
590
|
0
|
0
|
0
|
|
|
|
if (($data->{Name} eq "directory") && |
591
|
|
|
|
|
|
|
($self->{'__children'}{$self->{'__rlevel'}})) { |
592
|
|
|
|
|
|
|
|
593
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"rdf:Seq"}); |
594
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"thr:children"}); |
595
|
0
|
|
|
|
|
|
delete $self->{'__children'}{$self->{'__rlevel'}}; |
596
|
|
|
|
|
|
|
} |
597
|
|
|
|
|
|
|
|
598
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"item"}); |
599
|
0
|
|
|
|
|
|
return 1; |
600
|
|
|
|
|
|
|
} |
601
|
|
|
|
|
|
|
|
602
|
|
|
|
|
|
|
sub add_meta_data { |
603
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
604
|
|
|
|
|
|
|
|
605
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name => "channel", |
606
|
|
|
|
|
|
|
Attributes => $self->rdf_about($self->{'__uri'})}); |
607
|
|
|
|
|
|
|
|
608
|
0
|
|
|
|
|
|
foreach my $el ("title","link","subject","description") { |
609
|
0
|
0
|
|
|
|
|
next if (! defined($self->{'__channel'}{$_})); |
610
|
|
|
|
|
|
|
|
611
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>$_}); |
612
|
0
|
|
|
|
|
|
$self->SUPER::characters({Data=>$self->{'__channel'}{$_}}); |
613
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>$_}); |
614
|
|
|
|
|
|
|
} |
615
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
# Generator data for the nice people at Syndic8 |
617
|
|
|
|
|
|
|
|
618
|
0
|
0
|
|
|
|
|
if ($self->{'__generator'}) { |
619
|
|
|
|
|
|
|
|
620
|
0
|
|
|
|
|
|
$self->SUPER::start_prefix_mapping({Prefix=>"admin",NamespaceURI=>$self->ns_map("admin")}); |
621
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name => "admin:generatorAgent", |
622
|
|
|
|
|
|
|
Attributes => $self->rdf_resource($self->{'__generator'})}); |
623
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=> "admin:generatorAgent"}); |
624
|
0
|
|
|
|
|
|
$self->SUPER::end_prefix_mapping({Prefix=>"admin"}); |
625
|
|
|
|
|
|
|
} |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
# Some basic Dublin Core elements |
628
|
|
|
|
|
|
|
# More to come... |
629
|
|
|
|
|
|
|
|
630
|
0
|
|
|
|
|
|
foreach my $el ("rights","publisher","creator") { |
631
|
0
|
0
|
|
|
|
|
next if (! defined($self->{'__channel'}{$_})); |
632
|
|
|
|
|
|
|
|
633
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"dc:$_"}); |
634
|
0
|
|
|
|
|
|
$self->SUPER::characters({Data=>$self->{'__channel'}{"dc:$_"}}); |
635
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"dc:$_"}); |
636
|
|
|
|
|
|
|
} |
637
|
|
|
|
|
|
|
|
638
|
0
|
0
|
|
|
|
|
if (ref($self->{'__channel'}{'dc:language'}) eq "ARRAY") { |
639
|
0
|
|
|
|
|
|
foreach my $lang (@{$self->{'__channel'}{'dc:language'}}) { |
|
0
|
|
|
|
|
|
|
640
|
|
|
|
|
|
|
|
641
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"dc:language"}); |
642
|
0
|
|
|
|
|
|
$self->SUPER::characters({Data=>$lang}); |
643
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"dc:language"}); |
644
|
|
|
|
|
|
|
} |
645
|
|
|
|
|
|
|
} |
646
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
# |
648
|
|
|
|
|
|
|
|
649
|
0
|
|
|
|
|
|
$self->add_channel_items(); |
650
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
# |
652
|
|
|
|
|
|
|
|
653
|
0
|
0
|
|
|
|
|
if (ref($self->{'__image'}) eq "HASH") { |
654
|
0
|
|
|
|
|
|
$self->SUPER::start_element({ |
655
|
|
|
|
|
|
|
Name => "image", |
656
|
|
|
|
|
|
|
Attributes => $self->rdf_resource($self->{'__image'}{'url'}), |
657
|
|
|
|
|
|
|
}); |
658
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"image"}); |
659
|
|
|
|
|
|
|
} |
660
|
|
|
|
|
|
|
|
661
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"channel"}); |
662
|
|
|
|
|
|
|
|
663
|
0
|
|
|
|
|
|
$self->add_image(); |
664
|
|
|
|
|
|
|
|
665
|
0
|
|
|
|
|
|
return 1; |
666
|
|
|
|
|
|
|
} |
667
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
sub add_channel_items { |
669
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
670
|
|
|
|
|
|
|
|
671
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"items"}); |
672
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"rdf:Seq"}); |
673
|
|
|
|
|
|
|
|
674
|
0
|
|
|
|
|
|
my $items = XML::Filter::XML_Directory_2RSS::Items->new(Handler=>$self->{Handler}); |
675
|
|
|
|
|
|
|
|
676
|
0
|
|
|
|
|
|
my %exclude = (); |
677
|
0
|
|
|
|
|
|
my %include = (); |
678
|
|
|
|
|
|
|
|
679
|
0
|
0
|
|
|
|
|
if (defined($self->{'__exclude'})) { $exclude{'exclude'} = $self->{'__exclude'}; } |
|
0
|
|
|
|
|
|
|
680
|
0
|
0
|
|
|
|
|
if (defined($self->{'__exclude_starting'})) { $exclude{'starting'} = $self->{'__exclude_starting'}; } |
|
0
|
|
|
|
|
|
|
681
|
0
|
0
|
|
|
|
|
if (defined($self->{'__exclude_ending'})) { $exclude{'ending'} = $self->{'__exclude_ending'}; } |
|
0
|
|
|
|
|
|
|
682
|
0
|
0
|
|
|
|
|
if (defined($self->{'__exclude_matching'})) { $exclude{'matching'} = $self->{'__exclude_matching'}; } |
|
0
|
|
|
|
|
|
|
683
|
0
|
0
|
|
|
|
|
if (defined($self->{'__exclude_subdirs'})) { $exclude{'directories'} = $self->{'__exclude_subdirs'}; } |
|
0
|
|
|
|
|
|
|
684
|
0
|
0
|
|
|
|
|
if (defined($self->{'__exclude_files'})) { $exclude{'files'} = $self->{'__exclude_subdirs'}; } |
|
0
|
|
|
|
|
|
|
685
|
|
|
|
|
|
|
|
686
|
0
|
0
|
|
|
|
|
if (defined($self->{'__include'})) { $include{'include'} = $self->{'__include'}; } |
|
0
|
|
|
|
|
|
|
687
|
0
|
0
|
|
|
|
|
if (defined($self->{'__include_starting'})) { $include{'starting'} = $self->{'__include_starting'}; } |
|
0
|
|
|
|
|
|
|
688
|
0
|
0
|
|
|
|
|
if (defined($self->{'__include_ending'})) { $include{'ending'} = $self->{'__include_ending'}; } |
|
0
|
|
|
|
|
|
|
689
|
0
|
0
|
|
|
|
|
if (defined($self->{'__include_matching'})) { $include{'matching'} = $self->{'__include_matching'}; } |
|
0
|
|
|
|
|
|
|
690
|
0
|
0
|
|
|
|
|
if (defined($self->{'__include_subdirs'})) { $include{'directories'} = $self->{'__include_subdirs'}; } |
|
0
|
|
|
|
|
|
|
691
|
0
|
0
|
|
|
|
|
if (defined($self->{'__include_files'})) { $include{'files'} = $self->{'__include_subdirs'}; } |
|
0
|
|
|
|
|
|
|
692
|
|
|
|
|
|
|
|
693
|
0
|
0
|
|
|
|
|
if (keys %exclude) { $items->exclude(%exclude); } |
|
0
|
|
|
|
|
|
|
694
|
0
|
0
|
|
|
|
|
if (keys %include) { $items->include(%include); } |
|
0
|
|
|
|
|
|
|
695
|
|
|
|
|
|
|
|
696
|
0
|
0
|
|
|
|
|
if ($self->{'__callbacks'}{'link'}) { |
697
|
0
|
|
|
|
|
|
$items->callbacks({link=>$self->{'__callbacks'}->{'link'}}); |
698
|
|
|
|
|
|
|
} |
699
|
|
|
|
|
|
|
|
700
|
0
|
|
|
|
|
|
my $xml_directory = XML::Directory::SAX->new(Handler => $items, |
701
|
|
|
|
|
|
|
depth => $self->{'__depth'}, |
702
|
|
|
|
|
|
|
detail => $self->{'__detail'}); |
703
|
|
|
|
|
|
|
|
704
|
0
|
|
|
|
|
|
$xml_directory->order_by($self->{'__orderby'}); |
705
|
0
|
|
|
|
|
|
$xml_directory->parse_dir($self->{'__path'}); |
706
|
|
|
|
|
|
|
|
707
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"rdf:Seq"}); |
708
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"items"}); |
709
|
|
|
|
|
|
|
} |
710
|
|
|
|
|
|
|
|
711
|
|
|
|
|
|
|
sub add_image { |
712
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
713
|
|
|
|
|
|
|
|
714
|
0
|
0
|
|
|
|
|
if (ref($self->{'__image'}) ne "HASH") { |
715
|
0
|
|
|
|
|
|
return 0; |
716
|
|
|
|
|
|
|
} |
717
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
$self->SUPER::start_element({ |
719
|
0
|
|
|
|
|
|
Name => "image", |
720
|
|
|
|
|
|
|
Attributes => $self->rdf_about($self->{'__image'}{'url'}), |
721
|
|
|
|
|
|
|
}); |
722
|
|
|
|
|
|
|
|
723
|
0
|
|
|
|
|
|
foreach my $el ("title","url","link") { |
724
|
0
|
0
|
|
|
|
|
next if (! defined($self->{'__channel'}{$_})); |
725
|
|
|
|
|
|
|
|
726
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>$_}); |
727
|
0
|
|
|
|
|
|
$self->SUPER::characters({Data=>$self->{'__image'}{$_}}); |
728
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>$_}); |
729
|
|
|
|
|
|
|
} |
730
|
|
|
|
|
|
|
|
731
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"image"}); |
732
|
|
|
|
|
|
|
|
733
|
0
|
|
|
|
|
|
return 1; |
734
|
|
|
|
|
|
|
} |
735
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
sub add_textinput { |
737
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
738
|
|
|
|
|
|
|
|
739
|
0
|
0
|
|
|
|
|
if (ref($self->{'__textinput'}) ne "HASH") { |
740
|
0
|
|
|
|
|
|
return undef; |
741
|
|
|
|
|
|
|
} |
742
|
|
|
|
|
|
|
|
743
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>"textinput"}); |
744
|
|
|
|
|
|
|
|
745
|
0
|
|
|
|
|
|
foreach my $el ("title","description","name","link") { |
746
|
0
|
0
|
|
|
|
|
next if (! defined($self->{'__textinput'}{$_})); |
747
|
|
|
|
|
|
|
|
748
|
0
|
|
|
|
|
|
$self->SUPER::start_element({Name=>$_}); |
749
|
0
|
|
|
|
|
|
$self->SUPER::characters({Data=>$self->{'__textinput'}{$_}}); |
750
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>$_}); |
751
|
|
|
|
|
|
|
} |
752
|
|
|
|
|
|
|
|
753
|
|
|
|
|
|
|
# ti:function/ ti:inputType |
754
|
|
|
|
|
|
|
# Where are the docs for the 'textinput' module? |
755
|
|
|
|
|
|
|
|
756
|
0
|
|
|
|
|
|
$self->SUPER::end_element({Name=>"textinput"}); |
757
|
|
|
|
|
|
|
} |
758
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
=head1 VERSION |
760
|
|
|
|
|
|
|
|
761
|
|
|
|
|
|
|
0.9.1 |
762
|
|
|
|
|
|
|
|
763
|
|
|
|
|
|
|
=head1 DATE |
764
|
|
|
|
|
|
|
|
765
|
|
|
|
|
|
|
May 24, 2002 |
766
|
|
|
|
|
|
|
|
767
|
|
|
|
|
|
|
=head1 AUTHOR |
768
|
|
|
|
|
|
|
|
769
|
|
|
|
|
|
|
Aaron Straup Cope |
770
|
|
|
|
|
|
|
|
771
|
|
|
|
|
|
|
=head1 TO DO |
772
|
|
|
|
|
|
|
|
773
|
|
|
|
|
|
|
=over |
774
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
=item * |
776
|
|
|
|
|
|
|
|
777
|
|
|
|
|
|
|
Proper support for RSS modules. |
778
|
|
|
|
|
|
|
|
779
|
|
|
|
|
|
|
=back |
780
|
|
|
|
|
|
|
|
781
|
|
|
|
|
|
|
=head1 SEE ALSO |
782
|
|
|
|
|
|
|
|
783
|
|
|
|
|
|
|
L |
784
|
|
|
|
|
|
|
|
785
|
|
|
|
|
|
|
L |
786
|
|
|
|
|
|
|
|
787
|
|
|
|
|
|
|
http://groups.yahoo.com/group/rss-dev/files/specification.html |
788
|
|
|
|
|
|
|
|
789
|
|
|
|
|
|
|
=head1 LICENSE |
790
|
|
|
|
|
|
|
|
791
|
|
|
|
|
|
|
Copyright (c) 2002, Aaron Straup Cope. All Rights Reserved. |
792
|
|
|
|
|
|
|
|
793
|
|
|
|
|
|
|
This is free software, you may use it and distribute it under the same terms as Perl itself. |
794
|
|
|
|
|
|
|
|
795
|
|
|
|
|
|
|
=cut |
796
|
|
|
|
|
|
|
|
797
|
|
|
|
|
|
|
return 1; |
798
|
|
|
|
|
|
|
|
799
|
|
|
|
|
|
|
} |