From dfc02ccb7749fcc2d5e858ce47e899881731534e Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Wed, 25 Apr 2012 12:20:32 +0000 Subject: [PATCH] Bug fixes: add the namespace definition to the delta and cope with empty deltas SVN:trunk[1973] --- setup/modelfactory.class.inc.php | 42 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index 67f4125e9..803c8274b 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -13,37 +13,11 @@ require_once(APPROOT.'setup/moduleinstaller.class.inc.php'); - - /** - * ModelFactoryItem: an item managed by the ModuleFactory - * @package ModelFactory - */ -abstract class MFItem -{ - public function __construct() - { - } - - /** - * List the source files for this item - */ - public function ListSources() - { - - } - /** - * List the rights/restrictions for this item - */ - public function ListRights() - { - - } -} /** * ModelFactoryModule: the representation of a Module (i.e. element that can be selected during the setup) * @package ModelFactory */ -class MFModule extends MFItem +class MFModule { protected $sId; protected $sName; @@ -1537,6 +1511,20 @@ class MFDocument extends DOMDocument parent::loadXML($source, LIBXML_NOBLANKS); } + /** + * Overload the standard API + */ + public function saveXML(DOMNode $node = null, $options = 0) + { + $oRootNode = $this->firstChild; + if (!$oRootNode) + { + $oRootNode = $this->createElement('itop_design'); // make sure that the document is not empty + $this->appendChild($oRootNode); + } + $oRootNode->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); + return parent::saveXML(); + } /** * For debugging purposes */