INNOV-AI

Innovation and Research from Réunion Island, France

Back   Home

Generate a SCRUD page into a WEB application @ DEVEL - Development @ MentDB Weak

> Start the server
> (or start the server for the first time (embedded mode - H2 Database))
> (or start the server for the first time (remote mode - MySQL 8 Database))
> Open the MentDB Weak Editor

Create a Web application: Click here...

MQL INPUT
#Create the table for the demonstration;
sql connect "session1" {cm get "MENTDB";};
sql dml "session1" (concat "CREATE TABLE product (
	id BIGINT NOT NULL AUTO_INCREMENT,
	name varchar(255) NOT NULL ,
	quantity INT NOT NULL,
	PRIMARY KEY (id)
);");
sql disconnect "session1";
MQL OUTPUT
"1"

Click on CRUD button

Double click on the 'MENTDB' database...

Double click on the 'product' table...

Select the app context 'demo_test_app', change 'app.100.template.default.actions.' by 'app.100.template.test_app.actions.', select CRUD options for each field, and click on 'GENERATE SCRUD OPERATIONS ...'

MQL INPUT
exception (1) ("DELETE THIS TO EXECUTE...");

script merge "app.100.template.test_app.actions.MENTDB.product.list.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  )
  "Get data from a database into a list ..."
{
	
	#Load the current object id and his configuration;
	-> "[OBJECT_ID]" "MENTDB_product_list";
	include "app.100.scrud.overwrite_config.exe"
		"[OBJ_PARAM_LIST]" "container_id,page,nb_by_page,nb_lr_pagination,order_by,filter_sql"
	;
	
	if (equal [nb_by_page] "*") {-> "[nb_by_page]" 999999999};
	if (is empty [order_by]) {
		-> "[asc_desc]" "ASC|";
		-> "[cur_asc_desc]" "";
		-> "[cur_order_by]" "";
	} {
		-> "[cur_asc_desc]" (atom get [order_by] 1 "|");
		-> "[cur_order_by]" (atom get [order_by] 2 "|");
		if (string starts_with [order_by] "ASC|") {
			-> "[asc_desc]" "DESC|";
		} {
			-> "[asc_desc]" "";
		};
	};

	#Initialization;
	-> "[object]" "<div style='border: 1px solid rgba(0,0,0,.12);-webkit-border-radius: 3px;
		-moz-border-radius: 3px;border-radius: 3px;
		margin-top: 2px;margin-bottom: 2px;padding:5px;background-color:#fff;color:#313131'>";

	if (app is_granted_a "demo_test_app.MENTDB.product.list.delete") {concat_var "[object]" "<span style='float:right'><button type='button' class='btn btn-danger btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.delete_confirm.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "get_all_checked('product_keys_checkbox')") "><span class='fa fa-remove fa-sm' aria-hidden='true'></span></button></span>";};
	if (app is_granted_a "demo_test_app.MENTDB.product.list.insert") {concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-success btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.insert_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></span>";};
	if (app is_granted_a "demo_test_app.MENTDB.product.list.search") {concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.search_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-search fa-sm' aria-hidden='true'></span></button></span>";};

	concat_var "[object]" "
	<span style='font-size:16px'><b>  " (string first_letter_upper (translate get "demo_test_app_MENTDB_product_list_title" [app_lang])) "</b></span>
	
	<div style='height:10px;'></div>
	<form name='integrated_product_search_form_id' id='integrated_product_search_form_id' action='index.jsp' method='post' style='font-size:14px'>
	<table class='table table-striped table-hover table-bordered' style='margin-bottom: 0px;'>
  <thead>
    <tr>";
	
	#Connect to the database;
	sql connect "session1" {cm get "MENTDB";};

	try {
		
		if (not (is null or empty [filter_sql])) {
			json load "filter_sql" [filter_sql];
		} {
			json load "filter_sql" "{}";
		};
		
		#concat the row title counter;
		concat_var "[object]" "
      <th style='width:44px;padding: 0px 0px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' id='product_main_checkbox' onchange='check_all(\"product_keys_checkbox\", this);'></div></th>
      <th scope='col' style='padding: 0px;'>
      	<input name='name' id='name' type='text' class='form-control' value='" (string replace (json select "filter_sql" "/name") "'" "'") "' placeholder='' style='' onkeydown='if (event.key === 'Enter' || event.keyCode === 13) {execute_script('YXBwLjEwMC50ZW1wbGF0ZS50ZXN0X2FwcC5hY3Rpb25zLk1FTlREQi5wcm9kdWN0LnNlYXJjaC5leGU=', 'e30=', '', 'JCgnI2ludGVncmF0ZWRfcHJvZHVjdF9zZWFyY2hfZm9ybV9pZCcpLnNlcmlhbGl6ZU9iamVjdCgp');}'>
      	<a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "name") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "name")}} {(concat "ASC|" "name")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (translate get "demo_test_app_MENTDB_product_list_col_name" [app_lang]) (if (equal [cur_order_by] "name") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a>
      </th>
      <th scope='col' style='padding: 0px;'>
      	<input name='quantity' id='quantity' type='text' class='form-control' value='" (string replace (json select "filter_sql" "/quantity") "'" "'") "' placeholder='' style='' onkeydown='if (event.key === 'Enter' || event.keyCode === 13) {execute_script('YXBwLjEwMC50ZW1wbGF0ZS50ZXN0X2FwcC5hY3Rpb25zLk1FTlREQi5wcm9kdWN0LnNlYXJjaC5leGU=', 'e30=', '', 'JCgnI2ludGVncmF0ZWRfcHJvZHVjdF9zZWFyY2hfZm9ybV9pZCcpLnNlcmlhbGl6ZU9iamVjdCgp');}'>
      	<a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "quantity") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "quantity")}} {(concat "ASC|" "quantity")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (translate get "demo_test_app_MENTDB_product_list_col_quantity" [app_lang]) (if (equal [cur_order_by] "quantity") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a>
      </th>
      <th scope='col' style='width:20px;padding: 0px;'></th>
	</tr>
  </thead>
  <tbody>";
		
		-> "[sql_filter]" "";
		-> "[sql_filter_keys]" "";
		if (not (is null or empty [filter_sql])) {
			json load "filter_sql" [filter_sql];
			json parse_obj "filter_sql" "/" "[key]" "[val]" {

				if (not (string starts_with [key] "type:")) {
					switch (json select "filter_sql" (concat "/type:" [key]))
						("EQUAL") {concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
						("LIKE_L") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "'";}
						("LIKE_R") {concat_var "[sql_filter]" " and `" [key] "` like '" (string sublrchar (sql encode [val]) 1) "%'";}
						("LIKE_LR") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "%'";}
						{concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
					;
					concat_var "[sql_filter_keys]" "<span class='badge badge-light'>" [key] "</span> ";
				};
			
			};
	
			if (> (json count "filter_sql" "/") 0) {
				-> "[sql_filter]" (concat " WHERE " (string substring [sql_filter] 5));
				-> "[sql_filter_keys]" (concat "<h5 style='margin-top: 1px;margin-bottom:0px'><button type='button' style='margin-left: 10px;' class='btn btn-outline-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"filter_sql\":{}}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-remove fa-xs' aria-hidden='true'></span> " (translate get "demo_test_app_MENTDB_product_list_filter" [app_lang]) "(s)</button></h5>");
			};
		};

		-> "[iline]" (+ 1 (- (* [page] [nb_by_page]) [nb_by_page]));
		-> "[nb_elements]" (sql value "session1" (concat "select count(*) from `product` " [sql_filter] ""));
		-> "[nb_page]" (math ceil (/ [nb_elements] [nb_by_page]));
		if (is empty [cur_order_by]) {
			-> "[sql_order_by]" "";
		} {
			-> "[sql_order_by]" (concat "order by `" [cur_order_by] "` " [cur_asc_desc]);
		};

		-> "[app_is_granted_update]" (app is_granted_a "demo_test_app.MENTDB.product.list.update");
		
		sql parse "session1" "T" (concat "select 
			`id`, 
			`name`, 
			`quantity` from `product` " [sql_filter] " " [sql_order_by] " limit " (- (* [page] [nb_by_page]) [nb_by_page]) ", " [nb_by_page] "") {
			
			json load "primary_key" "{}";
			json iobject "primary_key" / "client_data" "{}" OBJ;
			json iobject "primary_key" "/client_data" "id" [T_id] STR;
			
      		
			concat_var "[object]" "
      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='product_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_name] "<" "<") "</td>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_quantity] "<" "<") "</td>";

			if ([app_is_granted_update]) {
				concat_var "[object]" "<td style='padding: 0px 2px 0px 2px;'><button type='button' class='btn btn-warning btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span class='fa fa-pencil fa-sm' aria-hidden='true'></span></button></td>";
			} {
				concat_var "[object]" "<td style='padding: 0px 2px 0px 2px;'></td>";
			};
			concat_var "[object]" "</tr>";

      		++ "[iline]";
		
		};
    
		concat_var "[object]" "
	</tbody>
</table>
</form>
";

	concat_var "[object]" "<nav aria-label='Page navigation' style='display:inline-block'>
  <ul class='pagination' style='margin-bottom:0px'>
    <li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" 1 "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Previous'>
        <span aria-hidden='true'>«</span>
        <span class='sr-only'>Previous</span>
      </a>
    </li>";

	for (-> "[i_page]" (- [page] [nb_lr_pagination])) (< [i_page] [page]) (++ "[i_page]") {

		if (> [i_page] 0) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link' style='z-index:0;'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};

	for (-> "[i_page]" [page]) (<= [i_page] (+ [page] [nb_lr_pagination])) (++ "[i_page]") {

		if (<= [i_page] [nb_page]) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link' style='z-index:0;'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};
    
    concat_var "[object]" "<li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [nb_page] "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>
        <span aria-hidden='true'>»</span>
        <span class='sr-only'>Next</span>
      </a>
    </li>
  </ul>
</nav>   " (+ 1 (- (* [page] [nb_by_page]) [nb_by_page])) " - " (if (> (* [page] [nb_by_page]) [nb_elements]) {[nb_elements]} {* [page] [nb_by_page]}) " / " [nb_elements] "
  <div style='float: right;display: inline-block;'><select id='app.100.template.test_app.actions.MENTDB.product.list.key.nb_by_page' style='height: 33px;color: #007bff;' class='form-control' onChange=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"order_by\":\"\", \"page\":\"1\"}") "[getElementById]" "nb_by_page=app.100.template.test_app.actions.MENTDB.product.list.key.nb_by_page" "[data]" "") ">
      <option " (if (== [nb_by_page] 1) {"selected"}) ">1</option>
      <option " (if (== [nb_by_page] 2) {"selected"}) ">2</option>
      <option " (if (== [nb_by_page] 3) {"selected"}) ">3</option>
      <option " (if (== [nb_by_page] 4) {"selected"}) ">4</option>
      <option " (if (== [nb_by_page] 5) {"selected"}) ">5</option>
      <option " (if (== [nb_by_page] 10) {"selected"}) ">10</option>
      <option " (if (== [nb_by_page] 12) {"selected"}) ">12</option>
      <option " (if (== [nb_by_page] 14) {"selected"}) ">14</option>
      <option " (if (== [nb_by_page] 16) {"selected"}) ">16</option>
      <option " (if (== [nb_by_page] 18) {"selected"}) ">18</option>
      <option " (if (== [nb_by_page] 20) {"selected"}) ">20</option>
      <option " (if (== [nb_by_page] 25) {"selected"}) ">25</option>
      <option " (if (== [nb_by_page] 50) {"selected"}) ">50</option>
      <option " (if (== [nb_by_page] 100) {"selected"}) ">100</option>
      <option " (if (== [nb_by_page] 250) {"selected"}) ">250</option>
      <option " (if (== [nb_by_page] 500) {"selected"}) ">500</option>
      <option " (if (== [nb_by_page] 1000) {"selected"}) ">1000</option>
      <option " (if (== [nb_by_page] 2500) {"selected"}) ">2500</option>
      <option " (if (== [nb_by_page] 5000) {"selected"}) ">5000</option>
      <option " (if (== [nb_by_page] 999999999) {"selected"}) ">*</option>
    </select></div><div style='float: right;display: inline-block;line-height: 32px;margin-right: 20px;'>" [sql_filter_keys] "</div>

</div>";

		sql disconnect "session1";

		include "app.100.obj.sajax.refresh.exe"
			"[target]" [container_id]
			"[innerHtml]" [object]
		;

	} {

		#Save the error;
		log trace [err]; 
		
		#Close all objects;
		try {sql disconnect "session1";} {} "[e]";

		exception (1) (concat "ERR/APP/LIST: " [err]);

	} "[err]";
	
} "Return the list";
	
script merge "app.100.template.test_app.actions.MENTDB.product.search_open_form.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  )
  "Open a search form ..."
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "product_search_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (translate get "demo_test_app_MENTDB_product_search_title" [app_lang]) 
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";

	-> "[filter_sql]" (json select "app" (concat "/objects/MENTDB_product_list/filter_sql"));
	if (not (is null or empty [filter_sql])) {
		json load "filter_sql" [filter_sql];
	} {
		json load "filter_sql" "{}";
	};
			
		
		
		# -------- name --------;

			if (is null (json select "filter_sql" "/name")) {
				json iobject "filter_sql" / "name" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (translate get "demo_test_app_MENTDB_product_search_field_name" [app_lang]) "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/name")
			;
		
		# -------- quantity --------;

			if (is null (json select "filter_sql" "/quantity")) {
				json iobject "filter_sql" / "quantity" "" STR;
			};
		
			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "quantity" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (translate get "demo_test_app_MENTDB_product_search_field_quantity" [app_lang]) "[description]" "" "[maxlength]" ""
				"[min]" 0 "[max]" 100 "[step]" 1 "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/quantity")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "product_search_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.test_app.actions.MENTDB.product.search.exe"
		"[data_eval]" "$('#product_search_form_id').serializeObject()"
		"[closeTitle]" (translate get "demo_test_app_MENTDB_product_search_close_button" [app_lang])
		"[submitTitle]" (translate get "demo_test_app_MENTDB_product_search_search_button" [app_lang])
		"[submitType]" "primary";
	
} "Return the form";
	
script merge "app.100.template.test_app.actions.MENTDB.product.search.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  )
  "Insert a new element ..."
{

	try {
		
		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json load "filter_sql" "{\"filter_sql\":{}}";
		json iobject "filter_sql" / "page" 1 STR;

		if (not (is null or empty (json select "data" "/client_data/name"))) {
			json iobject "filter_sql" "/filter_sql" "name" (json select "data" "/client_data/name") STR;
			json iobject "filter_sql" "/filter_sql" "type:name" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/quantity"))) {
			json iobject "filter_sql" "/filter_sql" "quantity" (json select "data" "/client_data/quantity") STR;
			json iobject "filter_sql" "/filter_sql" "type:quantity" "EQUAL" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};
		
		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "filter_sql"))
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";
	
script merge "app.100.template.test_app.actions.MENTDB.product.insert_open_form.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  )
  "Open an insert form ..."
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "product_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (translate get "demo_test_app_MENTDB_product_insert_title" [app_lang])
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		
		
		# -------- name --------;
				
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (translate get "demo_test_app_MENTDB_product_insert_field_name" [app_lang]) "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		# -------- quantity --------;
		
			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "quantity" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (translate get "demo_test_app_MENTDB_product_insert_field_quantity" [app_lang]) "[description]" "" "[maxlength]" ""
				"[min]" "" "[max]" "" "[step]" "" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" 0

			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "product_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.test_app.actions.MENTDB.product.insert.exe"
		"[data_eval]" "$('#product_insert_form_id').serializeObject()"
		"[closeTitle]" (translate get "demo_test_app_MENTDB_product_insert_close_button" [app_lang])
		"[submitTitle]" (translate get "demo_test_app_MENTDB_product_insert_insert_button" [app_lang])
		"[submitType]" "primary";
	
} "Return the form";
	
script merge "app.100.template.test_app.actions.MENTDB.product.insert_reopen_form.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  )
  "Reopen an insert form ..."
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "product_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (translate get "demo_test_app_MENTDB_product_insert_title_re" [app_lang])
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		
		
		# -------- name --------;
				
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (translate get "demo_test_app_MENTDB_product_insert_field_name" [app_lang]) "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/name")
			;
		
		# -------- quantity --------;
		
			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "quantity" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (translate get "demo_test_app_MENTDB_product_insert_field_quantity" [app_lang]) "[description]" "" "[maxlength]" ""
				"[min]" "" "[max]" "" "[step]" "" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/quantity")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "product_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.test_app.actions.MENTDB.product.insert.exe"
		"[data_eval]" "$('#product_insert_form_id').serializeObject()"
		"[closeTitle]" (translate get "demo_test_app_MENTDB_product_insert_close_button" [app_lang])
		"[submitTitle]" (translate get "demo_test_app_MENTDB_product_insert_insert_button" [app_lang])
		"[submitType]" "primary";
	
} "Return the form";
	
script merge "app.100.template.test_app.actions.MENTDB.product.insert.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  )
  "Insert a new element ..."
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
		sql auto_commit "session1" false;

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);
		
		-> "[result]" (sql dml "session1" (concat 
			"INSERT INTO `product` (
			`name`, 
			`quantity`
			) VALUES (
			" (sql encode (json select "data" "/client_data/name")) ", 
			" (sql encode (json select "data" "/client_data/quantity")) "
			)"
		));

		-> "[LAST_INSERT_ID]" (sql value "session1" (concat "SELECT LAST_INSERT_ID()"));
		
		
		
		json load "option" "{}";
		json iobject "option" / "key" [LAST_INSERT_ID] STR;
		include "app.100.template.admin.lib.history.exe"
			"[sessionSql]" "session1"
			"[login]" (json select "app" /user)
			"[object]" "product"
			"[action]" "insert"
			"[option]" (json doc "option")
		;
		
		#Disconnection ...;
		sql commit "session1";
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (concat "
			" (translate get "demo_test_app_MENTDB_product_insert_ok" [app_lang]))
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql rollback "session1"} {} "[sub_sql]";
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.test_app.actions.MENTDB.product.insert_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";
	
script merge "app.100.template.test_app.actions.MENTDB.product.update_open_form.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  )
  "Open an update form ..."
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {
		
		#Connect to the database;
		sql connect "session1" {cm get "MENTDB";};
		json load "row" (sql row "session1" (concat "select 
			`id`, 
			`name`, 
			`quantity` from `product` where `id`= " (sql encode (json select "data" "/client_data/id")) " "));
	
		#Disconnection ...;
		sql disconnect "session1";

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		exception (1) ([err]);
		
	} "[err]";

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "product_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (translate get "demo_test_app_MENTDB_product_update_title" [app_lang])
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
			# -------- id --------;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]"(json select "row" "/id")
			;
		
		
			
			# -------- name --------;
				
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (translate get "demo_test_app_MENTDB_product_update_field_name" [app_lang]) "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/name")
			;
			
			# -------- quantity --------;
		
			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "quantity" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (translate get "demo_test_app_MENTDB_product_update_field_quantity" [app_lang]) "[description]" "" "[maxlength]" ""
				"[min]" "" "[max]" "" "[step]" "" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/quantity")
			;
	
	include "app.100.obj.form.end.exe" "[form_id]" "product_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.test_app.actions.MENTDB.product.update.exe"
		"[data_eval]" "$('#product_update_form_id').serializeObject()"
		"[closeTitle]" (translate get "demo_test_app_MENTDB_product_update_close_button" [app_lang])
		"[submitTitle]" (translate get "demo_test_app_MENTDB_product_update_update_button" [app_lang])
		"[submitType]" "warning";
	
} "Return the form";
	
script merge "app.100.template.test_app.actions.MENTDB.product.update_reopen_form.exe" false 1

  (param
  	(var "[container_id]" {true} "" is_null:false is_empty:false "container1")
  )
  "Reopen an update form ..."
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "product_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (translate get "demo_test_app_MENTDB_product_update_title_re" [app_lang])
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
			# -------- id --------;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]" (json select "data" "/client_data/id")
			;
		
		
			
			# -------- name --------;
				
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "name" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (translate get "demo_test_app_MENTDB_product_update_field_name" [app_lang]) "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/name")
			;
			
			# -------- quantity --------;
		
			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "quantity" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (translate get "demo_test_app_MENTDB_product_update_field_quantity" [app_lang]) "[description]" "" "[maxlength]" ""
				"[min]" "" "[max]" "" "[step]" "" "[placeholder]" ""
				"[readonly]" false "[required]" true "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/quantity")
			;
	
	include "app.100.obj.form.end.exe" "[form_id]" "product_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.test_app.actions.MENTDB.product.update.exe"
		"[data_eval]" "$('#product_update_form_id').serializeObject()"
		"[closeTitle]" (translate get "demo_test_app_MENTDB_product_update_close_button" [app_lang])
		"[submitTitle]" (translate get "demo_test_app_MENTDB_product_update_update_button" [app_lang])
		"[submitType]" "warning";
	
} "Return the form";
	
script merge "app.100.template.test_app.actions.MENTDB.product.update.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  )
  "Update an element ..."
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
		sql auto_commit "session1" false;

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);
		
		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `product` SET 
			`name`=" (sql encode (json select "data" "/client_data/name")) ", 
			`quantity`=" (sql encode (json select "data" "/client_data/quantity")) "
			WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
			"
		));
		
		
		
		json load "option" "{}";
		json iobject "option" / "where" (concat "`id`= " (sql encode (json select "data" "/client_data/id")) " ") STR;
		include "app.100.template.admin.lib.history.exe"
			"[sessionSql]" "session1"
			"[login]" (json select "app" /user)
			"[object]" "product"
			"[action]" "update"
			"[option]" (json doc "option")
		;
		
		#Disconnection ...;
		sql commit "session1";
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (concat "
			" (translate get "demo_test_app_MENTDB_product_update_ok" [app_lang]))
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql rollback "session1"} {} "[sub_sql]";
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.test_app.actions.MENTDB.product.update_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";
	
script merge "app.100.template.test_app.actions.MENTDB.product.delete_confirm.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  )
  "Open a confirm dialog box for delete ..."
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "product_delete_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (concat 
					(translate get "demo_test_app_MENTDB_product_delete_title_1" [app_lang]) (json count "data" "/client_data") 
					(translate get "demo_test_app_MENTDB_product_delete_title_2" [app_lang]))
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-md"
				"[html]" "style='font-size:14px'";
			
		include "app.100.obj.form.end.exe" "[form_id]" "product_delete_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		"[container_id]" ""
		"[mql_script]" "app.100.template.test_app.actions.MENTDB.product.delete.exe"
		"[data_eval]" ""
		"[closeTitle]" (translate get "demo_test_app_MENTDB_product_delete_cancel_button" [app_lang])
		"[submitTitle]" (if (> (json count "data" "/client_data") 0) {translate get "demo_test_app_MENTDB_product_delete_delete_button" [app_lang]} {""})
		"[submitType]" "danger";
	
} "Return the form";
	
script merge "app.100.template.test_app.actions.MENTDB.product.delete.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  )
  "Delete elements ..."
{

	json load "client_data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {

		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
		sql auto_commit "session1" false;
	
		json parse_array "client_data" "/client_data" "[o]" {
		
			json load "data" [o];
	
			-> "[result]" (sql dml "session1" (concat 
				"DELETE FROM `product` 
				WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
				"
			));

			json load "option" "{}";
			json iobject "option" / "where" (concat "`id`= " (sql encode (json select "data" "/client_data/id")) " ") STR;
			include "app.100.template.admin.lib.history.exe"
				"[sessionSql]" "session1"
				"[login]" (json select "app" /user)
				"[object]" "product"
				"[action]" "delete"
				"[option]" (json doc "option")
			;
			
		};
		
		#Disconnection ...;
		sql commit "session1";
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (concat "
			" (translate get "demo_test_app_MENTDB_product_delete_ok" [app_lang]))
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"page\":\"1\"}")
		;

	} {

		#Close the connection;
		try {sql rollback "session1"} {} "[sub_sql]";
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;

	} "[err]";
	
} "Return OK or KO";
	
script merge "app.100.template.test_app.actions.MENTDB.product.skeleton.exe" false 1

  (param
  )
  "SCRUD skeleton ..."
{

	if (app is_granted_a "demo_test_app.MENTDB.product.list.show") {

		include "app.100.obj.sajax.skeleton.container.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
			include "app.100.obj.sajax.skeleton.row.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
				include "app.100.obj.sajax.skeleton.col.exe" "[id]" "MENTDB_product" "[name]" "" "[class]" "col-12 col-xs-12 col-sm-12 col-md-12 col-lg-12" "[style]" "padding-left:0px;padding-right:0px";
				
				include "app.100.obj.sajax.skeleton.div.end.exe";
			include "app.100.obj.sajax.skeleton.div.end.exe";
		include "app.100.obj.sajax.skeleton.div.end.exe";
	
		include "app.100.obj.sajax.skeleton.onload.exe"
			"[scriptname]" "app.100.template.test_app.actions.MENTDB.product.onload.exe"
			"[client_data]" (json select "app" "/param")
		;

	};
	
} "Return the page";
	
script merge "app.100.template.test_app.actions.MENTDB.product.onload.exe" false 1

  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  )
  "Execute this script on load ..."
{

	include "app.100.obj.sajax.server.exe"
		"[scriptname]" "app.100.template.test_app.actions.MENTDB.product.list.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"container_id\":\"MENTDB_product\", \"page\":\"1\", \"nb_by_page\":\"14\", \"nb_lr_pagination\":\"4\", \"order_by\":\"\"}")
	;
	
} "Reload all blocs";
	
script merge "app.100.template.test_app.actions.MENTDB.product.init_lang.exe" false 1

  (param
  )
  "Execute this script to init lang ..."
{

	translate set "demo_test_app_MENTDB_product_list_title" en "product list";
	translate set "demo_test_app_MENTDB_product_list_filter" en "Filter";
	translate set "demo_test_app_MENTDB_product_search_title" en "Search a product";
	translate set "demo_test_app_MENTDB_product_search_close_button" en "Close";
	translate set "demo_test_app_MENTDB_product_search_search_button" en "Search";
	translate set "demo_test_app_MENTDB_product_insert_title" en "Insert a product";
	translate set "demo_test_app_MENTDB_product_insert_close_button" en "Close";
	translate set "demo_test_app_MENTDB_product_insert_insert_button" en "Insert";
	translate set "demo_test_app_MENTDB_product_insert_title_re" en "Insert a product (reopen)";
	translate set "demo_test_app_MENTDB_product_insert_ok" en "Element added with successfull.";
	translate set "demo_test_app_MENTDB_product_update_title" en "Update a product";
	translate set "demo_test_app_MENTDB_product_update_close_button" en "Close";
	translate set "demo_test_app_MENTDB_product_update_update_button" en "Update";
	translate set "demo_test_app_MENTDB_product_update_title_re" en "Update a product (reopen)";
	translate set "demo_test_app_MENTDB_product_update_ok" en "Element updated with successfull.";
	translate set "demo_test_app_MENTDB_product_delete_title_1" en "Delete of ";
	translate set "demo_test_app_MENTDB_product_delete_title_2" en " element(s)";
	translate set "demo_test_app_MENTDB_product_delete_cancel_button" en "Cancel";
	translate set "demo_test_app_MENTDB_product_delete_delete_button" en "Delete";
	translate set "demo_test_app_MENTDB_product_delete_ok" en "Element(s) deleted with successfull.";
	
	translate set "demo_test_app_MENTDB_product_list_title" fr "Liste des product";
	translate set "demo_test_app_MENTDB_product_list_filter" fr "Filtre";
	translate set "demo_test_app_MENTDB_product_search_title" fr "Rechercher des product";
	translate set "demo_test_app_MENTDB_product_search_close_button" fr "Fermer";
	translate set "demo_test_app_MENTDB_product_search_search_button" fr "Rechercher";
	translate set "demo_test_app_MENTDB_product_insert_title" fr "Ajouter un product";
	translate set "demo_test_app_MENTDB_product_insert_close_button" fr "Fermer";
	translate set "demo_test_app_MENTDB_product_insert_insert_button" fr "Ajouter";
	translate set "demo_test_app_MENTDB_product_insert_title_re" fr "Ajouter un product (réouverture)";
	translate set "demo_test_app_MENTDB_product_insert_ok" fr "Elément ajouté avec succès.";
	translate set "demo_test_app_MENTDB_product_update_title" fr "Modifier un product";
	translate set "demo_test_app_MENTDB_product_update_close_button" fr "Fermer";
	translate set "demo_test_app_MENTDB_product_update_update_button" fr "Modifier";
	translate set "demo_test_app_MENTDB_product_update_title_re" fr "Modifier un product (réouverture)";
	translate set "demo_test_app_MENTDB_product_update_ok" fr "Elément modifié avec succès.";
	translate set "demo_test_app_MENTDB_product_delete_title_1" fr "Suppression de ";
	translate set "demo_test_app_MENTDB_product_delete_title_2" fr " élément(s)";
	translate set "demo_test_app_MENTDB_product_delete_cancel_button" fr "Annuler";
	translate set "demo_test_app_MENTDB_product_delete_delete_button" fr "Supprimer";
	translate set "demo_test_app_MENTDB_product_delete_ok" fr "Elément(s) suprimé(s) avec succès.";
	
	translate set "demo_test_app_MENTDB_product_list_col_id" en "id";
	translate set "demo_test_app_MENTDB_product_list_col_id" fr "id";
	translate set "demo_test_app_MENTDB_product_search_field_id" en "id";
	translate set "demo_test_app_MENTDB_product_search_field_id" fr "id";
	translate set "demo_test_app_MENTDB_product_insert_field_id" en "id";
	translate set "demo_test_app_MENTDB_product_insert_field_id" fr "id";
	translate set "demo_test_app_MENTDB_product_update_field_id" en "id";
	translate set "demo_test_app_MENTDB_product_update_field_id" fr "id";
	
	translate set "demo_test_app_MENTDB_product_list_col_name" en "name";
	translate set "demo_test_app_MENTDB_product_list_col_name" fr "name";
	translate set "demo_test_app_MENTDB_product_search_field_name" en "name";
	translate set "demo_test_app_MENTDB_product_search_field_name" fr "name";
	translate set "demo_test_app_MENTDB_product_insert_field_name" en "name";
	translate set "demo_test_app_MENTDB_product_insert_field_name" fr "name";
	translate set "demo_test_app_MENTDB_product_update_field_name" en "name";
	translate set "demo_test_app_MENTDB_product_update_field_name" fr "name";
	
	translate set "demo_test_app_MENTDB_product_list_col_quantity" en "quantity";
	translate set "demo_test_app_MENTDB_product_list_col_quantity" fr "quantity";
	translate set "demo_test_app_MENTDB_product_search_field_quantity" en "quantity";
	translate set "demo_test_app_MENTDB_product_search_field_quantity" fr "quantity";
	translate set "demo_test_app_MENTDB_product_insert_field_quantity" en "quantity";
	translate set "demo_test_app_MENTDB_product_insert_field_quantity" fr "quantity";
	translate set "demo_test_app_MENTDB_product_update_field_quantity" en "quantity";
	translate set "demo_test_app_MENTDB_product_update_field_quantity" fr "quantity";
	
} "Nothing";

	sql connect "session1" {cm get "MENTDB";};
	
	sql dml "session1" (concat "INSERT IGNORE INTO `tags` (`id`) VALUES ('demo_test_app.MENTDB.product.list.show');");
	sql dml "session1" (concat "INSERT IGNORE INTO `tags` (`id`) VALUES ('demo_test_app.MENTDB.product.list.insert');");
	sql dml "session1" (concat "INSERT IGNORE INTO `tags` (`id`) VALUES ('demo_test_app.MENTDB.product.list.update');");
	sql dml "session1" (concat "INSERT IGNORE INTO `tags` (`id`) VALUES ('demo_test_app.MENTDB.product.list.delete');");
	sql dml "session1" (concat "INSERT IGNORE INTO `tags` (`id`) VALUES ('demo_test_app.MENTDB.product.list.search');");
	
	sql disconnect "session1";

	##############################;
	
	# 1 - Load translate key;
	#execute "app.100.template.test_app.actions.MENTDB.product.init_lang.exe";
	
	# 2 - Write this into the home page;
	#include "app.100.template.test_app.actions.MENTDB.product.skeleton.exe";
	
	# 3 - Set 'order by' by default;
	#     - in .list.exe;
	
	# 4 - Set 'readonly, required, disabled';
	#     - in .search_open_form.exe;
	#     - in .insert_open_form.exe;
	#     - in .insert_reopen_form.exe;
	#     - in .update_open_form.exe;
	#     - in .update_reopen_form.exe;
	
	# 5 - Set default controls;
	#     - in .search_open_form.exe;
	#     - in .insert_open_form.exe;
	#     - in .insert_reopen_form.exe;
	#     - in .update_open_form.exe;
	#     - in .update_reopen_form.exe;
	
MQL OUTPUT (ERROR)
'line 1 >>> exception 1; "\"DELETE THIS TO EXECUTE...\";" ; 1: DELETE THIS TO EXECUTE...'

Delete the first line 'exception (1) ("DELETE THIS TO EXECUTE...");' and execute the script...

MQL OUTPUT
"This is a comment ..."

Open the defaut home page of your new application:

MQL INPUT
script merge "app.100.template.test_app.page.home.exe" false 1 
  (param
  ;) 
  "Show the home page" 
{

	include (concat "app." [app_version] ".template." [app_template] ".html.body_top.exe");

	#____________________________________________________________;

	#Your container code here;
	include "app.100.obj.sajax.skeleton.container.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
		include "app.100.obj.sajax.skeleton.row.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
			include "app.100.obj.sajax.skeleton.col.exe" "[id]" "container_id_1" "[name]" "" "[class]" "col-12 col-xs-12 col-sm-12 col-md-12 col-lg-12" "[style]" ""; include "app.100.obj.sajax.skeleton.div.end.exe";
		include "app.100.obj.sajax.skeleton.div.end.exe";
	include "app.100.obj.sajax.skeleton.div.end.exe";

	include "app.100.obj.sajax.skeleton.onload.exe"
		"[scriptname]" (concat "app." [app_version] ".template." [app_template] ".page.home.onload.exe")
		"[client_data]" (json select "app" "/param")
	;
	
	#____________________________________________________________;
	
	include (concat "app." [app_version] ".template." [app_template] ".html.body_bottom.exe");

;} "The 'home' page";

Add the generated skeleton in : include "app.100.template.test_app.actions.MENTDB.product.skeleton.exe";

MQL INPUT
script merge "app.100.template.test_app.page.home.exe" false 1 
  (param
  ;) 
  "Show the home page" 
{

	include (concat "app." [app_version] ".template." [app_template] ".html.body_top.exe");

	#____________________________________________________________;

	#Your container code here;
	include "app.100.template.test_app.actions.MENTDB.product.skeleton.exe";
	
	#____________________________________________________________;
	
	include (concat "app." [app_version] ".template." [app_template] ".html.body_bottom.exe");

;} "The 'home' page";
MQL OUTPUT
"Script merged with successful."

Reload your connected home page: 

You can see here all your generated SCRUD script for the product table ...

Update the init_lang script: 

MQL INPUT
script merge "app.100.template.test_app.actions.MENTDB.product.init_lang.exe" false 1 
  (param
  ;) 
  "Execute this script to init lang ..." 
{

	translate set "demo_test_app_MENTDB_product_list_title" en "product list";
	translate set "demo_test_app_MENTDB_product_list_filter" en "Filter";
	translate set "demo_test_app_MENTDB_product_search_title" en "Search a product";
	translate set "demo_test_app_MENTDB_product_search_close_button" en "Close";
	translate set "demo_test_app_MENTDB_product_search_search_button" en "Search";
	translate set "demo_test_app_MENTDB_product_insert_title" en "Insert a product";
	translate set "demo_test_app_MENTDB_product_insert_close_button" en "Close";
	translate set "demo_test_app_MENTDB_product_insert_insert_button" en "Insert";
	translate set "demo_test_app_MENTDB_product_insert_title_re" en "Insert a product (reopen)";
	translate set "demo_test_app_MENTDB_product_insert_ok" en "Element added with successfull.";
	translate set "demo_test_app_MENTDB_product_update_title" en "Update a product";
	translate set "demo_test_app_MENTDB_product_update_close_button" en "Close";
	translate set "demo_test_app_MENTDB_product_update_update_button" en "Update";
	translate set "demo_test_app_MENTDB_product_update_title_re" en "Update a product (reopen)";
	translate set "demo_test_app_MENTDB_product_update_ok" en "Element updated with successfull.";
	translate set "demo_test_app_MENTDB_product_delete_title_1" en "Delete of ";
	translate set "demo_test_app_MENTDB_product_delete_title_2" en " element(s)";
	translate set "demo_test_app_MENTDB_product_delete_cancel_button" en "Cancel";
	translate set "demo_test_app_MENTDB_product_delete_delete_button" en "Delete";
	translate set "demo_test_app_MENTDB_product_delete_ok" en "Element(s) deleted with successfull.";
	
	translate set "demo_test_app_MENTDB_product_list_title" fr "Liste des produits";
	translate set "demo_test_app_MENTDB_product_list_filter" fr "Filtre";
	translate set "demo_test_app_MENTDB_product_search_title" fr "Rechercher des produits";
	translate set "demo_test_app_MENTDB_product_search_close_button" fr "Fermer";
	translate set "demo_test_app_MENTDB_product_search_search_button" fr "Rechercher";
	translate set "demo_test_app_MENTDB_product_insert_title" fr "Ajouter un produit";
	translate set "demo_test_app_MENTDB_product_insert_close_button" fr "Fermer";
	translate set "demo_test_app_MENTDB_product_insert_insert_button" fr "Ajouter";
	translate set "demo_test_app_MENTDB_product_insert_title_re" fr "Ajouter un produit (réouverture)";
	translate set "demo_test_app_MENTDB_product_insert_ok" fr "Produit ajouté avec succès.";
	translate set "demo_test_app_MENTDB_product_update_title" fr "Modifier un produit";
	translate set "demo_test_app_MENTDB_product_update_close_button" fr "Fermer";
	translate set "demo_test_app_MENTDB_product_update_update_button" fr "Modifier";
	translate set "demo_test_app_MENTDB_product_update_title_re" fr "Modifier un produit (réouverture)";
	translate set "demo_test_app_MENTDB_product_update_ok" fr "Produit modifié avec succès.";
	translate set "demo_test_app_MENTDB_product_delete_title_1" fr "Suppression de ";
	translate set "demo_test_app_MENTDB_product_delete_title_2" fr " produit(s)";
	translate set "demo_test_app_MENTDB_product_delete_cancel_button" fr "Annuler";
	translate set "demo_test_app_MENTDB_product_delete_delete_button" fr "Supprimer";
	translate set "demo_test_app_MENTDB_product_delete_ok" fr "Produit(s) suprimé(s) avec succès.";
	
	translate set "demo_test_app_MENTDB_product_list_col_id" en "id";
	translate set "demo_test_app_MENTDB_product_list_col_id" fr "id";
	translate set "demo_test_app_MENTDB_product_search_field_id" en "id";
	translate set "demo_test_app_MENTDB_product_search_field_id" fr "id";
	translate set "demo_test_app_MENTDB_product_insert_field_id" en "id";
	translate set "demo_test_app_MENTDB_product_insert_field_id" fr "id";
	translate set "demo_test_app_MENTDB_product_update_field_id" en "id";
	translate set "demo_test_app_MENTDB_product_update_field_id" fr "id";
	
	translate set "demo_test_app_MENTDB_product_list_col_name" en "name";
	translate set "demo_test_app_MENTDB_product_list_col_name" fr "nom";
	translate set "demo_test_app_MENTDB_product_search_field_name" en "name";
	translate set "demo_test_app_MENTDB_product_search_field_name" fr "nom";
	translate set "demo_test_app_MENTDB_product_insert_field_name" en "name";
	translate set "demo_test_app_MENTDB_product_insert_field_name" fr "nom";
	translate set "demo_test_app_MENTDB_product_update_field_name" en "name";
	translate set "demo_test_app_MENTDB_product_update_field_name" fr "nom";
	
	translate set "demo_test_app_MENTDB_product_list_col_quantity" en "quantity";
	translate set "demo_test_app_MENTDB_product_list_col_quantity" fr "quantité";
	translate set "demo_test_app_MENTDB_product_search_field_quantity" en "quantity";
	translate set "demo_test_app_MENTDB_product_search_field_quantity" fr "quantité";
	translate set "demo_test_app_MENTDB_product_insert_field_quantity" en "quantity";
	translate set "demo_test_app_MENTDB_product_insert_field_quantity" fr "quantité";
	translate set "demo_test_app_MENTDB_product_update_field_quantity" en "quantity";
	translate set "demo_test_app_MENTDB_product_update_field_quantity" fr "quantité";
	
} "Nothing";
MQL OUTPUT
"Script merged with successful."

Execute immediate on init_lang...

Reload your connected home page: 

You can add, search, update, delete on your product table ...

start: 2026-02-01   end: 2026-02-02   v_start: 401   v_end: