Browse Source

Partial fix for ISLANDORA-134. Saves XML datastreams using the mimetype application/xml (instead of null) and also uses the label 'Collection Policy' for collection policies and 'Islandora Content Model' for content models (by default). This may or may not resolve the issue of the datstream being switched to managed content. Needs to be verified on the demos collection.

pull/105/head
mroy 14 years ago
parent
commit
19fb1623e0
  1. 15
      CollectionPolicy.inc
  2. 4
      ContentModel.inc
  3. 2
      XMLDatastream.inc

15
CollectionPolicy.inc

@ -181,6 +181,21 @@ class CollectionPolicy extends XMLDatastream {
return $ret; return $ret;
} }
/**
* Constructor
* NOTE: Use the static constructor methods whenever possible.
*
* @param string $xmlStr
* @param string $pid
* @param string $dsid
* @return XMLDatastream $cm
*/
public function __construct($xmlStr, $pid = NULL, $dsid = NULL) {
parent::__construct($xmlStr,$pid,$dsid);
$this->name= 'Collection Policy';
}
/** /**
* Attempts to convert from the old XML schema to the new by * Attempts to convert from the old XML schema to the new by
* traversing the XML DOM and building a new DOM. When done * traversing the XML DOM and building a new DOM. When done

4
ContentModel.inc

@ -101,7 +101,7 @@ class ContentModel extends XMLDatastream {
return $ret; return $ret;
} }
/** /**
* Ingests a minimum Content Model to the specified pid/dsid. * Ingests a minimum Content Model to the specified pid/dsid.
@ -224,7 +224,7 @@ class ContentModel extends XMLDatastream {
parent::__construct($xmlStr, $pid, $dsid); parent::__construct($xmlStr, $pid, $dsid);
$this->pid_namespace = $pid_namespace; $this->pid_namespace = $pid_namespace;
$this->name = $name; $this->name = ($name == NULL)?'Islandora Content Model':$name;
} }
/** /**

2
XMLDatastream.inc

@ -223,7 +223,7 @@ printerWindow.document.write(text);
module_load_include('inc', 'Fedora_Repository', 'api/fedora_item'); module_load_include('inc', 'Fedora_Repository', 'api/fedora_item');
if ($this->validate()) { if ($this->validate()) {
$item = new Fedora_Item($this->pid); $item = new Fedora_Item($this->pid);
$item->modify_datastream_by_value($this->dumpXml(), $this->dsid, $this->name, NULL); $item->modify_datastream_by_value($this->dumpXml(), $this->dsid, $this->name, 'application/xml');
return TRUE; return TRUE;
} }
return FALSE; return FALSE;

Loading…
Cancel
Save