ApacheOFBiz的相关介绍以及使用总结(三)
ofbiz邮件发送服务

邮件发送服务
# -- general default 'fromEmailAddress' can be overridden in: EmailTemplateSetting
defaultFromEmailAddress=inform@xxx.com
#defaultFromEmailAddress=xxx@163.com # -- The default domainname used in the notification emails links
# as 'baseUrl' and 'baseSecureUrl' are set in the url.properties file. # -- mail notifications enabled (Y|N)
mail.notifications.enabled=Y # -- redirect all mail notifications to this address for testing
#mail.notifications.redirectTo= # -- the default mail server to use
mail.smtp.relay.host=smtp.mxhichina.com: inform@xxx.com
#mail.smtp.relay.host=smtp.xxx.com # -- SMTP Auth settings
mail.smtp.auth.user=inform@xxx.com
mail.smtp.auth.password=xxx@ #mail.smtp.auth.user=xxx@163.com
#mail.smtp.auth.password=xxx # -- Additional Required Fields needed for Gmail and other non traditional smtp servers
# -- These added fields also work for Yahoo business mail for instance
# -- Gmail smtp port can be either 465 or 587
mail.smtp.port=25



public static Map<String, Object> sendNotifyEmail(DispatchContext dispatchContext, Map<String, Object> sendMailContext) {
LocalDispatcher dispatcher = dispatchContext.getDispatcher();
sendMailContext.put("sendFrom", "xxx@163.com");
sendMailContext.put("sendTo", "xxx@xxx.com");
sendMailContext.put("subject", "Test to xxx");
sendMailContext.put("body", "bodyUrl");
Map<String, Object> sendMailResult;
try {
sendMailResult = dispatcher.runSync("sendMail", sendMailContext);
} catch (GenericServiceException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
return Collections.emptyMap();
}
如何定时调用sendMail服务



Ofbiz中的参照实现

<lookup target-form-name="LookupEmplPosition"/>
<form name="LookupEmplPosition" type="single" target="LookupEmplPosition"
header-row-style="header-row" default-table-style="basic-table">
<auto-fields-entity entity-name="EmplPosition" default-field-type="hidden"/>
<field name="emplPositionId" title="${uiLabelMap.HumanResEmplPositionId}"><text-find/></field>
<field name="statusId">
<drop-down allow-empty="true">
<entity-options description="${description}" key-field-name="statusId" entity-name="StatusItem"></entity-options>
</drop-down>
</field>
<field name="emplPositionTypeId">
<drop-down allow-empty="true">
<entity-options description="${description}" key-field-name="emplPositionTypeId" entity-name="EmplPositionType"></entity-options>
</drop-down>
</field>
<field name="partyId"><lookup target-form-name="LookupPartyName"/></field>
<field name="budgetId"><lookup target-form-name="LookupBudget"/></field>
<field name="budgetItemSeqId"><lookup target-form-name="LookupBudgetItem"/></field>
<field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
<field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
<request-map uri="LookupEmplPosition">
<security auth="true" https="true"/><response name="success" type="view" value="LookupEmplPosition"/>
</request-map>
<view-map name="LookupEmplPosition" type="screen" page="component://humanres/widget/LookupScreens.xml#LookupEmplPosition"/>
<screen name="LookupEmplPosition">
<section>
<actions>
<property-map resource="HumanResUiLabels" map-name="uiLabelMap" global="true"/>
<set field="title" value="${uiLabelMap.HumanResLookupEmplPositionByName}"/>
<set field="queryString" from-field="result.queryString"/>
<set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
<property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
<set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
<set field="entityName" value="EmplPosition"/>
<set field="searchFields" value="[emplPositionId, partyId, emplPositionTypeId]"/>
</actions>
<widgets>
<decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
<decorator-section name="search-options">
<include-form name="LookupEmplPosition" location="component://humanres/widget/forms/LookupForms.xml"/>
</decorator-section>
<decorator-section name="search-results">
<include-form name="ListEmplPositions" location="component://humanres/widget/forms/LookupForms.xml"/>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>

<field name="emplPositionId" widget-style="buttontext">
<hyperlink also-hidden="false" target-type="plain" description="${emplPositionId}" target="javascript:set_value('${emplPositionId}')"/>
</field>
Ofbiz中导出excel/pdf文件
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<request-map uri="ListGlAccountOrgCsv.csv">
<security https="true" auth="true"/>
<response name="success" type="view" value="ListGlAccountOrgCsv"/>
</request-map>
<view-map name="ListGlAccountOrgPdf" type="screenfop" page="component://accounting/widget/GlSetupScreens.xml#ListGlAccountOrgPdf" content-type="application/pdf" encoding="none"/>
<view-map name="ListGlAccountOrgCsv" type="screencsv" page="component://accounting/widget/GlSetupScreens.xml#ListGlAccountOrgCsv" content-type="text/csv" encoding="none"/>
<screen name="ListGlAccountOrgCsv">
<section>
<actions>
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
<set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
</actions>
<widgets>
<include-form name="ListGlAccountOrgCsv" location="component://accounting/widget/GlSetupForms.xml"/>
</widgets>
</section>
</screen>
<screen name="ListGlAccountOrgPdf">
<section>
<actions>
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
<set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
<entity-condition entity-name="GlAccountOrganizationAndClass" list="glAccountOrgAndClassList">
<condition-expr field-name="organizationPartyId" from-field="organizationPartyId"/>
<order-by field-name="glAccountId"/>
</entity-condition>
</actions>
<widgets>
<platform-specific>
<xsl-fo>
<html-template location="component://accounting/webapp/accounting/reports/ChartOfAccount.fo.ftl"/>
</xsl-fo>
</platform-specific>
</widgets>
</section>
</screen>
<link text="${uiLabelMap.AccountingExportAsCsv}" style="button" target="ListGlAccountOrgCsv.csv">
<parameter param-name="organizationPartyId"/>
</link>
<link text="${uiLabelMap.AccountingExportAsPdf}" style="button" target="ListGlAccountOrgPdf.pdf" target-window="_BLANK">
<parameter param-name="organizationPartyId"/>
</link>
ApacheOFBiz的相关介绍以及使用总结(三)的更多相关文章
- ApacheOFBiz的相关介绍以及使用总结(一)
由于最近一段时间在给一个创业的公司做客户关系管理CRM系统,限于人力要求(其实是没有多少人力),只能看能否有稳定,开源的半成品进行改造,而且最好不需要前端(js)相关开发人员的支援就可以把事情做成,经 ...
- ApacheOFBiz的相关介绍以及使用总结(二)
OFBiz的实体配置 实体定义文件一般存放位置是在对应模块的entity文件夹下面,在该模块对应的ofbiz-component.xml配置文件中加入一行,用来声明实体定义文件路径: < ...
- ppDelegate的相关介绍
// AppDelegate的相关介绍// IOS笔记 //@interface AppDelegate : UIResponder <UIApplicationDelegate>// ...
- Android开发工程师文集-Activity生命周期,启动方式,Intent相关介绍,Activity详细讲解
前言 大家好,给大家带来Android开发工程师文集-Activity生命周期,启动方式,Intent相关介绍,Activity详细讲解的概述,希望你们喜欢 Activity是什么 作为一个Activ ...
- CSS3 Backgrounds相关介绍
CSS3 Backgrounds相关介绍 1.背景图片(background images)是在padding-box的左上角落脚安家的,我们可以使用background-position属性改变默认 ...
- 一 hadoop 相关介绍
hadoop 相关介绍 hadoop的首页有下面这样一段介绍.对hadoop是什么这个问题,做了简要的回答. The Apache™ Hadoop® project develops open-sou ...
- Django day 33 vue中使用element-ui的使用,课程的相关介绍,vue绑定图片,课程列表接口,课程详情页面
一:vue中使用element-ui的使用, 二:课程的相关介绍, 三:vue绑定图片, 四:课程列表接口, 五:课程详情页面
- Vue 封装axios(四种请求)及相关介绍(十三)
Vue 封装axios(四种请求)及相关介绍 首先axios是基于promise的http库 promise是什么? 1.主要用于异步计算 2.可以将异步操作队列化,按照期望的顺序执行,返回符合预期的 ...
- 【STM32】使用SDIO进行SD卡读写,包含文件管理FatFs(二)-了解SD总线,命令的相关介绍
其他链接 [STM32]使用SDIO进行SD卡读写,包含文件管理FatFs(一)-初步认识SD卡 [STM32]使用SDIO进行SD卡读写,包含文件管理FatFs(二)-了解SD总线,命令的相关介绍 ...
随机推荐
- Visual Studio编译与调用DLL方法
参考自博客:http://www.cnblogs.com/houkai/archive/2013/06/05/3119513.html 用visual studio 2013新建win32 appli ...
- CSS: Grid Layout Module
Grid Layout The CSS Grid Layout Module offers a grid-based layout system, with rows and columns, mak ...
- Linux 内核驱动自动创建设备节点并挂载设备
*注:本文来自http://blog.csdn.net/lwj103862095/article/details/17470573 一.首先需要在最开始定义两个数据结构: static struct ...
- 通过powershell实现基础认证钓鱼获得密码
本文来自https://www.secpulse.com/archives/4131.html $cred = $host.ui.promptforcredential('Failed Authent ...
- Keras 自定义层
1.对于简单的定制操作,可以通过使用layers.core.Lambda层来完成.该方法的适用情况:仅对流经该层的数据做个变换,而这个变换本身没有需要学习的参数. # 切片后再分别进行embeddin ...
- topcoder WCNMLGB
点开题->断开连接->再也上不去->我玩NM
- 从小白开始学习iOS开发
从事iOS开发不经意间,已经两年过去了,记得当初看到OC是,我根本就不知道那些个东西是什么?从开始学习开机,到一个个英文开始,为了能找到工作,愣是耐下心去坚持看下去. 现在回想起来,很是庆幸我没有放弃 ...
- Makefile总结
1.Makefile由目标(Target).依赖关系(Dependency).命令(Command)组成. (1)目标:可定义多个目标,默认指定第一个,make时可指定其中一个. (2)依赖关系:在同 ...
- django-xhtml2pdf的使用(加入图片,指定字体,设置样式)
新博客地址:http://muker.net/django-xhtml2pdf.html 这里仅仅讨论直接利用html生成pdf这种最常见也最简单的情况. 1.要利用html生成带中文的pdf要指定中 ...
- 线性回归 Linear regression(1)线性回归的基本算法与求解
本系列内容大部分来自Standford公开课machine learning中Andrew老师的讲解,附加自己的一些理解,编程实现和学习笔记. 第一章 Linear regression 1.线性回归 ...