Skip to content

Commit

Permalink
Added oai support for multiple contribute nodes,
Browse files Browse the repository at this point in the history
added new xerte identifier
  • Loading branch information
TimoBoer committed Jan 11, 2023
1 parent 6a3cace commit 5c02366
Showing 1 changed file with 57 additions and 40 deletions.
97 changes: 57 additions & 40 deletions oai-pmh/oaiserver.php
Expand Up @@ -429,6 +429,20 @@ private function add_metadata($metadataPrefix,$cur_record, $record)
$langstring_node = $this->response->addChild($description_node, 'langstring', "The date the object was last modified.");
$langstring_node->setAttribute("xml:lang", $language);

$contribute_node = $this->response->addChild($lifecycle_node, 'contribute');
$role_node = $this->response->addChild($contribute_node, 'role');
$source_node = $this->response->addChild($role_node, 'source');
$langstring_node = $this->response->addChild($source_node, 'langstring', "LOMv1.0");
$langstring_node->setAttribute("xml:lang", "x-none");

$value_node = $this->response->addChild($role_node, 'value');
$langstring_node = $this->response->addChild($value_node, 'langstring', "technical implementer");
$langstring_node->setAttribute("xml:lang", "x-none");

$centity_node = $this->response->addChild($role_node, 'centity');
$vcard = "BEGIN:VCARD VERSION:3.0 FN:Xerte UID:https://www.xerte.org.uk END:VCARD";
$this->response->addChild($centity_node, 'vcard', $vcard);

// METAMETADATA - metadataschema
$metametadata_node = $this->response->addChild($schema_node, 'metametadata');
$this->response->addChild($metametadata_node, 'metadatascheme', "LOMv1.0");
Expand Down Expand Up @@ -513,51 +527,54 @@ private function add_metadata($metadataPrefix,$cur_record, $record)
$langstring_node->setAttribute("xml:lang", "x-none");

// CLASSIFICATION - domain
$classification_node = $this->response->addChild($schema_node, 'classification');
$purpose_node = $this->response->addChild($classification_node, 'purpose');
$source_node = $this->response->addChild($purpose_node, 'source');
$langstring_node = $this->response->addChild($source_node, 'langstring', "LOMv1.0");
$langstring_node->setAttribute("xml:lang", "x-none");
$value_node = $this->response->addChild($purpose_node, 'value');
$langstring_node = $this->response->addChild($value_node, 'langstring', "discipline");
$langstring_node->setAttribute("xml:lang", "x-none");

$taxonpath_node = $this->response->addChild($classification_node, 'taxonpath');
$source_node = $this->response->addChild($taxonpath_node, 'source');
$domain_source = $record['metadata']['classification']['domain_source'];
$langstring_node = $this->response->addChild($source_node, 'langstring', "http://purl.edustandaard.nl/begrippenkader");
$langstring_node->setAttribute("xml:lang", "x-none");
$domain_id = $record['metadata']['classification']['domain_id'];
$taxon_node = $this->response->addChild($taxonpath_node, 'taxon');
$this->response->addChild($taxon_node, 'id', $domain_id);
$entry_node = $this->response->addChild($taxon_node, 'entry');
$domain = $record['metadata']['classification']['domain'];
$langstring_node = $this->response->addChild($entry_node, 'langstring', $domain);
$langstring_node->setAttribute("xml:lang", "nl");
$domain_id = $record['metadata']['classification']['domain_id'];
foreach ($domain as $key => $value) {
$classification_node = $this->response->addChild($schema_node, 'classification');
$purpose_node = $this->response->addChild($classification_node, 'purpose');
$source_node = $this->response->addChild($purpose_node, 'source');
$langstring_node = $this->response->addChild($source_node, 'langstring', "LOMv1.0");
$langstring_node->setAttribute("xml:lang", "x-none");
$value_node = $this->response->addChild($purpose_node, 'value');
$langstring_node = $this->response->addChild($value_node, 'langstring', "discipline");
$langstring_node->setAttribute("xml:lang", "x-none");

$taxonpath_node = $this->response->addChild($classification_node, 'taxonpath');
$source_node = $this->response->addChild($taxonpath_node, 'source');
$domain_source = $record['metadata']['classification']['domain_source'];
$langstring_node = $this->response->addChild($source_node, 'langstring', "http://purl.edustandaard.nl/begrippenkader");
$langstring_node->setAttribute("xml:lang", "x-none");
$taxon_node = $this->response->addChild($taxonpath_node, 'taxon');
$this->response->addChild($taxon_node, 'id', $domain_id[$key]);
$entry_node = $this->response->addChild($taxon_node, 'entry');
$langstring_node = $this->response->addChild($entry_node, 'langstring', $value);
$langstring_node->setAttribute("xml:lang", "nl");
}

// CLASSIFICATION education - level

$classification_node = $this->response->addChild($schema_node, 'classification');
$purpose_node = $this->response->addChild($classification_node, 'purpose');
$source_node = $this->response->addChild($purpose_node, 'source');
$langstring_node = $this->response->addChild($source_node, 'langstring', "LOMv1.0");
$langstring_node->setAttribute("xml:lang", "x-none");
$value_node = $this->response->addChild($purpose_node, 'value');
$langstring_node = $this->response->addChild($value_node, 'langstring', "educational level");
$langstring_node->setAttribute("xml:lang", "x-none");

$taxonpath_node = $this->response->addChild($classification_node, 'taxonpath');
$source_node = $this->response->addChild($taxonpath_node, 'source');
$education_source = "http://purl.edustandaard.nl/begrippenkader";
$langstring_node = $this->response->addChild($source_node, 'langstring', $education_source);
$langstring_node->setAttribute("xml:lang", "x-none");
$level_id = $record['metadata']['classification']['levelId'];
$taxon_node = $this->response->addChild($taxonpath_node, 'taxon');
$this->response->addChild($taxon_node, 'id', $level_id);
$entry_node = $this->response->addChild($taxon_node, 'entry');
$level = $record['metadata']['classification']['level'];
$langstring_node = $this->response->addChild($entry_node, 'langstring', $level);
$langstring_node->setAttribute("xml:lang", 'nl');
foreach ($level as $key => $value) {
$classification_node = $this->response->addChild($schema_node, 'classification');
$purpose_node = $this->response->addChild($classification_node, 'purpose');
$source_node = $this->response->addChild($purpose_node, 'source');
$langstring_node = $this->response->addChild($source_node, 'langstring', "LOMv1.0");
$langstring_node->setAttribute("xml:lang", "x-none");
$value_node = $this->response->addChild($purpose_node, 'value');
$langstring_node = $this->response->addChild($value_node, 'langstring', "educational level");
$langstring_node->setAttribute("xml:lang", "x-none");

$taxonpath_node = $this->response->addChild($classification_node, 'taxonpath');
$source_node = $this->response->addChild($taxonpath_node, 'source');
$education_source = "http://purl.edustandaard.nl/begrippenkader";
$langstring_node = $this->response->addChild($source_node, 'langstring', $education_source);
$langstring_node->setAttribute("xml:lang", "x-none");
$taxon_node = $this->response->addChild($taxonpath_node, 'taxon');
$this->response->addChild($taxon_node, 'id', $level_id[$key]);
$entry_node = $this->response->addChild($taxon_node, 'entry');
$langstring_node = $this->response->addChild($entry_node, 'langstring', $value);
$langstring_node->setAttribute("xml:lang", 'nl');
}

// CLASSIFICATION accesrights
$classification_node = $this->response->addChild($schema_node, 'classification');
Expand Down

0 comments on commit 5c02366

Please sign in to comment.