Example #1
0
 /**
  * This function modifies inline xml datastreams (ByValue)
  *
  * @access  public
  * @param string $pid The persistant identifier of the object
  * @param string $dsID The name of the datastream
  * @param string $state The datastream state
  * @param string $label The datastream label
  * @param string $dsContent The datastream content
  * @param string $mimetype The mimetype of the datastream
  * @param boolean $versionable Whether to version control this datastream or not
  * @return void
  */
 function callModifyDatastreamByValue($pid, $dsID, $state, $label, $dsContent, $mimetype = 'text/xml', $versionable = "false")
 {
     //		echo "\n\n before tidy for modify ".$dsID." "; echo date("l dS of F Y h:i:s A");
     if ($mimetype == 'text/xml') {
         $config = array('indent' => true, 'input-xml' => true, 'output-xml' => true, 'wrap' => 200);
         $tidy = new tidy();
         $tidy->parseString($dsContent, $config, 'utf8');
         $tidy->cleanRepair();
         $dsContent = $tidy;
     }
     $dsContent = base64_encode(trim($dsContent));
     $logmsg = 'Modifying datastream from Fez';
     if (empty($versionable)) {
         $versionable = 'false';
     }
     if ($versionable == "true") {
         $versionable = 'true';
     } elseif ($versionable == "false") {
         $versionable = 'false';
     }
     $versionable = 'false';
     //overriding this here.
     $parms = array('pid' => $pid, 'dsID' => $dsID, 'altIDs' => array(), 'dsLabel' => $label, new soapval('versionable', 'boolean', $versionable), 'MIMEType' => $mimetype, 'formatURI' => 'unknown', new soapval("dsContent", "base64Binary", $dsContent), 'dsState' => $state, 'logMessage' => $logmsg, 'force' => true);
     $clientM = new soapclienttx($this->UrlM, true);
     $clientM->setCredentials($this->user, $this->pwd);
     $result = $clientM->call('modifyDatastreamByValue', $parms);
     // print_r($result);
 }
Example #2
0
 function addDatastream($path, $pid, $label, $type, $group, $state, $log)
 {
     $clientM = new soapclienttx($this->UrlM, true);
     $clientM->setCredentials($this->user, $this->pwd);
     $arg_a = array('pid' => $pid, 'dsID' => null, 'altIDs' => array(), 'dsLabel' => $label, 'versionable' => true, 'MIMEType' => $type, 'formatURI' => "", 'dsLocation' => $path, 'controlGroup' => $group, 'dsState' => $state, 'logMessage' => $log);
     $clientM = new soapclienttx($this->UrlM, true);
     $clientM->setCredentials($this->user, $this->pwd);
     $result = $clientM->call('addDatastream', $arg_a);
     if (is_array($result)) {
         echo "<b><u>" . $path . "</u></b> failed to be ingested <br />";
     } else {
         echo "Datastream for pid: <b><u>" . $pid . "</u></b> successfully ingested <br />";
     }
     //print_r($result);
 }