Skip to content

Commit

Permalink
added dc:description.abstract with path to tulane item, doesn"t get i…
Browse files Browse the repository at this point in the history
…ngested right...
  • Loading branch information
flummingbird committed Jul 26, 2017
1 parent 2c9a58b commit 826ee6e
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/writers/LsuOaipmh.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,24 @@ public function writeMetadataFile($metadata, $path, $overwrite = true)
$doc->loadXML($metadata);
$doc->formatOutput = true;
$root = $doc->getElementsByTagNameNS('http://www.openarchives.org/OAI/2.0/oai_dc/','dc')->item(0);
$elem = $doc->getElementsByTagNameNS('http://purl.org/dc/elements/1.1/','identifier');
$pid_elem = $elem->item(0)->textContent;

//grab existing element identifier which has tulane:item
$elem_id = $doc->getElementsByTagNameNS('http://purl.org/dc/elements/1.1/','identifier');
$pid_elem = $elem_id->item(0)->textContent;
$pid_path = 'http://digitallibrary.tulane.edu/islandora/object/'.$pid_elem;

//new path added as element to root then
$link_back = $doc->createElementNS('http://purl.org/dc/elements/1.1/','dc:identifier',$pid_path);
$root->appendChild($link_back);

//make new element desc.abs
$dc_desc_abs = $doc->createElementNS('http://purl.org/dc/elements/1.1/', 'description.abstract', $pid_path);
$root->appendChild($dc_desc_abs);

//confirm element added
$print_check = $doc->getElementsByTagNameNS('http://purl.org/dc/elements/1.1/','description.abstract');
var_dump($print_check->item(0)->textContent);

$metadata = $doc->saveXML();

if ($path !='') {
Expand Down

0 comments on commit 826ee6e

Please sign in to comment.