Skip to content

Add a raw_parser option to support directly uploading LIDO XML #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions lib/Datahub/Factory/Exporter/Datahub.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package Datahub::Factory::Exporter::Datahub;

use Datahub::Factory::Sane;
use Data::Dumper qw(Dumper);

our $VERSION = '1.73';

Expand All @@ -16,16 +17,18 @@ has oauth_client_id => (is => 'ro', required => 1);
has oauth_client_secret => (is => 'ro', required => 1);
has oauth_username => (is => 'ro', required => 1);
has oauth_password => (is => 'ro', required => 1);
has raw_parser => (is => 'ro', default => sub { return 0; });

sub _build_out {
my $self = shift;
my $store = Catmandu->store(
'Datahub',
url => $self->datahub_url,
client_id => $self->oauth_client_id,
client_secret => $self->oauth_client_secret,
username => $self->oauth_username,
password => $self->oauth_password
url => $self->datahub_url,
client_id => $self->oauth_client_id,
client_secret => $self->oauth_client_secret,
username => $self->oauth_username,
password => $self->oauth_password,
raw_parser => $self->raw_parser
);
return $store;
}
Expand Down Expand Up @@ -58,7 +61,8 @@ Datahub::Factory::Exporter::Datahub - Export items to a Datahub instance
oauth_client_id => 'mydatahub',
oauth_client_secret => 'thedatahub',
oauth_username => 'datahub',
oauth_password => 'adatahub'
oauth_password => 'adatahub',
raw_parser => 0
};

my $exporter = Datahub::Factory->exporter('Datahub')->new($datahub_options);
Expand Down Expand Up @@ -99,6 +103,11 @@ Datahub username. Required.

Datahub password. Required.

=item C<raw_parser>

If the input was parsed by the raw XML parser (Catmandu::Importer::OAI::Parser::raw), set this to 1 to pass the XML directly to the exporter.


=back

=head1 AUTHORS
Expand Down