Author: ygrego Date: 2015-05-26 08:29:55 +0000 (Tue, 26 May 2015) New Revision: 1459 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1459 Log: Addition of a new method "_createDocument". Modified: oipf/js/impl/OipfObjectFactory.js Modified: oipf/js/impl/OipfObjectFactory.js =================================================================== --- oipf/js/impl/OipfObjectFactory.js 2015-05-26 08:18:32 UTC (rev 1458) +++ oipf/js/impl/OipfObjectFactory.js 2015-05-26 08:29:55 UTC (rev 1459) @@ -5,7 +5,24 @@ * \brief Provide access to components of a terminal supporting OIFP specification. */ var OipfObjectFactory = Class.extend({ - + + _createDocument: function(filename, callbackName) { + var self = this; + if (window.XMLHttpRequest) { + this.xmlHttpRequest = new XMLHttpRequest(); + this.xmlHttpRequest.open("GET", filename); + this.xmlHttpRequest.send(); + this.xmlHttpRequest.onload = function() { + if(this.status == 200 && this.responseXML != null) { + self[callbackName].call(self, this.responseXML); + console.log("A new doument has been created."); + } else { + console.log("An error occured during the document creation."); + } + }; + } + }, + init: function(modelFactory, dateUtils) { console.log("[INFO] constructor of OipfObjectFactory class called."); this.applicationManagerObject = new ApplicationManagerObject();
participants (1)
-
ygregoï¼ users.nuiton.org