⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmseditdelmimeaction.java

📁 MM7彩信对接网关示例
💻 JAVA
字号:
/*
 * Created on 2005-7-10
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.rainbow.mms.manage;

import org.apache.log4j.Logger;
import org.hibernate.Session;

import com.opensymphony.webwork.ServletActionContext;
import com.opensymphony.xwork.ActionContext;
import com.opensymphony.xwork.ActionSupport;
import com.rainbow.mms.common.MimeContent;
import com.rainbow.mms.common.MmsSmilPageUnitCollection;
import com.rainbow.util.tools.HibernateUtil;

/**
 * 向已有的彩信内容体中删除现有的彩信内容体元素
 * @author Rainbow MMS Group Leader —— TrWorks
 */
public class MmsEditDelMimeAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private Logger log = Logger.getLogger(MmsEditDelMimeAction.class);

	public String execute() throws Exception {

		String pageNum = ServletActionContext.getRequest().getParameter(
				"pageNum");
		String delMimeID = ServletActionContext.getRequest().getParameter(
				"delMimeID");	
		
		MmsSmilPageUnitCollection collection = (MmsSmilPageUnitCollection) ActionContext
				.getContext().getSession().get("mmsPageMapCollection");
		if (collection == null || pageNum == null || pageNum == null) {
			log.error("MmsEditDelMimeAction InputParams Error:\r\npageNum:"
					+ pageNum + "\r\ndelMimeID:" + delMimeID + "\r\ncollection:"+ collection);
			return ERROR;
		}

		MimeContent delContent = null;
		try {
			Session sess = HibernateUtil.currentSession();
			delContent = (MimeContent) sess.load(MimeContent.class,
					Integer.valueOf(delMimeID));
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			HibernateUtil.closeSession();
		}
		
		if (false == collection.delMimeElement(Integer.parseInt(pageNum), delContent)){
			log.error("MmsEditDelMimeAction delMimeElement false!");
			return ERROR;
		}

		return SUCCESS;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -