Rapporto Tecnico, Anno 7, nĀ° 42 maggio 2012 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:oai="http://www.openarchives.org/OAI/2.0/"> oai:fc1.to.cnr.it:openbess:TO043-00003 ā€“ validate directive file ./fedora-modify.sh fc1.to.cnr.it:8080 fedoraAdmin **** bmodify.xml ../logs/log http CONNECTING to Fedora server.... ----- VALIDATING DIRECTIVES FILE ONLY ----Modify Directives File in bmodify.xml same number of files in two folder is Valid ! Time elapsed: 0 seconds A detailed log file was created at ../logs/log ā€“ execute batch modify directives ./fedora-modify.sh fc1.to.cnr.it:8080 fedoraAdmin **** bmodify.xml ../logs/log http YES Edit object datastream, update content: ā€“ read DC datastream content, add new DC element and save directive file (edit.php) #!/usr/bin/php This is a command line PHP script with one option. formatOutput = true; $indoc->preserveWhiteSpace = false; $indoc->load('http://fc1.to.cnr.it:8080/fedora/objects/'.$PID.'/datastreams/DC/content'); $innode = $indoc>getElementsByTagNameNS('http://www.openarchives.org/OAI/2.0/oai_dc/','dc')->item(0); $existid = $indoc>getElementsByTagNameNS('http://purl.org/dc/elements/1.1/','identifier')->item(0); $newidentifier = $indoc>createElement('dc:identifier','http://www.digibess.it/fedora/repository/'.$PID); if ($existid->nextSibling) { $existid->parentNode->insertBefore($newidentifier, $existid->nextSibling); } else { $existid->parentNode->appendChild($newidentifier); } $dom = new DOMDocument('1.0', 'utf-8'); $dom->formatOutput = true; $dom->preserveWhiteSpace = false; $element = $dom->createElement('fbm:batchModify'); $element->setAttribute('xmlns:fbm', 'http://www.fedora.info/definitions/'); $element->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); $element->setAttribute('xsi:schemaLocation', 'http://www.fedora.info/definitions/ http://www.fedora-commons.org/definitions/1/0/api/batchModify-1.1.xsd'); $dom->appendChild($element); $element1 = $dom->createElement('fbm:modifyDatastream'); $element1->setAttribute('pid', $PID); $element1->setAttribute('dsID', 'DC'); $element1->setAttribute('dsControlGroupType', 'X'); $element1->setAttribute('logMessage', 'BatchModify - modifyDatastream'); $element->appendChild($element1); $element2 = $dom->createElement('fbm:xmlData'); $element1->appendChild($element2); 38