/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package admin.guest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import database.DBConn;
import filter.FaceFilter;
import filter.HTMLFilter;
import filter.UbbCode;
import guestbook.GuestBook;

/** 
 * MyEclipse Struts
 * Creation date: 07-23-2008
 * 
 * XDoclet definition:
 * @struts.action validate="true"
 * @struts.action-forward name="ok" path="/a.jsp"
 */
public class Doeditguest1Action extends Action {
	/*
	 * Generated Methods
	 */

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		int id = Integer.parseInt(request.getParameter("id"));
		String name = request.getParameter("name");
		String mail = request.getParameter("mail");
		String usertitle = request.getParameter("usertitle");
		String qq = request.getParameter("qq");
		String face = request.getParameter("face");
		String content = request.getParameter("content");
		DBConn db = new DBConn();
		FaceFilter ff = new FaceFilter();
		HTMLFilter html = new HTMLFilter();
		UbbCode uc = new UbbCode();
		GuestBook gb = new GuestBook();
		gb.setName(name);
		gb.setId(id);
		gb.setFace(face);
		gb.setMail(mail);
		gb.setQq(qq);
		gb.setUsertitle(usertitle);
		html.setSource(content);
		html.run();
		ff.setSource(html.getResult());
		ff.run();
		uc.setSource(ff.getResult());
		uc.run();
		gb.setContent(uc.getResult());
		db.editguest(gb);
		return mapping.findForward("ok");
	}
}