diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index cb769085..be92f8b7 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -181,6 +181,21 @@ class CollectionPolicy extends XMLDatastream { 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 * traversing the XML DOM and building a new DOM. When done diff --git a/ContentModel.inc b/ContentModel.inc index 4cc66976..381fa9ac 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -101,7 +101,7 @@ class ContentModel extends XMLDatastream { return $ret; } - + /** * Ingests a minimum Content Model to the specified pid/dsid. @@ -224,7 +224,7 @@ class ContentModel extends XMLDatastream { parent::__construct($xmlStr, $pid, $dsid); $this->pid_namespace = $pid_namespace; - $this->name = $name; + $this->name = ($name == NULL)?'Islandora Content Model':$name; } /** diff --git a/XMLDatastream.inc b/XMLDatastream.inc index e99cbbca..77c357de 100644 --- a/XMLDatastream.inc +++ b/XMLDatastream.inc @@ -223,7 +223,7 @@ printerWindow.document.write(text); module_load_include('inc', 'Fedora_Repository', 'api/fedora_item'); if ($this->validate()) { $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 FALSE;