NAME

Datahub::Factory::Importer::CollectiveAccess - Import data from a CollectiveAccess instance

SYNOPSIS

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

my $ca = Datahub::Factory->importer('CollectiveAccess')->new(
    endpoint => 'https://my.ca.org/ca',
    username => 'datahub',
    password => 'datahub'
);

$ca->importer->each(sub {
    my $item = shift;
    print Dumper($item);
});

DESCRIPTION

Datahub::Factory::Importer::CollectiveAccess uses Catmandu to fetch a list of records from a CollectiveAccess instance. It returns an Importer.

PARAMETERS

endpoint

URL of the CA instance (e.g. http://demo.collectiveaccess.org).

username

Name of a user that can be used to query the API.

password

Password for the user.

field_list

A list of fields that the CollectiveAccess API should return. Is optional and can be left empty to return the default:

[
    'ca_objects.object_id',
    'ca_objects.preferred_labels',
    'ca_objects.description',
    'ca_objects.subtitle',
    'ca_objects.geonames',
    'ca_objects.lcsh_terms',
    'ca_objects.colour',
    'ca_objects.contentActivity',
    'ca_objects.contentConcept',
    'ca_objects.contentDescription',
    'ca_objects.dimensions.dimensions_width',
    'ca_objects.dimensions.dimensions_height',
    'ca_objects.dimensions.dimensions_depth',
    'ca_objects.dimensions.circumference',
    'ca_objects.dimensions.dimensions_type',
    'ca_objects.materialInfo.materialInfostyle',
    'ca_objects.objectProductionDate',
    'ca_objects.techniqueInfo.techniqueInfodatePeriod',
    'ca_objects.dateText',
    'ca_objects.objectName.objectObjectName',
    'ca_objects.objectWorkPid.objectWorkPidDomain',
    'ca_objects.objectWorkPid.objectWorkPidID',
    'ca_objects.objectRecordPid.objectRecordPidDomain',
    'ca_objects.objectRecordPid.objectRecordPidID',
    'ca_entities.entity_id',
    'ca_entities.relationship_type_code'
]

ATTRIBUTES

importer

A Importer that can be used in your script.

AUTHOR

Pieter De Praetere <pieter at packed.be >

COPYRIGHT

Copyright 2017- PACKED vzw

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Datahub::Factory Catmandu