Commit 6c2ebb51 authored by Liang Ding's avatar Liang Ding

修复单元测试问题;把 page/data cache max count 从 local.props 移到了 latke.props

parent 67d9c477
...@@ -50,7 +50,7 @@ import static org.b3log.solo.model.Preference.*; ...@@ -50,7 +50,7 @@ import static org.b3log.solo.model.Preference.*;
* Preference management service. * Preference management service.
* *
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.5, May 16, 2012 * @version 1.0.0.6, Apr 1, 2013
* @since 0.4.0 * @since 0.4.0
*/ */
public final class PreferenceMgmtService { public final class PreferenceMgmtService {
...@@ -180,7 +180,7 @@ public final class PreferenceMgmtService { ...@@ -180,7 +180,7 @@ public final class PreferenceMgmtService {
} }
} }
final String maxPageCntStr = Latkes.getLocalProperty("cache.maxPageCnt"); final String maxPageCntStr = Latkes.getMaxPageCacheCnt();
if (Integer.valueOf(maxPageCntStr) <= 0) { if (Integer.valueOf(maxPageCntStr) <= 0) {
preference.put(PAGE_CACHE_ENABLED, false); preference.put(PAGE_CACHE_ENABLED, false);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# #
# Description: B3log Latke configurations for test (GAE runtime). # Description: B3log Latke configurations for test (GAE runtime).
# Version: 1.0.0.1, May 2, 2012 # Version: 1.0.0.2, Apr 1, 2013
# Author: Liang Ding # Author: Liang Ding
# #
...@@ -51,5 +51,9 @@ cache=GAE ...@@ -51,5 +51,9 @@ cache=GAE
# userService=GAE # userService=GAE
userService=LOCAL userService=LOCAL
#### Cache ####
cache.maxPageCnt=128
cache.maxDataCnt=128
#### Static resource version #### #### Static resource version ####
staticResourceVersion=201206280945 staticResourceVersion=201206280945
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# #
# Description: B3log Latke configurations. Configures the section "Server" carefully. # Description: B3log Latke configurations. Configures the section "Server" carefully.
# Version: 1.0.0.7, Sep 7, 2012 # Version: 1.0.0.8, Apr 1, 2013
# Author: Liang Ding # Author: Liang Ding
# #
...@@ -48,5 +48,9 @@ cache=BAE ...@@ -48,5 +48,9 @@ cache=BAE
#### User Service Implementation #### #### User Service Implementation ####
userService=LOCAL userService=LOCAL
#### Cache ####
cache.maxPageCnt=128
cache.maxDataCnt=128
#### Static resource version #### #### Static resource version ####
staticResourceVersion=201211021410 staticResourceVersion=201211021410
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# Description: B3log Solo local environment configurations. Configures this file # Description: B3log Solo local environment configurations. Configures this file
# if B3log Solo runs on a standard Servlet container or Baidu App Engine, # if B3log Solo runs on a standard Servlet container or Baidu App Engine,
# it is unnecessary to care this file if B3log Solo runs on Google App Engine. # it is unnecessary to care this file if B3log Solo runs on Google App Engine.
# Version: 1.0.2.2, Jan 23, 2013 # Version: 1.0.2.3, Apr 1, 2013
# Author: Liang Ding # Author: Liang Ding
# #
...@@ -44,7 +44,3 @@ jdbc.transactionIsolation=READ_COMMITTED ...@@ -44,7 +44,3 @@ jdbc.transactionIsolation=READ_COMMITTED
# The specific table name prefix # The specific table name prefix
jdbc.tablePrefix=b3_solo jdbc.tablePrefix=b3_solo
#### Cache ####
cache.maxPageCnt=128
cache.maxDataCnt=128
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# #
# Description: B3log Latke configurations. Configures the section "Server" carefully. # Description: B3log Latke configurations. Configures the section "Server" carefully.
# Version: 1.0.0.6, Aug 14, 2012 # Version: 1.0.0.7, Apr 1, 2013
# Author: Liang Ding # Author: Liang Ding
# #
...@@ -47,5 +47,9 @@ cache=GAE ...@@ -47,5 +47,9 @@ cache=GAE
#### User Service Implementation #### #### User Service Implementation ####
userService=LOCAL userService=LOCAL
#### Cache ####
cache.maxPageCnt=1024000
cache.maxDataCnt=1024000
#### Static resource version #### #### Static resource version ####
staticResourceVersion=201211021410 staticResourceVersion=201211021410
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# #
# Description: B3log Latke configurations. Configures the section "Server" carefully. # Description: B3log Latke configurations. Configures the section "Server" carefully.
# Version: 1.0.0.6, Aug 14, 2012 # Version: 1.0.0.7, Apr 1, 2013
# Author: Liang Ding # Author: Liang Ding
# #
...@@ -47,5 +47,9 @@ cache=LOCAL ...@@ -47,5 +47,9 @@ cache=LOCAL
#### User Service Implementation #### #### User Service Implementation ####
userService=LOCAL userService=LOCAL
#### Cache ####
cache.maxPageCnt=128
cache.maxDataCnt=128
#### Static resource version #### #### Static resource version ####
staticResourceVersion=201211021410 staticResourceVersion=201211021410
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# Description: B3log Solo local environment configurations. Configures this file # Description: B3log Solo local environment configurations. Configures this file
# if B3log Solo runs on a standard Servlet container or Baidu App Engine, # if B3log Solo runs on a standard Servlet container or Baidu App Engine,
# it is unnecessary to care this file if B3log Solo runs on Google App Engine. # it is unnecessary to care this file if B3log Solo runs on Google App Engine.
# Version: 1.0.2.3, Jan 23, 2013 # Version: 1.0.2.4, Apr 1, 2013
# Author: Liang Ding # Author: Liang Ding
# #
...@@ -44,6 +44,3 @@ jdbc.transactionIsolation=READ_COMMITTED ...@@ -44,6 +44,3 @@ jdbc.transactionIsolation=READ_COMMITTED
# The specific table name prefix # The specific table name prefix
jdbc.tablePrefix= jdbc.tablePrefix=
#### Cache ####
cache.maxPageCnt=128
cache.maxDataCnt=128
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# #
# Description: B3log Latke configurations. Configures the section "Server" carefully. # Description: B3log Latke configurations. Configures the section "Server" carefully.
# Version: 1.0.0.6, Aug 14, 2012 # Version: 1.0.0.7, Apr 1, 2013
# Author: Liang Ding # Author: Liang Ding
# #
...@@ -47,5 +47,9 @@ cache=LOCAL ...@@ -47,5 +47,9 @@ cache=LOCAL
#### User Service Implementation #### #### User Service Implementation ####
userService=LOCAL userService=LOCAL
#### Cache ####
cache.maxPageCnt=128
cache.maxDataCnt=128
#### Static resource version #### #### Static resource version ####
staticResourceVersion=201211021410 staticResourceVersion=201211021410
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# Description: B3log Solo local environment configurations. Configures this file # Description: B3log Solo local environment configurations. Configures this file
# if B3log Solo runs on a standard Servlet container or Baidu App Engine, # if B3log Solo runs on a standard Servlet container or Baidu App Engine,
# it is unnecessary to care this file if B3log Solo runs on Google App Engine. # it is unnecessary to care this file if B3log Solo runs on Google App Engine.
# Version: 1.0.2.3, Feb 26, 2013 # Version: 1.0.2.4, Apr 1, 2013
# Author: Liang Ding # Author: Liang Ding
# #
...@@ -45,7 +45,3 @@ jdbc.transactionIsolation=READ_COMMITTED ...@@ -45,7 +45,3 @@ jdbc.transactionIsolation=READ_COMMITTED
# The specific table name prefix # The specific table name prefix
jdbc.tablePrefix= jdbc.tablePrefix=
#### Cache ####
cache.maxPageCnt=128
cache.maxDataCnt=128
...@@ -3258,11 +3258,18 @@ admin.userList = { ...@@ -3258,11 +3258,18 @@ admin.userList = {
userData[i].isAdmin = "&nbsp;" + Label.administratorLabel; userData[i].isAdmin = "&nbsp;" + Label.administratorLabel;
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" + userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>"; users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>";
} else { } else if ("defaultRole" === users[i].userRole) {
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" + userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>\ users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.userList.del('" + users[i].oId + "', '" + users[i].userName + "')\">" + Label.removeLabel + "</a>"; <a href='javascript:void(0)' onclick=\"admin.userList.del('" + users[i].oId + "', '" + users[i].userName + "')\">" + Label.removeLabel + "</a>" +
"<a href='javascript:void(0)' onclick=\"admin.userList.changeRole('" + users[i].oId + "')\">" + "ChangeRole" + "</a>";
userData[i].isAdmin = Label.commonUserLabel; userData[i].isAdmin = Label.commonUserLabel;
} else {
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.userList.del('" + users[i].oId + "', '" + users[i].userName + "')\">" + Label.removeLabel + "</a>" +
"<a href='javascript:void(0)' onclick=\"admin.userList.changeRole('" + users[i].oId + "')\">" + "ChangeRole" + "</a>";
userData[i].isAdmin = Label.visitorUserLabel;
} }
} }
...@@ -3435,6 +3442,39 @@ admin.userList = { ...@@ -3435,6 +3442,39 @@ admin.userList = {
} }
}, },
/**
* 修改角色
* @param id
*/
changeRole : function(id){
$.ajax({
url: latkeConfig.servePath + "/console/changeRole/" + id,
type: "GET",
cache: false,
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var pageNum = admin.userList.pageInfo.currentPage;
if (admin.userList.pageInfo.currentCount === 1 && admin.userList.pageInfo.pageCount !== 1 &&
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.pageCount--;
pageNum = admin.userList.pageInfo.pageCount;
}
var hashList = window.location.hash.split("/");
if (pageNum !== parseInt(hashList[hashList.length - 1])) {
admin.setHashByPage(pageNum);
}
admin.userList.getList(pageNum);
$("#loadMsg").text("");
}
});
},
/* /*
* 验证字段 * 验证字段
* @status 更新或者添加时进行验证 * @status 更新或者添加时进行验证
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment