ESQL refresh module configuration and esql refresh Module

Source: Internet
Author: User

ESQL refresh module configuration and esql refresh Module

After modifying the database. xml file, you only need to execute <esql module = module Name act = refresh/> on the webpage. The modified parameters take effect immediately.

Example:

<Html> <title> refresh data module configuration parameters </title> <chtml> <esql module = help act = refresh/> </chtml> 
Lightweight B2C e-commerce website data module management instance

Data module configuration file base/database. xml

<? Xml version = "1.0" encoding = "GBK"?> <Database DbUrl = "jdbc: mysql: // localhost/" Password = "htok" UserName = "root" age = "200" DriverName = "com. mysql. jdbc. driver "Name =" htok_baby "Unicode =" UTF-8 "frequency =" 100 "max =" 32 "min =" 1 "pause =" 1 "taskFrequency =" 1 "timesUsed =" 30 "trace =" false "weName =" home textile Database "> </Database>
Display the module's webpage file hlep/db_info/show.html
Initialize the configuration file

<bag id=pPage><we name=m1>@{pPage:m}/database.xml</we><we name=t>@{pPage:m}/tables.xml</we></bag><we>@{@{pPage:m1}:db}</we><we>@{@{pPage:t}:t}</we>
Display basic configuration information
<Table border = 1 style = "border-collapse: collapse; font-size: 12px "width = 98% align = center bordercolor = #8bb2e9 cellpadding =" 3 "> <tr> <td colspan = 2 align = center> <B> basic configuration parameters </B> </td> </tr> <th width = 18%> database name </th> <td >{ pPage: m1 }:name }</td> </tr> <th> database title </th> <td >{ pPage: m1 }: weName} </td> </tr> <th> database driver </th> <td >{ pPage: m1 }: driverName} </td> </tr> <th> link address </th> <td >{ pPage: m1 }: dbUrl} </td> </tr> <t R> <th> User Name </th> <td >{ pPage: m1 }: userName} </td> </tr> <th> password </th> <td> ******** </td> </tr> <tr> <td colspan = 2 align = center> <B> execute an SQL statement </B> </td> </tr> <form action = "@ {sys: face} help/db_info/SQL .html? M =@{ pPage: m} "method = post id = SQL> <input type = hidden name = tabName> <tr> <th> SQL statement </th> <td> <textarea name =" sqlStr "rows =" 6 "cols =" 72 "> </textarea> </td> </tr> <th> operation </th> <td> <INPUT name = act type = radio onclick = "showNew (1 ); "checked value = query> query <INPUT name = act type = radio value = edit onclick =" showNew (0 ); "> modify <chtml> <if x =" @ {sys: canDo} "> <a href =" javascript: doSql (); void (0 ); "x = true> [run] </a> </if> </chtml> <div id = addnew> <input type = CheckBox name = new value = 1> both generate table configuration location: <select name = sort> <chtml> <for end = "{pPage: t }:getlength}"> <option >@{: getSuffix} </option> </for> </chtml> <option selected >@{@ {pPage: t }: getLength} </option> </select> </div> </td> </tr> </form> </table>
Show advanced configuration information
<Table border = 1 style = "border-collapse: collapse; font-size: 12px; display: none "width = 98% align = center bordercolor = #8bb2e9 cellpadding =" 3 "id = HighTab> <tr> <td colspan = 2 align = center> <B> connection pool configuration parameters </B> </td> </tr> <th width = 18%> Number of basic connections </th> <td >{ pPage: m1}: min} (2 by default) </td> </tr> <th> maximum number of connections </th> <td >{ pPage: m1}: max} (5 by default) </td> </tr> <th> Number of connections </th> <td >{ pPage: m1 }: timesUsed} (3 times by default) </td> </tr> <th> time the connection can wait </th> <td >@{@ {pPage: m1}: age} (120 seconds by default) </td> </tr> <th> refresh cycle of the Connection Pool </th> <td >{ pPage: m1 }: frequency} (60 seconds by default) </td> </tr> <th> the connection pool is suspended after the database fails to be connected several times </th> <td >{ pPage: m1 }: pause} (5 times by default) </td> </tr> <th> the console outputs a prompt about the connection pool </th> <td >{ pPage: m1 }: trace} (false by default, that is, no output) </td> </tr> </table>
Related operation script code
// Collapse the Left window var highShow = false; function doShow () {if (highShow) {showhlap. style. display = "block"; hideHigh. style. display = "none"; HighTab. style. display = "none"; highShow = false;} else {showHigh. style. display = "none"; hideHigh. style. display = "block"; HighTab. style. display = "block"; highShow = true ;}} function doDel () {if (! Confirm ('Are you sure you want to delete it? After the \ r data module is deleted, applications using this module will not work properly! \ R cancel deletion. Click [cancel] To confirm deletion. Click [OK] ') {return;} var str =' @ {sys: face} help/db_info/del. chtml? M =@{ pPage: m} '; location. href = str;} function doSql () {var SQL = document. forms ['SQL']; if (SQL ['sqlstr']. value = "") {alert ("SQL statement cannot be blank! "); SQL ['sqlstr']. focus (); return;} if (! Confirm ('Check the SQL statement and Operation Type carefully! For \ r modification, click [cancel]. for execution, click [OK] ') {SQL ['sqlstr']. focus (); return;} var str = SQL ['sqlstr']. value. toLowerCase (); var pos = str. indexOf ('from'); if (pos> 0) {str = SQL ['sqlstr']. value. substring (pos + 5); pos = str. indexOf (''); if (pos> 0) str = str. substring (0, pos); SQL ['tabname']. value = str;} SQL. submit ();} function showNew (I) {if (I = 1) addnew. style. display = "block"; else {addnew. style. display = "none"; var SQL = document. forms ['SQL']; SQL ['new']. checked = false ;}}
Effect

Editing (help/db_info/edit.html) Status display Effect


Save configuration information and refresh module code (help/db_info/save. chtml)

<Html> <chtml> <Bag id = sys> <we name = NodeID> a0 </we> </Bag> <! -- Topic node --> </chtml> <chtml file = "base/ac/checkAcl.htm"/> <! -- Import the permission check file --> <chtml> <! -- Permission judgment --> <if x = "@ {sys: canDo}" else = 1> <we x = true> <if x = "@ {cover: @ {sys: modules} (@ {pPage: m})} "else = 1> <bag id = pPage x = true> <we name = m1 >@{ pPage: m}/database. xml </we> </bag> <we> <bag id = pPage> <we name = m1> help/db_info/db. xml </we> </bag> <we >{ pPage: m1}: db }</we> <Bag id = "@ {pPage: m1} "act = save >@{ pPage: m}/tables. xml </Bag> </we> </if> <we >{ pPage: m1}: db} </we> <bag id = '@ {pPage: m1} '> <we name = "Name"> @ {pPage: Name} </ We> <we name = "weName" >@{ pPage: weName} </we> <we name = "DriverName" >@{ pPage: driverName} </we> <we name = "DbUrl" >@{ pPage: DbUrl} </we> <we name = "UserName" >@{ pPage: userName} </we> <we name = "Password" >@{ pPage: Password} </we> <we name = "min" >@{ pPage: min} </we> <we name = "max" >@{ pPage: max }</we> <we name = "timesUsed" >@{ pPage: timesUsed} </we> <we name = "age" >@{ pPage: age} </we> <we name = "frequency" >@{ pPage: frequency} </we> <we name = "Pause" >@{ pPage: pause }</we> <we name = "trace" >@{ pPage: trace} </we> </bag> <Bag id = "@ {pPage: m1}" act = save >@{ pPage: m}/database. xml </Bag> <if x = "@ {pPage: FileDB_extname}" else = 1> <we/> <file value = "@ {pPage: fileDB} ">@{ pPage: Name} </file> </if> <esql module =" @ {pPage: m} "act = refresh> Update parameter </esql> <script> alert (" operation successful! "); </Script> </we> <script> alert (" You do not have permission! "); </Script> </if> </chtml> <form id = reload target = lframe action =" @ {sys: face} help/dbs_menu.html "> </form> <script> location. href = '@ {sys: face} help/db_info/show.html? M =@{ pPage: m} '; document. forms ['reload']. submit (); </script> The

<Esql module = "@ {pPage: m}" act = refresh> Update parameters </esql>
The modified module parameters are refreshed immediately without restarting the system.
A rare sight. Open it now. Light B2C e-commerce websitesLog on to the background and try again.

Download and description of light platform Resources

Platform free download: http://download.csdn.net/detail/tx18/8381859

Latest Development Manual download: http://download.csdn.net/detail/tx18/8411089

Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8318585

The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please pay attention to the latestDevelopment Manual



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.