📄 infoconfigaction.java
字号:
package com.singnet.web.action.admin;
import com.singnet.data.Constants;
import com.singnet.data.SysConfig;
import com.singnet.web.action.BaseAction;
import com.singnet.xml.XMLParseUtil;
public class InfoConfigAction extends BaseAction
{
public final static String CONFIG = "config";
public final static String OVER = "over";
XMLParseUtil xp = XMLParseUtil.getInstance();
private String forumName;
private String forumUrl;
private String forumAdmin;
private String forumAdminEmail;
private int threadPageSize;
private int replyPageSize;
private int isAllowVisit = Integer.parseInt(xp.getNodeValue(Constants.IS_ALLOW_VISIT));
private int costThread;
private int costMoney;
@Override
public String execute() throws Exception
{
// TODO Auto-generated method stub
xp.setNodeValue(Constants.WEB_NAME, forumName);
xp.setNodeValue(Constants.WEB_URL, forumUrl);
xp.setNodeValue(Constants.WEB_ADMIN, forumAdmin);
xp.setNodeValue(Constants.WEB_ADMIN_EMAIL, forumAdminEmail);
xp.saveNode();
SysConfig.WEB_NAME = forumName;
SysConfig.WEB_URL = forumUrl;
SysConfig.WEB_ADMIN = forumAdmin;
SysConfig.WEB_ADMIN_EMAIL = forumAdminEmail;
return SUCCESS;
}
@Override
public String doDefault() throws Exception
{
// TODO Auto-generated method stub
isAllowVisit = Integer.parseInt(xp.getNodeValue(Constants.IS_ALLOW_VISIT));
return INPUT;
}
public String goViewConfig() throws Exception
{
return CONFIG;
}
public String doViewConfig() throws Exception
{
xp.setNodeValue(Constants.THREAD_PAGE, threadPageSize + "");
xp.setNodeValue(Constants.REPLY_PAGE, replyPageSize + "");
xp.setNodeValue(Constants.IS_ALLOW_VISIT, isAllowVisit + "" );
xp.saveNode();
SysConfig.PAGE_SIZE = threadPageSize;
SysConfig.REPLY_PAGE_SIZE = replyPageSize;
return SUCCESS;
}
public String doMoneyConfig() throws Exception
{
xp.setNodeValue(Constants.COST_THREAD, String.valueOf(costThread));
xp.setNodeValue(Constants.COST_MONEY, String.valueOf(costMoney));
xp.saveNode();
SysConfig.COST_MONEY = costMoney;
SysConfig.COST_THREAD = costThread;
return SUCCESS;
}
public String getForumAdmin()
{
return forumAdmin;
}
public void setForumAdmin(String forumAdmin)
{
this.forumAdmin = forumAdmin;
}
public String getForumName()
{
return forumName;
}
public void setForumName(String forumName)
{
this.forumName = forumName;
}
public String getForumUrl()
{
return forumUrl;
}
public void setForumUrl(String forumUrl)
{
this.forumUrl = forumUrl;
}
public String getForumAdminEmail()
{
return forumAdminEmail;
}
public void setForumAdminEmail(String forumAdminEmail)
{
this.forumAdminEmail = forumAdminEmail;
}
public int getReplyPageSize()
{
return replyPageSize;
}
public void setReplyPageSize(int replyPageSize)
{
this.replyPageSize = replyPageSize;
}
public int getThreadPageSize()
{
return threadPageSize;
}
public void setThreadPageSize(int threadPageSize)
{
this.threadPageSize = threadPageSize;
}
public int getIsAllowVisit()
{
return isAllowVisit;
}
public void setIsAllowVisit(int isAllowVisit)
{
this.isAllowVisit = isAllowVisit;
}
public int getCostMoney()
{
return costMoney;
}
public void setCostMoney(int costMoney)
{
this.costMoney = costMoney;
}
public int getCostThread()
{
return costThread;
}
public void setCostThread(int costThread)
{
this.costThread = costThread;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -