/*
* Load the dataset: Ecoplan from Ghent API
* init: Initialize the API with certain URI
* getEcoplan: Get the Ecplan JSON data
*/
var EcoplanAPI = {
	init: function(connString) {
		this._connString = connString;
	},
	getEcoplan: function() {
		var url = this._connString;
		return Utils.getJSONByPromise(url);
	}
}

/*
* DbContext for Ecoplan
* CRUD operations
*/
var EcoplanDbContext = {
	init: function(connString) {
		this._connString = connString;// Connection string to the localstorage
		// Create an initial object --> save later
		this._appData = {
			"information": {
				"title": "Ghent Ecoplan Application",
				"modified": new Date(),
				"version": "1.0.0",
				"author": "Philippe De Pauw - Waterschoot"
			},
			"ecoplan": [],
			"settings": {}	
		};
		// Get the application data from the localstorage, if not present save the data above in the localstorage
		if(Utils.store(this._connString) != null) {
			this._appData = Utils.store(this._connString);
		} else {
			Utils.store(this._connString, this._appData);
		}
	}
}
@@ -1029,12 +1029,441 @@
 a);%0A%09%09%7D%0A
+%09%7D,%0A%09getEcoplan: function() %7B%0A%09%09return this._appData.ecoplan;%0A%09%7D,%0A%09addEcoplanPlace: function(ecoplanPlace) %7B%0A%09%09ecoplanPlace.id = Utils.guid();// Create an unique id%0A%09%09ecoplanPlace.createdAt = new Date();// Creation Date for the current ecoplan place%0A%09%09%0A%09%09this._appData.ecoplan.push(ecoplanPlace);// Add to array%0A%09%09this.save();// Save in the localstorage%0A%09%09%0A%09%7D,%0A%09save: function() %7B%0A%09%09Utils.store(this._connString, this._appData);%0A
 %09%7D%0A%7D

Update Ecoplan App