Java tutorial
/** * PureInfo Command * @(#)EmailRemindProjectAction.java 1.0 2006-9-29 * * Copyright(c) 2004-2005, PureInfo Information Technology Corp. Ltd. * All rights reserved, see the license file. * * www.pureinfo.com.cn */ package com.pureinfo.srm.project.action; import org.apache.commons.lang.StringUtils; import org.apache.struts.action.ActionForward; import com.pureinfo.ark.ArkActionTypes; import com.pureinfo.ark.ArkExceptionTypes; import com.pureinfo.ark.auth2.Auth2Helper; import com.pureinfo.ark.auth2.domain.IAuth2Mgr; import com.pureinfo.ark.content.ArkContentHelper; import com.pureinfo.ark.interaction.ActionBase; import com.pureinfo.force.exception.PureException; import com.pureinfo.srm.project.domain.IProjectMgr; import com.pureinfo.srm.project.model.Project; /** * <P> * Created on 2006-9-29 14:13:09 <BR> * Last modified on 2006-9-29 * </P> * // * * @author Administrator * @version 1.0, 2006-9-29 * @since Command 1.0 */ public class EmailRemindProjectAction extends ActionBase { /** * @see com.pureinfo.ark.interaction.ActionBase#executeAction() */ public ActionForward executeAction() throws PureException { IAuth2Mgr authMgr = Auth2Helper.getManager(); Project project = new Project(); boolean bHasRight = authMgr.hasRight(loginUser, project, ArkActionTypes.REMIND, false); if (!bHasRight) { throw new PureException(ArkExceptionTypes.AUTH_NO_RIGHT, ""); } int nRemindType = request.getRequiredInt("type", "//"); String[] sIds = request.getParameterValues("id"); String sProjectIds = StringUtils.join(sIds, ','); IProjectMgr mgr = (IProjectMgr) ArkContentHelper.getContentMgrOf(Project.class); String[] msgs = mgr.sendEmailForHandRemind(sProjectIds, nRemindType); request.setAttribute("msg", msgs); request.setAttribute("forward", "projectToClose.do"); return mapping.findForward("info"); } }