Author: jonesde
Date: Sun Feb 15 19:57:43 2009 New Revision: 744736 URL: http://svn.apache.org/viewvc?rev=744736&view=rev Log: Added quick first pass for the sendMailFromTemplateSetting service that uses the new EmailTemplateSetting entity; note that this is still beta as I haven't tested it much, but it shows that concept and can be a basis for further work, possibly including refactor of ProductStoreEmailSetting to use this entity and service but that isn't necessary for other things to use it, etc Added: ofbiz/trunk/framework/common/script/org/ofbiz/common/email/ ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml (with props) Modified: ofbiz/trunk/framework/common/entitydef/entitymodel.xml ofbiz/trunk/framework/common/servicedef/services_email.xml Modified: ofbiz/trunk/framework/common/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/entitydef/entitymodel.xml?rev=744736&r1=744735&r2=744736&view=diff ============================================================================== --- ofbiz/trunk/framework/common/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/framework/common/entitydef/entitymodel.xml Sun Feb 15 19:57:43 2009 @@ -33,6 +33,7 @@ <!-- ======================== Data Model ===================== --> <!-- The modules in this file are as follows: --> <!-- - org.ofbiz.common.datasource --> + <!-- - org.ofbiz.common.email --> <!-- - org.ofbiz.common.enum --> <!-- - org.ofbiz.common.geo --> <!-- - org.ofbiz.common.keyword --> Added: ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml?rev=744736&view=auto ============================================================================== --- ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml (added) +++ ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml Sun Feb 15 19:57:43 2009 @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> + <simple-method method-name="sendMailFromTemplateSetting" short-description="Send Mail from Email Template Setting"> + <entity-one entity-name="EmailTemplateSetting" value-field="emailTemplateSetting"/> + + <set field="emailParams.bodyScreenUri" from-field="emailTemplateSetting.bodyScreenLocation"/> + <set field="emailParams.xslfoAttachScreenLocation" from-field="emailTemplateSetting.xslfoAttachScreenLocation"/> + <set field="emailParams.sendFrom" from-field="emailTemplateSetting.fromAddress"/> + <set field="emailParams.sendCc" from-field="emailTemplateSetting.ccAddress"/> + <set field="emailParams.sendBcc" from-field="emailTemplateSetting.bccAddress"/> + <set field="emailParams.subject" from-field="emailTemplateSetting.subject"/> + <set field="emailParams.contentType" from-field="emailTemplateSetting.contentType" default-value="text/html"/> + + <!-- copy the incoming parameter fields AFTER setting the ones from EmailTemplateSetting so they can override things like subject, sendFrom, etc --> + <set-service-fields service-name="sendMailFromScreen" map="parameters" to-map="emailParams"/> + + <call-service service-name="sendMailFromScreen" in-map-name="emailParams"> + <result-to-result result-name="body"/> + </call-service> + </simple-method> +</simple-methods> Propchange: ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: ofbiz/trunk/framework/common/servicedef/services_email.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_email.xml?rev=744736&r1=744735&r2=744736&view=diff ============================================================================== --- ofbiz/trunk/framework/common/servicedef/services_email.xml (original) +++ ofbiz/trunk/framework/common/servicedef/services_email.xml Sun Feb 15 19:57:43 2009 @@ -81,6 +81,17 @@ <attribute name="webSiteId" type="String" mode="IN" optional="true"/> <attribute name="body" type="String" mode="OUT" optional="false"/> </service> + <service name="sendMailFromTemplateSetting" engine="simple" + location="org/ofbiz/common/email/EmailServices.xml" invoke="sendMailFromTemplateSetting"> + <description>Send Email From Email Template Setting Service</description> + <implements service="sendMailInterface"/> + <attribute name="emailTemplateSettingId" type="String" mode="IN" optional="false"/> + <attribute name="bodyText" type="String" mode="IN" optional="true" allow-html="any"/> + <attribute name="attachmentName" type="String" mode="IN" optional="true"/> + <attribute name="bodyParameters" type="Map" mode="IN" optional="true"/> + <attribute name="webSiteId" type="String" mode="IN" optional="true"/> + <attribute name="body" type="String" mode="OUT" optional="false"/> + </service> <service name="prepareNotificationInterface" engine="interface" location="" invoke=""> |
Free forum by Nabble | Edit this page |