step 1, active the E-mail Transports in Admin Console,
step 2, configure a message type and make it a record in the profile table,
insert into msgtypes(msgtype_id,msgtdir,name,viewname,description) values((select max(msgtype_id)+1 from msgtypes),1,'EmailToFriend','EmailToFriendView','Email Content to a friend about what you want to recommand');
insert into profile(profile_id,store_id,devicefmt_id,transport_id,msgtype_id,usersview,lowpriority,highpriority,archivemsg) values((select min(profile_id)-1 from profile),0,-3,1,(select max(msgtype_id) from msgtypes),'N',0,3,0);
step 3, configure the struts,(here the forward jsp can be changed to a specific format jsp)
<forward className="com.ibm.commerce.struts.ECActionForward" name="EmailToFriendView/10151/-3" path="/Test/TestOutput.jsp">
<set-property property="implClassName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/>
<set-property property="interfaceName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommand"/>
</forward>
<action path="/EmailToFriendView" type="com.ibm.commerce.struts.BaseAction">
</action>
step 4, Configure the access control for EmailToFriendView
insert into acaction ( acaction_id, action) values ( (select min(acaction_id) - 1 from acaction), 'EmailToFriendView');
insert into acactactgp (acaction_id, acactgrp_id) values ( (select acaction_id from acaction where action = 'EmailToFriendView'), (select acactgrp_id from acactgrp where groupname = 'AllSiteUsersViews'));
step 5, Customize SendEmailCmd to record data in msgstore table.
接口:
package com.petco.commerce.endeca.commands;
import com.ibm.commerce.command.ControllerCommand;
public interface SendEmailCmd extends ControllerCommand { public static final String CLASSNAME = SendEmailCmd.class.getName(); static final String defaultCommandClassName= CLASSNAME+"Impl"; public void setMsgName(String msgName); public void setEmail(String email); public void setSubject(String subject); public void setSender(String sender); }
|
实现类:
package com.petco.commerce.endeca.commands;
import com.ibm.commerce.command.CommandContext; import com.ibm.commerce.command.ControllerCommandImpl; import com.ibm.commerce.datatype.TypedProperty; import com.ibm.commerce.exception.ECException; import com.ibm.commerce.messaging.outboundservice.Messaging; import com.ibm.commerce.ras.ECTrace; import com.ibm.commerce.ras.ECTraceIdentifiers;
public class SendEmailCmdImpl extends ControllerCommandImpl implements SendEmailCmd {
private String msgName; private String email; private String subject ; private String sender ;
@Override public boolean isGeneric() { // TODO Auto-generated method stub return super.isGeneric(); }
@Override public void setRequestProperties(TypedProperty reqProperties) throws ECException { // TODO Auto-generated method stub super.setRequestProperties(reqProperties); }
@Override public void performExecute() throws ECException { // TODO Auto-generated method stub super.performExecute(); String methodName = "performExecute"; ECTrace.entry(ECTraceIdentifiers.COMPONENT_EXTERN, this.getClass() .getName(), methodName); //Test code segment begin // String email = "TestEmailContent"; // String userId = "-1000"; // CommandContext cmdClone = (CommandContext) getCommandContext().clone(); // cmdClone.setLanguage(getCommandContext().getLanguage()); // cmdClone.setLanguageId(getCommandContext().getLanguageId()); // cmdClone.setLocale(getCommandContext().getLocale()); // cmdClone.setStoreId(getStoreId()); // Messaging m = new Messaging("EmailToFriend", getStoreId()); // m.setConfigData("subject", "Email to friend"); // m.setConfigData("sender", ""); // m.setConfigData("recipient", email); // // TypedProperty prop = new TypedProperty(); // prop.put("userId", userId); // prop.put("email",email); // m.compose(null, cmdClone, prop); // m.sendTransacted(); //Test code segment end //Real code segment begin CommandContext cmdClone = (CommandContext) getCommandContext().clone(); cmdClone.setLanguage(getCommandContext().getLanguage()); cmdClone.setLanguageId(getCommandContext().getLanguageId()); cmdClone.setLocale(getCommandContext().getLocale()); cmdClone.setStoreId(getStoreId()); Messaging m = new Messaging(getMsgName(), getStoreId()); m.setConfigData("subject", getSubject()); m.setConfigData("sender", getSender()); m.setConfigData("recipient", getEmail());
TypedProperty prop = new TypedProperty(); prop.put("userId", getCommandContext().getUserId()); prop.put("email",getEmail()); m.compose(null, cmdClone, prop); m.sendTransacted(); //Real code segment end ECTrace.exit(ECTraceIdentifiers.COMPONENT_EXTERN, this.getClass() .getName(), methodName); }
@Override public void validateParameters() throws ECException { // TODO Auto-generated method stub super.validateParameters(); }
public String getMsgName() { return msgName; }
public void setMsgName(String msgName) { this.msgName = msgName; }
public String getEmail() { return email; }
public void setEmail(String email) { this.email = email; }
public String getSubject() { return subject; }
public void setSubject(String subject) { this.subject = subject; }
public String getSender() { return sender; }
public void setSender(String sender) { this.sender = sender; }
}
|
相关推荐
无线服务模块(WiSM)和WCS的配置指南
//WMS->WCS 发送任务 //{"cmd":101,"seq":1,"task_id":888,"src_station":1,"dest_station":1,"src_rack":1,"src_col":2,"src_row":3,"dest_rack":4,"dest_col":5,"dest_row":6,"weight":1,"barcode":"0000000000"} ...
物流仓储 上位机wcs与设备层通讯协议,WCS和物流设备通讯协议(TCP套接字通讯方式)
WCS 与PLC通讯源码示例
WCS-PNG210_Profinet
130页PPT,详细的介绍了CISCO WCS产品的配置指导及案例
private OpcClient _Opc; private string OpcServerName = McConfig.Instance.OpcServerName; private string OpcServerHost = McConfig.Instance.OpcServerHost; private string ...WCS程序输送线OPC通信
WCS OGC官方协议文档 文档来自官方
WCS功能及流程简要说明-入门
WCS快速引导与需求分解,能给给到通用指导与详细需求讲解。
智能立体仓储设备WCS系统研发
自动化仓储,堆垛机调度系统源码, C语言
输送分拣线PLC与上位机WCS接口协议 输送线PLC与WCS之间的数据交互在...蓝色部分为PLC写“1”发请求,WCS写“2”确认完成;(握手信号) 橙色部分(DB103.DBB0)由WCS写入“1”发放行指令,由PLC写入“2”发放行完成状态;
OGC WMS WCS WFS规范 已翻译成中文,但是翻译水平有限
IBM下的系统开发,运用WCS,指导你如何创建一个PageView.
WCS和物流设备通讯协议(TCP套接字通讯方式)
上海朗因智能WCS系统,WCS是介于WMS系统和PLC/FSC系统之间的一层管理控制系统。一方面,它 与WMS系统进行信息交互,接受WMS系统的指令,并将其发送给PLC/FSC系统, 从而驱动产线产生相应机械动作。另一方面,它将PLC...
WCS控制系统 AGV RGV ASRS
立库监控系统WCS,实例项目OPC通信。AGV、RGV、ASRS、堆垛机、Conveyor输送机、称重
WCS2702电流检测传感器原理图,工作流程介绍,以及AT指令集