File Coverage

blib/lib/Datahub/Factory/Pipeline.pm
Criterion Covered Total %
statement 12 20 60.0
branch n/a
condition n/a
subroutine 4 8 50.0
pod 0 3 0.0
total 16 31 51.6


line stmt bran cond sub pod time code
1             package Datahub::Factory::Pipeline;
2              
3 1     1   7 use Datahub::Factory::Sane;
  1         3  
  1         8  
4              
5             our $VERSION = '1.75';
6              
7 1     1   395 use Moose::Role;
  1         431487  
  1         36  
8 1     1   4812 use Config::Simple;
  1         3  
  1         10  
9 1     1   47 use namespace::clean;
  1         2  
  1         7  
10              
11             has file_name => (is => 'ro', required => 1);
12             has config => (is => 'lazy');
13              
14             requires 'parse';
15              
16             sub _build_config {
17 0     0     my $self = shift;
18 0           return new Config::Simple($self->file_name);
19             }
20              
21             sub plugin_options {
22 0     0 0   my ($self, $plugin_type, $plugin_name) = @_;
23 0           return $self->block_options(sprintf('plugin_%s_%s', $plugin_type, $plugin_name));
24             }
25              
26             sub module_options {
27 0     0 0   my ($self, $module_name) = @_;
28 0           return $self->block_options(sprintf('module_%s', $module_name));
29             }
30              
31             sub block_options {
32 0     0 0   my ($self, $plugin_block_name) = @_;
33 0           return $self->config->get_block($plugin_block_name);
34             }
35              
36             1;
37              
38             __END__
39              
40             =encoding utf-8
41              
42             =head1 NAME
43              
44             Datahub::Factory::Pipeline - The Pipeline configuration handler class.
45              
46             =head1 DESCRIPTION
47              
48             This class reads, parses and validates a pipeline INI configuration file and
49             stores the resulting configuration in a hash. This hash is used in the transport
50             command.
51              
52             A pipeline is a transport line between two systems. In the realm of Digital
53             Culture and GLAM (Galleries, Libraries, Archives & Museums) this will typically
54             be a connection between the API's of a registration or records management system
55             and an intermediary system (i.e. aggregator) or a consumer application (i.e.
56             website)
57              
58             The structure of the hash looks like this:
59              
60             my $opts = {
61             id_path => 'path_to_identifier',
62             importer => {
63             name => 'Name of the importer',
64             options => { ... }
65             },
66             exporter => {
67             name => 'Name of the exporter',
68             options => { ... }
69             },
70             fixers => {
71             'fixer_foo' => {
72             name => 'Name of the fixer foo',
73             options => { ... }
74             },
75             'fixer_bar' => {
76             name => 'Name of the fixer bar',
77             options => { ... }
78             }
79             }
80             };
81              
82             =head1 AUTHORS
83              
84             Pieter De Praetere <pieter@packed.be>
85             Matthias Vandermaesen <matthias.vandermaesen@vlaamsekunstcollectie.be>
86              
87             =head1 COPYRIGHT
88              
89             Copyright 2016 - PACKED vzw, Vlaamse Kunstcollectie vzw
90              
91             =head1 LICENSE
92              
93             This library is free software; you can redistribute it and/or modify
94             it under the terms of the GPLv3.
95              
96             =cut
97              
98              
99