Catmandu-MediaHaven

 view release on metacpan or  search on metacpan

lib/Catmandu/Exporter/MediaHaven.pm  view on Meta::CPAN

    my $result = $self->mediahaven->edit($id,$key,$json);

    if (defined($result) && $result->{ok}) {
        return 1;
    }
    else {

        $self->log->error("failed to update $id");
        return 0;
    }
}

sub commit { 1 }

1;

__END__

=pod

=head1 NAME

Catmandu::Exporter::MediaHaven - a exporter that updates Zeticon MediaHaven records

=head1 SYNOPSIS

    # From the commandline
    $ cat catmandu.yml
    ---
    exporter:
         mh:
             package: MediaHaven
             options:
                 url: https://archief.viaa.be/mediahaven-rest-api/resources/media
                 username: ...
                 password: ...
                 json_key: description

    $ catmandu convert YAML to mh < records.yml

=head2 DESCRIPTION

This Exporter will convert metadata records into a JSON encoded field in the
MediaHaven database. A `json_key` is required. This is the field were the JSON
encoded data is stored.

Attn: take some seconds/minutes to have the metadata updates available and
indexed in the backend database.
 
=head1 METHODS

=head2 new(%connection_parameters)

Create a new Catmandu::Store::File::MediaHaven with the following connection
parameters:

=over

=item url

Required. The URL to the MediaHaven REST endpoint.

=item username

Required. Username used to connect to MediaHaven.

=item password

Required. Password used to connect to MediaHaven.

=item json_key

Required. The metdata field where the record data as a JSON blob is stored

=item record_query

Optional. MediaHaven query to extract a record '_id' from the database.
Default: "q=%%2B(MediaObjectFragmentId:%s)"

=back

=head1 INHERITED METHODS

This Catmandu::Exporter::MediaHaven implements

=over 3

=item L<Catmandu::Exporter>

=item L<Catmandu::Logger>

=item L<Catmandu::Addable>

=item L<Catmandu::Fixable>

=item L<Catmandu::Counter>

=back

=head1 SEE ALSO

L<Catmandu::Importer::MediaHaven>

=cut



( run in 0.886 second using v1.01-cache-2.11-cpan-364913b4093 )