line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Datahub::Factory::MSK; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
52162
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
1; |
7
|
|
|
|
|
|
|
__END__ |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=encoding utf-8 |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Datahub::Factory::Importer::MSK - Import data from L<Adlib|http://www.adlibsoft.nl/> data dumps as used by the L<MSK|http://mskgent.be/nl> |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 SYNOPSIS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use Datahub::Factory::Importer::MSK; |
18
|
|
|
|
|
|
|
use Data::Dumper qw(Dumper); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $msk = Datahub::Factory::Importer::MSK->new( |
21
|
|
|
|
|
|
|
file_name => '/tmp/msk.xml', |
22
|
|
|
|
|
|
|
data_path => 'recordList.record.*' |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
$msk->importer->each(sub { |
26
|
|
|
|
|
|
|
my $item = shift; |
27
|
|
|
|
|
|
|
print Dumper($item); |
28
|
|
|
|
|
|
|
}); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 DESCRIPTION |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Datahub::Factory::Importer::MSK uses L<Catmandu|http://librecat.org/Catmandu/> to fetch a list of records |
33
|
|
|
|
|
|
|
from an AdlibXML data dump generated by the L<MSK|http://mskgent.be/nl>. It returns an L<Importer|Catmandu::Importer>. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 PARAMETERS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=over |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item C<file_name> |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Location of the Adlib XML data dump. It expects AdlibXML. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item C<data_path> |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Optional parameter that indicates where the records are in the XML tree. It uses L<Catmandu::Fix|https://github.com/LibreCat/Catmandu/wiki/Fixes-Cheat-Sheet> syntax. |
46
|
|
|
|
|
|
|
By default, records are in the C<recordList.record.*> path. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=back |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=over |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=item C<importer> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
A L<Importer|Catmandu::Importer> that can be used in your script. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=back |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 AUTHOR |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Pieter De Praetere E<lt>pieter at packed.be E<gt> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 COPYRIGHT |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Copyright 2017- PACKED vzw |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 LICENSE |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
71
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SEE ALSO |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
L<Datahub::Factory> |
76
|
|
|
|
|
|
|
L<Datahub::Factory::Adlib> |
77
|
|
|
|
|
|
|
L<Catmandu> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |