You are here

public function FeedsOAIParser::getMappingSources in Feeds OAI-PMH Fetcher and Parser 6

Same name and namespace in other branches
  1. 7 FeedsOAIParser.inc \FeedsOAIParser::getMappingSources()

Return mapping sources.

Overrides FeedsParser::getMappingSources

File

./FeedsOAIParser.inc, line 64
Implementation of FeedsParser::parse().

Class

FeedsOAIParser
Class definition for OAI-PMH Dublin Core metadata parser.

Code

public function getMappingSources() {
  self::loadMappers();
  $sources = array();
  drupal_alter('feeds_parser_sources', $sources, feeds_importer($this->id)->config['content_type']);
  $sources += array(
    'guid' => array(
      'name' => t('Repository Record identifier'),
      'description' => t('A unique string per each metadata record, defined by the repository.'),
    ),
    'timestamp' => array(
      'name' => t('Record publication date'),
      'description' => t("Date this metadata record was published on the repository. Different from the described item's publication date."),
    ),
    'metadata_record_url' => array(
      'name' => t('Raw metadata record URL'),
      'description' => t("The URL to a GetRecord OAI request for the source metadata record. Note: This URL will return raw XML data."),
    ),
    'url' => array(
      'name' => t('URL to resource'),
      'description' => t('All valid URLs detected in dc:identifier elements.'),
    ),
    'setspec_raw' => array(
      'name' => t('Set: setSpec (raw value)'),
      'description' => t("The set/setSpec from the record's header."),
    ),
    'setspec_name' => array(
      'name' => t('Set: name'),
      'description' => t("The set name for this record, taken from the repository's identify response."),
    ),
  );

  // Add dublin core field to mapping sources
  $elements = array(
    'title',
    'type',
    'subject',
    'contributor',
    'creator',
    'description',
    'publisher',
    'date',
    'format',
    'identifier',
    'source',
    'language',
    'relation',
    'coverage',
    'rights',
  );
  foreach ($elements as $element) {
    $sources[$element] = array(
      'name' => t('Metadata: dc:@element', array(
        '@element' => $element,
      )),
      'description' => t('From the metadata record.'),
    );
  }
  return $sources;
}