Ver Fonte

+ test @selected within context

Piotr Labudda há 7 anos atrás
pai
commit
7c8ee04675

+ 12 - 2
SE/se-lib/Api/Process/P5/GetSelectedFeatures.php

@@ -1,17 +1,27 @@
 <?php
 <?php
 
 
 Lib::loadClass('FeatureAttrSelected');
 Lib::loadClass('FeatureAttrSelected');
+Lib::loadClass('FeatureAttrContextSelected');
 
 
 class Api_Process_P5_GetSelectedFeatures { // TODO: extends Api_ProcessBase
 class Api_Process_P5_GetSelectedFeatures { // TODO: extends Api_ProcessBase
 
 
 	static function run($args, $responseForm) {
 	static function run($args, $responseForm) {
+		DBG::log($args, 'array', "Run WPS Process 'p5:getSelectedFeatures'");
 		$typeName = (!empty($args['typeName'][0])) ? $args['typeName'][0] : '';
 		$typeName = (!empty($args['typeName'][0])) ? $args['typeName'][0] : '';
 		if (!$typeName) throw new Api_OwsException("Missing value for 'typeName'", 501, null, 'MissingParameterValue', 'request');
 		if (!$typeName) throw new Api_OwsException("Missing value for 'typeName'", 501, null, 'MissingParameterValue', 'request');
 		$listPrimaryKeys = (!empty($args['primaryKey'])) ? $args['primaryKey'] : [];
 		$listPrimaryKeys = (!empty($args['primaryKey'])) ? $args['primaryKey'] : [];
 		if (empty($listPrimaryKeys)) throw new Api_OwsException("Missing value for 'primaryKey'", 501, null, 'MissingParameterValue', 'request');
 		if (empty($listPrimaryKeys)) throw new Api_OwsException("Missing value for 'primaryKey'", 501, null, 'MissingParameterValue', 'request');
+		$context = (!empty($args['context'])) ? $args['context'][0] : '';
 
 
-		$listSelectedState = FeatureAttrSelected::getSelectState($typeName, $listPrimaryKeys);
-		$totalSelected = FeatureAttrSelected::getTotalSelected($typeName);
+		if (!empty($context)) {
+			$idContext = (is_numeric($context)) ? $context : FeatureAttrContextSelected::getIdContext($context);
+			DBG::log($args, 'array', "Run WPS Process 'p5:getSelectedFeatures' with context '{$context}' (ID: {$idContext})");
+			$listSelectedState = FeatureAttrContextSelected::getSelectState($idContext, $typeName, $listPrimaryKeys);
+			$totalSelected = FeatureAttrContextSelected::getTotalSelected($idContext, $typeName);
+		} else {
+			$listSelectedState = FeatureAttrSelected::getSelectState($typeName, $listPrimaryKeys);
+			$totalSelected = FeatureAttrSelected::getTotalSelected($typeName);
+		}
 
 
 		header('Content-Type: application/json');
 		header('Content-Type: application/json');
 		echo json_encode([
 		echo json_encode([

+ 206 - 0
SE/se-lib/FeatureAttrContextSelected.php

@@ -0,0 +1,206 @@
+<?php
+
+// TODO: cron task - clear not used tables
+
+class FeatureAttrContextSelected {
+
+	static function getIdContext($context) {
+		try {
+			$idContext = self::_fetchIdContext($context);
+		} catch (Exception $e) {
+			DBG::log($e);
+			if ('42S02' == $e->getCode()) { // SQLSTATE[42S02]: Base table or view not found: 1146 Table 'SES_USERS2.CRM_@SELECTED_CONTEXT' doesn't exist
+				self::_createContextTable();
+				try {
+					$idContext = self::_fetchIdContext($context);
+				} catch (Exception $e) {
+					DBG::log($e);
+					if ('42S02' == $e->getCode()) { // SQLSTATE[42S02]: Base table or view not found: 1146 Table 'SES_USERS2.CRM_@SELECTED_CONTEXT' doesn't exist
+						throw new Exception("Cannot create config table for @selected with context");
+					}
+				}
+				DBG::log("DBG: Created config table for @selected with context");
+			}
+		}
+		if (!$idContext) {
+			try {
+				$idContext = DB::getPDO()->insert('CRM__@SELECTED_CONTEXT', [ 'name' => $context, 'A_CREATE_TIME' => "NOW()", 'A_LAST_ACCESS_TIME' => "NOW()", 'A_LAST_UPDATE_TIME' => "NOW()" ]);
+				DBG::log("DBG: created context ID:{$idContext} for: '{$context}'");
+			} catch (Exception $e) {
+				// TODO: if (cannot add new row - table full)
+				throw $e;
+			}
+		} else {
+			DBG::log("DBG: found context ID:{$idContext} for: '{$context}'");
+			self::_updateLastAccessTime($idContext);
+		}
+		return $idContext;
+	}
+	static function _fetchIdContext($context) {
+		return (int)DB::getPDO()->fetchValue("
+			select ctx.id
+			from `CRM__@SELECTED_CONTEXT` ctx
+			where ctx.name = :name
+		", [ ':name' => $context ]);
+	}
+	static function _createContextTable() {
+		DB::getPDO()->execSql("
+			CREATE TABLE IF NOT EXISTS `CRM__@SELECTED_CONTEXT` (
+				`ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
+				`name` varchar(32) NOT NULL,
+				`A_CREATE_TIME` datetime,
+				`A_LAST_ACCESS_TIME` datetime,
+				`A_LAST_UPDATE_TIME` datetime,
+				PRIMARY KEY (`ID`),
+				UNIQUE KEY `name` (`name`)
+			) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+		");
+	}
+	static function _updateLastAccessTime($idContext) {
+		DB::getPDO()->update('CRM__@SELECTED_CONTEXT', 'ID', $idContext, [ 'A_LAST_ACCESS_TIME' => "NOW()" ]);
+	}
+	static function _updateLastUpdateTime($idContext) {
+		DB::getPDO()->update('CRM__@SELECTED_CONTEXT', 'ID', $idContext, [ 'A_LAST_UPDATE_TIME' => "NOW()" ]);
+	}
+
+	static function getTotalSelected($idContext, $typeName) {
+		$idUser = User::getID();
+		self::prepareUserTable($idContext, $typeName, $idUser);
+		self::_updateLastAccessTime($idContext);
+		$tableName = self::getAttributeTableName($idContext, $typeName, $idUser);
+		return (int)DB::getPDO()->fetchValue("
+			select count(*) as total
+			from `{$tableName}`
+		");
+	}
+
+	static function getSelectState($idContext, $typeName, array $listPrimaryKeys) {
+		$idUser = User::getID();
+		self::prepareUserTable($idContext, $typeName, $idUser);
+		self::_updateLastAccessTime($idContext);
+		$tableName = self::getAttributeTableName($idContext, $typeName, $idUser);
+		if (empty($listPrimaryKeys)) return [];
+		$dbQuote = [ DB::getPDO(), 'quote' ];
+		$sqlPks = implode(", ", array_map(function ($pk) use ($dbQuote) {
+			return $dbQuote($pk);
+		}, $listPrimaryKeys));
+		$selected = DB::getPDO()->fetchValuesListByKey("
+			select primaryKey
+			from `{$tableName}`
+			where primaryKey in ( {$sqlPks} )
+		", $key = 'primaryKey');
+		return array_combine($listPrimaryKeys, array_map(function ($pk) use ($selected) {
+			return in_array($pk, $selected);
+		}, $listPrimaryKeys));
+	}
+
+	static function selectAllByFilter($idContext, $typeName, array $filterQuery) {
+		$idUser = User::getID();
+		self::prepareUserTable($idContext, $typeName, $idUser);
+		$tableName = self::getAttributeTableName($idContext, $typeName, $idUser);
+		$acl = ACL::getAclByTypeName($typeName);
+
+		$args = [];
+		parse_str($filterQuery[0], $args);
+		DBG::log(['$filterQuery' => $filterQuery, '$args' => $args], 'array', "DBG: selectAllByFilter");
+
+		$params = [];
+		$params['limit'] = 0;
+		$params['cols'] = [ $acl->getPrimaryKeyField() ];
+		foreach ($args as $k => $v) {
+			if (strlen($k) > 3 && substr($k, 0, 2) == 'f_' && strlen($v) > 0) {// filter prefix
+				$params[$k] = $v;
+			}
+			else if (strlen($k) > 4 && substr($k, 0, 3) == 'sf_' && strlen($v) > 0) {// special filter prefix
+				$params[$k] = $v;
+			}
+		}
+		$queryFeatures = $acl->buildQuery($params);
+		DBG::log($queryFeatures, 'array', '$queryFeatures');
+		try {
+			$sql = $queryFeatures->getRawQueryPrimaryKeys();
+			DBG::log($sql, 'string', 'sql getRawQueryPrimaryKeys');
+			Lib::loadClass('FeatureAttrSelected');
+			$userSelectedTableName = FeatureAttrSelected::getAttributeTableName($idContext, $typeName = $acl->getNamespace(), $idUser = User::getID());
+			DB::getPDO()->execSql("
+				insert ignore into `{$userSelectedTableName}` (`primaryKey`)
+				select `selectedTable`.`@primaryKey`
+				from ( {$sql} ) as `selectedTable`
+			");
+		} catch (Exception $e) {
+			DBG::log($e);
+			DBG::log('legacyMode - execute query for all primary keys');
+			$listItems = $queryFeatures->getItems();
+			$listPrimaryKeys = array_map(function ($item) {
+				return $item['ID'];
+			}, $listItems);
+			foreach ($listPrimaryKeys as $pk) {
+				DB::getPDO()->execSql(" insert ignore `{$tableName}` (`primaryKey`) values ( :pk ) ", [ ':pk' => $pk ]);
+			}
+		}
+		self::_updateLastUpdateTime($idContext);
+	}
+
+	static function select($idContext, $typeName, array $listPrimaryKeys) {
+		$idUser = User::getID();
+		self::prepareUserTable($idContext, $typeName, $idUser);
+		$tableName = self::getAttributeTableName($idContext, $typeName, $idUser);
+		foreach ($listPrimaryKeys as $pk) {
+			DB::getPDO()->execSql(" insert ignore `{$tableName}` (`primaryKey`) values ( :pk ) ", [ ':pk' => $pk ]);
+		}
+		self::_updateLastUpdateTime($idContext);
+	}
+
+	static function unselect($idContext, $typeName, array $listPrimaryKeys) {
+		$idUser = User::getID();
+		self::prepareUserTable($idContext, $typeName, $idUser);
+		$tableName = self::getAttributeTableName($idContext, $typeName, $idUser);
+		foreach ($listPrimaryKeys as $pk) {
+			DB::getPDO()->execSql(" delete from `{$tableName}` where `primaryKey` = :pk ", [ ':pk' => $pk ]);
+		}
+		self::_updateLastUpdateTime($idContext);
+	}
+
+	static function unselectAll($idContext, $typeName) {
+		$idUser = User::getID();
+		self::prepareUserTable($idContext, $typeName, $idUser);
+		$tableName = self::getAttributeTableName($idContext, $typeName, $idUser);
+		DB::getPDO()->execSql(" truncate table `{$tableName}` ");
+		self::_updateLastUpdateTime($idContext);
+	}
+
+	static function prepareUserTable($idContext, $typeName, $idUser) {
+		static $_created = [];
+		$key = "{$typeName}-{$idContext}-{$idUser}";
+		if (!array_key_exists($key, $_created)) {
+			self::_prepareUserTable($idContext, $typeName, $idUser);
+			$_created[$key] = true;
+		}
+	}
+	static function _prepareUserTable($idContext, $typeName, $idUser) {
+		$tableName = self::getAttributeTableName($idContext, $typeName, $idUser);
+		// TODO: primaryKey type from $acl
+		DB::getPDO()->execSql("
+			CREATE TABLE IF NOT EXISTS `{$tableName}` (
+				`primaryKey` int(11) NOT NULL,
+				UNIQUE KEY `primaryKey` (`primaryKey`)
+			) ENGINE=MyISAM DEFAULT CHARSET=latin2;
+		");
+	}
+
+	// @example FeatureAttrSelected::getAttributeTableName($typeName, $idUser);
+	static function getAttributeTableName($idContext, $typeName, $idUser) {
+		static $_created = [];
+		$key = "{$typeName}-{$idUser}";
+		if (!array_key_exists($key, $_created)) {
+			$_created[$key] = self::_getAttributeTableName($idContext, $typeName, $idUser);
+		}
+		return $_created[$key];
+	}
+	static function _getAttributeTableName($idContext, $typeName, $idUser) {
+		$acl = ACL::getAclByTypeName($typeName);
+		$rootTableName = $acl->getRootTableName();
+		return "{$rootTableName}__@sel_{$idContext}_{$idUser}";
+	}
+
+}

+ 6 - 6
SE/se-lib/FeatureAttrSelected.php

@@ -68,12 +68,13 @@ class FeatureAttrSelected {
 			DBG::log($e);
 			DBG::log($e);
 			DBG::log('legacyMode - execute query for all primary keys');
 			DBG::log('legacyMode - execute query for all primary keys');
 			$listItems = $queryFeatures->getItems();
 			$listItems = $queryFeatures->getItems();
-			print_r($listItems);
+			$listPrimaryKeys = array_map(function ($item) {
+				return $item['ID'];
+			}, $listItems);
+			foreach ($listPrimaryKeys as $pk) {
+				DB::getPDO()->execSql(" insert ignore `{$tableName}` (`primaryKey`) values ( :pk ) ", [ ':pk' => $pk ]);
+			}
 		}
 		}
-
-		// foreach ($listPrimaryKeys as $pk) {
-		// 	DB::getPDO()->execSql(" insert ignore `{$tableName}` (`primaryKey`) values ( :pk ) ", [ ':pk' => $pk ]);
-		// }
 	}
 	}
 
 
 	static function select($typeName, array $listPrimaryKeys) {
 	static function select($typeName, array $listPrimaryKeys) {
@@ -111,7 +112,6 @@ class FeatureAttrSelected {
 	}
 	}
 	static function _prepareUserTable($typeName, $idUser) {
 	static function _prepareUserTable($typeName, $idUser) {
 		$tableName = self::getAttributeTableName($typeName, $idUser);
 		$tableName = self::getAttributeTableName($typeName, $idUser);
-		// DB::getPDO()->execSql(" DROP TABLE IF EXISTS `{$tableName}` ");
 		// TODO: primaryKey type from $acl
 		// TODO: primaryKey type from $acl
 		DB::getPDO()->execSql("
 		DB::getPDO()->execSql("
 			CREATE TABLE IF NOT EXISTS `{$tableName}` (
 			CREATE TABLE IF NOT EXISTS `{$tableName}` (

+ 1 - 0
SE/se-lib/TableAjax.php

@@ -458,6 +458,7 @@ class TableAjax extends ViewAjax {
 		$className = __CLASS__;
 		$className = __CLASS__;
 		UI::inlineJS(__FILE__ . '.init.js', [
 		UI::inlineJS(__FILE__ . '.init.js', [
 			'GUI_SHOW_CHECKBOXES' => ('1' === V::get('TEST_CHECKBOX', '', $_GET)),
 			'GUI_SHOW_CHECKBOXES' => ('1' === V::get('TEST_CHECKBOX', '', $_GET)),
+			'CHECKBOX_ID_CONTEXT' => V::get('TEST_CHECKBOX_CONTEXT', '', $_GET), // TODO: test generate @selected context
 			'TABLE_AJAX_NODE_ID' => $this->_htmlID,
 			'TABLE_AJAX_NODE_ID' => $this->_htmlID,
 			'NAMESPACE' => $acl->getNamespace(),
 			'NAMESPACE' => $acl->getNamespace(),
 			'FUNCTION_HIST_ROUTE' => 'TableAjax__HIST_Route',
 			'FUNCTION_HIST_ROUTE' => 'TableAjax__HIST_Route',

+ 19 - 8
SE/se-lib/TableAjax.php.TableAjax.js

@@ -196,7 +196,8 @@ function selectedStore(state, action) {
 		default: return prevState;
 		default: return prevState;
 	}
 	}
 }
 }
-function selectedActions() {
+function selectedActions(idContext) {
+	var idContext = idContext || null;
 	function setChecked(primaryKey, totalSelected) {
 	function setChecked(primaryKey, totalSelected) {
 		return { type: 'SET_CHECKED', primaryKey: primaryKey, totalSelected: totalSelected }
 		return { type: 'SET_CHECKED', primaryKey: primaryKey, totalSelected: totalSelected }
 	}
 	}
@@ -225,7 +226,9 @@ function selectedActions() {
 			// var state = getState();
 			// var state = getState();
 			dispatch(setLoading(primaryKey));
 			dispatch(setLoading(primaryKey));
 
 
-			var reqPromise = checked ? p5WPS__selecFeature({ typeName: namespace, primaryKey: [ primaryKey ] }) : p5WPS__unselectFeature({ typeName: namespace, primaryKey: [ primaryKey ] });
+			var reqArgs = { typeName: namespace, primaryKey: [ primaryKey ] };
+			if (idContext) reqArgs.idContext = idContext;
+			var reqPromise = checked ? p5WPS__selecFeature(reqArgs) : p5WPS__unselectFeature(reqArgs);
 			return reqPromise.then(function (response) {
 			return reqPromise.then(function (response) {
 				DBG && console.log('DBG::async toggle action: (pk:'+primaryKey+') dispatch...');
 				DBG && console.log('DBG::async toggle action: (pk:'+primaryKey+') dispatch...');
 				dispatch( checked ? setChecked(primaryKey, response.totalSelected) : setUnchecked(primaryKey, response.totalSelected) );
 				dispatch( checked ? setChecked(primaryKey, response.totalSelected) : setUnchecked(primaryKey, response.totalSelected) );
@@ -245,7 +248,9 @@ function selectedActions() {
 			// dispatch( setListLoading(listPrimaryKeys) );
 			// dispatch( setListLoading(listPrimaryKeys) );
 			if (!listPrimaryKeys.length) return;
 			if (!listPrimaryKeys.length) return;
 
 
-			return p5WPS__getSelectedFeatures({ typeName: namespace, primaryKey: listPrimaryKeys }).then(function (listSelected) {
+			var reqArgs = { typeName: namespace, primaryKey: listPrimaryKeys };
+			if (idContext) reqArgs.idContext = idContext;
+			return p5WPS__getSelectedFeatures(reqArgs).then(function (listSelected) {
 				DBG && console.log('DBG::setPrimaryKeys action: (pks:['+listPrimaryKeys.join(',')+']) dispatch success');
 				DBG && console.log('DBG::setPrimaryKeys action: (pks:['+listPrimaryKeys.join(',')+']) dispatch success');
 				dispatch( setListChecked(listSelected.selected, listSelected.totalSelected) );
 				dispatch( setListChecked(listSelected.selected, listSelected.totalSelected) );
 			}).catch(function (e) {
 			}).catch(function (e) {
@@ -266,7 +271,9 @@ function selectedActions() {
 			var state = getState();
 			var state = getState();
 			var listPrimaryKeys = state.listPrimaryKeys;
 			var listPrimaryKeys = state.listPrimaryKeys;
 
 
-			var reqPromise = checked ? p5WPS__selecFeature({ typeName: namespace, primaryKey: listPrimaryKeys }) : p5WPS__unselectFeature({ typeName: namespace, primaryKey: listPrimaryKeys });
+			var reqArgs = { typeName: namespace, primaryKey: listPrimaryKeys };
+			if (idContext) reqArgs.idContext = idContext;
+			var reqPromise = checked ? p5WPS__selecFeature(reqArgs) : p5WPS__unselectFeature(reqArgs);
 			return reqPromise.then(function (response) {
 			return reqPromise.then(function (response) {
 				DBG && console.log('DBG::setPrimaryKeys action: (pks:['+listPrimaryKeys.join(',')+']) dispatch success');
 				DBG && console.log('DBG::setPrimaryKeys action: (pks:['+listPrimaryKeys.join(',')+']) dispatch success');
 				dispatch( checked ? setListChecked(response.selected, response.totalSelected) : setListUnchecked(response.selected, response.totalSelected) );
 				dispatch( checked ? setListChecked(response.selected, response.totalSelected) : setListUnchecked(response.selected, response.totalSelected) );
@@ -283,7 +290,9 @@ function selectedActions() {
 	function unselectAll(namespace) {
 	function unselectAll(namespace) {
 		// dispatch(setLoading());
 		// dispatch(setLoading());
 		return function(dispatch, getState) {
 		return function(dispatch, getState) {
-			var reqPromise = p5WPS__unselecAllFeatures({ typeName: namespace });
+			var reqArgs = { typeName: namespace };
+			if (idContext) reqArgs.idContext = idContext;
+			var reqPromise = p5WPS__unselecAllFeatures(reqArgs);
 			return reqPromise.then(function (response) {
 			return reqPromise.then(function (response) {
 				DBG && console.log('DBG::setPrimaryKeys action: (pks:['+listPrimaryKeys.join(',')+']) dispatch success');
 				DBG && console.log('DBG::setPrimaryKeys action: (pks:['+listPrimaryKeys.join(',')+']) dispatch success');
 				// dispatch( setListChecked(response.selected, response.totalSelected) );
 				// dispatch( setListChecked(response.selected, response.totalSelected) );
@@ -305,7 +314,9 @@ function selectedActions() {
 			var state = getState();
 			var state = getState();
 			var listPrimaryKeys = state.listPrimaryKeys;
 			var listPrimaryKeys = state.listPrimaryKeys;
 
 
-			return p5WPS__selectAllFeaturesMatchingFilter({ typeName: namespace, primaryKey: listPrimaryKeys, filterQuery: filterQuery }).then(function (listSelected) {
+			var reqArgs = { typeName: namespace, primaryKey: listPrimaryKeys, filterQuery: filterQuery };
+			if (idContext) reqArgs.idContext = idContext;
+			return p5WPS__selectAllFeaturesMatchingFilter(reqArgs).then(function (listSelected) {
 				DBG && console.log('DBG::selectAllMatchingFilter dispatch success');
 				DBG && console.log('DBG::selectAllMatchingFilter dispatch success');
 				dispatch( setListChecked(listSelected.selected, listSelected.totalSelected) );
 				dispatch( setListChecked(listSelected.selected, listSelected.totalSelected) );
 			}).catch(function (e) {
 			}).catch(function (e) {
@@ -1350,7 +1361,7 @@ var TableAjax = function() {
 
 
 		if (priv.options.checkboxes) {
 		if (priv.options.checkboxes) {
 			priv.options.selectedStore = createStoreWithThunkMiddleware(selectedStore)
 			priv.options.selectedStore = createStoreWithThunkMiddleware(selectedStore)
-			priv.options.selectedActions = selectedActions()
+			priv.options.selectedActions = selectedActions(idContext = priv.options.checkboxIdContext)
 			if (_uiNodeSelectedInfo) { // must run after priv.initialRender(); - _uiNodeSelectedInfo must exists
 			if (_uiNodeSelectedInfo) { // must run after priv.initialRender(); - _uiNodeSelectedInfo must exists
 				ReactDOM.render(
 				ReactDOM.render(
 					h(P5UI__TableAjaxSelectedInfo, {
 					h(P5UI__TableAjaxSelectedInfo, {
@@ -2387,7 +2398,7 @@ var TableAjax = function() {
 			ReactDOM.render(
 			ReactDOM.render(
 				h(P5UI__TableAjaxFieldCheckboxSearch, {
 				h(P5UI__TableAjaxFieldCheckboxSearch, {
 					namespace: priv.options.namespace,
 					namespace: priv.options.namespace,
-					fieldName: '@selected',
+					fieldName: ( priv.options.checkboxIdContext ? '@sel_' + priv.options.checkboxIdContext : '@selected' ),
 					store: priv.options.filterStore,
 					store: priv.options.filterStore,
 					actions: priv.options.filterActions
 					actions: priv.options.filterActions
 				}),
 				}),

+ 1 - 0
SE/se-lib/TableAjax.php.init.js

@@ -1,6 +1,7 @@
 jQuery(document).ready(function(){
 jQuery(document).ready(function(){
 	jQuery('#' + TABLE_AJAX_NODE_ID).TableAjax({
 	jQuery('#' + TABLE_AJAX_NODE_ID).TableAjax({
 		checkboxes: GUI_SHOW_CHECKBOXES || 0,
 		checkboxes: GUI_SHOW_CHECKBOXES || 0,
+		checkboxIdContext: CHECKBOX_ID_CONTEXT || null,
 		namespace: NAMESPACE,
 		namespace: NAMESPACE,
 		url: URL_LOAD_AJAX_BASE,
 		url: URL_LOAD_AJAX_BASE,
 		getCsvTheGeomAjaxUrl: URL_GET_CSV_THE_GEOM_AJAX,
 		getCsvTheGeomAjaxUrl: URL_GET_CSV_THE_GEOM_AJAX,