瀏覽代碼

Bug fixes: add the namespace definition to the delta and cope with empty deltas

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1973 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 13 年之前
父節點
當前提交
0ad4dad90b
共有 1 個文件被更改,包括 15 次插入27 次删除
  1. 15 27
      setup/modelfactory.class.inc.php

+ 15 - 27
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;
@@ -1538,6 +1512,20 @@ class MFDocument extends DOMDocument
 	}
 
 	/**
+	 * 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
 	 */
 	public function Dump()