亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bbsadminaction.java

?? 個人Blog java編寫的Blog可以直接使用!
?? JAVA
字號:
/*
 *  BBSReplyDAO.java
 *  
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *  
 *  Author: Winter Lau (javayou@gmail.com)
 *  http://dlog4j.sourceforge.net
 */
package com.liusoft.dlog4j.action;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

import com.liusoft.dlog4j.beans.ForumBean;
import com.liusoft.dlog4j.beans.SiteBean;
import com.liusoft.dlog4j.beans.TypeBean;
import com.liusoft.dlog4j.dao.BBSForumDAO;
import com.liusoft.dlog4j.formbean.BBSForumForm;
import com.liusoft.dlog4j.util.StringUtils;

/**
 * BBS管理的Action
 * @author Winter Lau
 */
public class BBSAdminAction extends AdminActionBase {

	/**
	 * 鎖定論壇
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doLockForum(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response, String s_forum_id)
			throws Exception {
		BBSForumForm forum = (BBSForumForm)form;
		int forum_id = Integer.parseInt(s_forum_id);
		BBSForumDAO.lockForumByID(forum.getSid(), forum_id);
		return super.makeForward(mapping.findForward("forums"), forum.getSid());
	}
	
	/**
	 * 隱藏論壇
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doHideForum(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response, String s_forum_id)
			throws Exception {
		BBSForumForm forum = (BBSForumForm)form;
		int forum_id = Integer.parseInt(s_forum_id);
		BBSForumDAO.hideForumByID(forum.getSid(), forum_id);
		return super.makeForward(mapping.findForward("forums"), forum.getSid());
	}
	
	/**
	 * 刪除論壇
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doDeleteForum(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response, String s_forum_id)
			throws Exception {
		BBSForumForm forum = (BBSForumForm)form;
		int forum_id = Integer.parseInt(s_forum_id);
		BBSForumDAO.deleteForumByID(forum.getSid(), forum_id);
		return super.makeForward(mapping.findForward("forums"), forum.getSid());
	}
	
	/**
	 * 更新論壇
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doUpdateForum(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		BBSForumForm forum = (BBSForumForm)form;
		super.validateClientId(request, forum);
		ForumBean fbean = BBSForumDAO.getForumByID(forum.getId());
		if(fbean!=null){
			if(StringUtils.isNotEmpty(forum.getName())&&!StringUtils.equals(fbean.getName(),forum.getName())){
				fbean.setName(forum.getName());
			}
			if(StringUtils.isNotEmpty(forum.getDesc())&&!StringUtils.equals(fbean.getDesc(),forum.getDesc())){
				fbean.setDesc(forum.getDesc());
			}
			if(fbean.getStatus()!=forum.getStatus()){
				int s = forum.getStatus();
				if(s==ForumBean.STATUS_NORMAL||s==ForumBean.STATUS_HIDDEN||s==ForumBean.STATUS_LOCKED)
					fbean.setStatus(forum.getStatus());
			}
			//更新內容類別
			if(forum.getCatalog()>0){
				if(fbean.getCatalog()==null)
					fbean.setCatalog(new TypeBean(forum.getCatalog()));
				else if(fbean.getCatalog().getId()!=forum.getCatalog())
					fbean.setCatalog(new TypeBean(forum.getCatalog()));						
			}
			else if(fbean.getCatalog()!=null){
				fbean.setCatalog(null);
			}
			
			BBSForumDAO.flush();
		}
		return super.makeForward(mapping.findForward("forums"), forum.getSid());
	}
	
	/**
	 * 創建論壇
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doCreateForum(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		BBSForumForm forum = (BBSForumForm)form;
		ActionMessages msgs = new ActionMessages();
		if(StringUtils.isEmpty(forum.getName())){
			msgs.add("name", new ActionMessage("error.forum_name_empty"));
		}
		else{			
			super.validateClientId(request, forum);
			SiteBean site = super.getSiteBean(request);
			ForumBean fbean = new ForumBean();
			fbean.setName(forum.getName());
			if(!StringUtils.isEmpty(forum.getDesc()))
				fbean.setDesc(forum.getDesc());
			fbean.setCreateTime(new Date());
			fbean.setSite(site);
			int s = forum.getStatus();
			if(s==ForumBean.STATUS_NORMAL||s==ForumBean.STATUS_HIDDEN||s==ForumBean.STATUS_LOCKED)
				fbean.setStatus(forum.getStatus());
			else
				fbean.setStatus(ForumBean.STATUS_NORMAL);
			if(forum.getCatalog()>0){
				fbean.setCatalog(new TypeBean(forum.getCatalog()));
			}
			BBSForumDAO.createForum(fbean, forum.getId(), forum.getDirection()==1);
		}
		if(!msgs.isEmpty()){
			saveMessages(request, msgs);
			return mapping.findForward("forum_add");
		}
		return super.makeForward(mapping.findForward("forums"), forum.getSid());
	}
	
	/**
	 * 向上移動日記分類
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doMoveUp(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response, String s_forum_id)
			throws Exception 
	{
		BBSForumForm lform = (BBSForumForm)form;
		try{
			int forum_id = Integer.parseInt(s_forum_id);
			BBSForumDAO.move(getSiteBean(request), forum_id, true);
		}catch(Exception e){
			context().log("move up forum #"+s_forum_id+" failed.", e);
		}
		return makeForward(mapping.findForward("forums"), lform.getSid());
	}
	
	/**
	 * 向下移動日記分類
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected ActionForward doMoveDown(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response, String s_forum_id)
			throws Exception
	{
		BBSForumForm lform = (BBSForumForm)form;
		try{
			int forum_id = Integer.parseInt(s_forum_id);
			BBSForumDAO.move(getSiteBean(request), forum_id, false);
		}catch(Exception e){
			context().log("move up forum #"+s_forum_id+" failed.", e);
		}
		return makeForward(mapping.findForward("forums"), lform.getSid());
	}
	
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃视频在线一区| 亚洲综合激情网| 欧美一区二区在线视频| 欧美亚洲高清一区| 欧美视频在线一区二区三区 | 国产亚洲精品精华液| 制服.丝袜.亚洲.中文.综合| 欧美猛男男办公室激情| 欧美精品丝袜中出| 日韩精品专区在线影院重磅| www欧美成人18+| 精品欧美一区二区三区精品久久 | 日韩一级成人av| 在线综合视频播放| 精品福利一区二区三区| 久久久久97国产精华液好用吗| 久久久久久久久久看片| 日韩毛片精品高清免费| 亚洲国产欧美日韩另类综合| 日韩精品乱码免费| 黄一区二区三区| 91最新地址在线播放| 日产欧产美韩系列久久99| 亚洲人一二三区| 亚洲动漫第一页| 精品一区二区三区免费观看| 成人成人成人在线视频| 欧美日韩成人综合| 国产三级精品三级在线专区| 亚洲视频综合在线| 懂色av噜噜一区二区三区av| 99在线精品视频| 欧美一区永久视频免费观看| 久久蜜桃av一区精品变态类天堂 | 91社区在线播放| 日韩一区二区三区电影在线观看 | 成人高清免费在线播放| 日精品一区二区| 久久99国产精品尤物| 99国产欧美另类久久久精品 | 日韩欧美区一区二| 中文字幕+乱码+中文字幕一区| 亚洲国产精品自拍| 高清不卡一区二区在线| 欧美一区永久视频免费观看| 自拍av一区二区三区| 国产精品一区二区视频| 欧美日韩国产另类一区| 亚洲欧洲色图综合| 狠狠色丁香久久婷婷综合_中| 色综合久久综合网| 国产日产欧产精品推荐色| 日韩高清不卡一区二区| 欧美主播一区二区三区| 国产精品免费视频一区| 精品一区二区久久| 91精品国产一区二区人妖| 一区二区高清视频在线观看| 成人午夜碰碰视频| 久久久久久毛片| 麻豆国产精品777777在线| 在线观看欧美黄色| 亚洲黄色片在线观看| 99精品视频在线免费观看| 久久久一区二区三区| 久久精品二区亚洲w码| 91麻豆精品国产91久久久久| 亚洲妇熟xx妇色黄| 欧美日韩激情一区二区| 亚洲小说欧美激情另类| 欧美三级日本三级少妇99| 亚洲天堂av一区| 91视频免费看| 亚洲精品国产高清久久伦理二区| www.欧美日韩| 亚洲视频一区在线| 91在线精品一区二区三区| 日韩美女视频19| 91久久国产综合久久| 樱桃视频在线观看一区| 在线看一区二区| 天天综合色天天| 日韩欧美电影在线| 国产在线精品一区在线观看麻豆| 日韩一区二区影院| 国产一区二区三区| 国产精品久久久久影视| 91在线观看地址| 亚洲一区二区三区不卡国产欧美| 欧美日韩国产123区| 捆绑变态av一区二区三区| 久久网站热最新地址| 成人精品在线视频观看| 亚洲美女视频在线观看| 欧美综合一区二区三区| 天堂在线一区二区| 久久综合九色综合欧美就去吻| 国产一区欧美日韩| 亚洲少妇屁股交4| 欧美猛男gaygay网站| 国内成+人亚洲+欧美+综合在线| 久久精品亚洲一区二区三区浴池| 成人国产电影网| 日韩高清一级片| 国产精品网站在线| 精品视频一区三区九区| 国产乱色国产精品免费视频| 亚洲男帅同性gay1069| 欧美一级日韩不卡播放免费| 成人黄色小视频| 婷婷六月综合亚洲| 国产精品伦一区二区三级视频| 欧美蜜桃一区二区三区| 成人av网址在线观看| 男女性色大片免费观看一区二区| 久久久久久久久久久久电影| 欧美在线制服丝袜| 国产精选一区二区三区| 视频一区在线播放| 国产精品欧美一区喷水| 日韩三级.com| 在线精品观看国产| 成人国产免费视频| 国产在线不卡视频| 无吗不卡中文字幕| 亚洲精品久久久蜜桃| 国产精品妹子av| 精品久久久久一区二区国产| 欧美三级日韩三级国产三级| voyeur盗摄精品| 国产福利精品导航| 久久国产视频网| 奇米影视7777精品一区二区| 一区二区三区中文字幕电影| 亚洲国产岛国毛片在线| 久久你懂得1024| 日韩欧美国产wwwww| 欧美一区二区三区的| 欧美图片一区二区三区| 91麻豆精品在线观看| 成人免费毛片片v| 国产成人精品免费网站| 国产一区亚洲一区| 久久91精品国产91久久小草| 日精品一区二区三区| 日精品一区二区| 美日韩一区二区| 青草国产精品久久久久久| 奇米影视在线99精品| 另类综合日韩欧美亚洲| 激情六月婷婷久久| 国产一区中文字幕| 成人免费毛片片v| 97精品国产露脸对白| 色哟哟一区二区在线观看| 91原创在线视频| 在线观看日韩一区| 欧美日韩国产在线播放网站| 欧美精品在欧美一区二区少妇| 欧美三级视频在线观看| 欧美精品久久一区| 日韩一卡二卡三卡四卡| 精品福利一二区| 国产精品拍天天在线| 一区二区三区.www| 丝袜美腿亚洲综合| 久久99国产精品久久| 国产91精品在线观看| 波多野结衣在线一区| 在线这里只有精品| 91精品国产综合久久小美女| 精品国产第一区二区三区观看体验| 亚洲精品在线一区二区| 中文字幕一区二区三区在线播放 | 亚洲特黄一级片| 亚洲国产日韩综合久久精品| 免费的国产精品| 成人免费看黄yyy456| 欧美一a一片一级一片| 欧美v亚洲v综合ⅴ国产v| 最新高清无码专区| 日韩国产欧美在线播放| 国产成人av一区| 欧美色倩网站大全免费| 久久这里都是精品| 亚洲伦理在线精品| 狠狠色丁香婷婷综合| 欧洲另类一二三四区| 久久亚洲春色中文字幕久久久| 亚洲视频一二区| 国产老妇另类xxxxx| 欧美网站一区二区| 中文一区一区三区高中清不卡| 亚洲成av人片一区二区| 成人av免费观看| 日韩欧美国产麻豆| 香港成人在线视频| 99久久精品久久久久久清纯| 日韩一二三四区| 香蕉久久一区二区不卡无毒影院|