📄 teachdocumentaction.java
字号:
package cn.js.fan.module.cms.plugin.teach;
import cn.js.fan.util.ErrMsgException;
import javax.servlet.ServletContext;
import org.apache.log4j.Logger;
import cn.js.fan.module.cms.plugin.base.IPluginDocumentAction;
import cn.js.fan.module.cms.CMSMultiFileUploadBean;
import cn.js.fan.module.cms.Document;
import cn.js.fan.util.StrUtil;
public class TeachDocumentAction implements IPluginDocumentAction {
Logger logger = Logger.getLogger(this.getClass().getName());
public TeachDocumentAction() {
}
public boolean create(ServletContext application,
CMSMultiFileUploadBean mfu, Document doc) throws
ErrMsgException {
int speedCount = 0;
String sspeedCount = StrUtil.getNullStr(mfu.getFieldValue("speedCount"));
String pptPath = StrUtil.getNullStr(mfu.getFieldValue("pptPath")).trim();
if (StrUtil.isNumeric(sspeedCount)) {
speedCount = Integer.parseInt(sspeedCount);
}
boolean useCard = false;
String strUseCard = StrUtil.getNullStr(mfu.getFieldValue("isUseCard"));
if (strUseCard.equals("true"))
useCard = true;
TeachDocumentDb td = new TeachDocumentDb();
td.setDocId(doc.getID());
td.setSpeedCount(speedCount);
td.setPptPath(pptPath);
td.setUseCard(useCard);
return td.create();
}
public boolean update(ServletContext application,
CMSMultiFileUploadBean mfu, Document doc) throws
ErrMsgException {
int speedCount = 0;
String sspeedCount = StrUtil.getNullStr(mfu.getFieldValue("speedCount"));
String pptPath = StrUtil.getNullStr(mfu.getFieldValue("pptPath"));
boolean useCard = false;
String strUseCard = StrUtil.getNullStr(mfu.getFieldValue("isUseCard"));
if (strUseCard.equals("true"))
useCard = true;
if (StrUtil.isNumeric(sspeedCount)) {
speedCount = Integer.parseInt(sspeedCount);
}
TeachDocumentDb td = new TeachDocumentDb();
td = td.getTeachDocumentDb(doc.getID());
td.setSpeedCount(speedCount);
td.setUseCard(useCard);
td.setPptPath(pptPath);
return td.save();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -