Applied patch from jira issue OFBIZ-2556 (createUpdateEmailAddress service should be renamed to createUpdatePartyEmailAddress remove the effort of updating contactMech infoString)
Thanks Jyotsna for the contribution. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@785194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -540,4 +540,25 @@ under the License.
|
||||
</call-service>
|
||||
</if-not-empty>
|
||||
</simple-method>
|
||||
|
||||
<simple-method method-name="createUpdatePartyEmailAddress" short-description="Create and update email address" login-required="false">
|
||||
<if-empty field="parameters.contactMechId">
|
||||
<set-service-fields service-name="createPartyEmailAddress" map="parameters" to-map="emailAddressContext"/>
|
||||
<set field="emailAddressContext.partyId" from-field="userLogin.partyId"/>
|
||||
<call-service service-name="createPartyEmailAddress" in-map-name="emailAddressContext">
|
||||
<result-to-field result-name="contactMechId" field="contactMechId"/>
|
||||
</call-service>
|
||||
<log level="info" message="Email Contact Created emailContactMechId is ${contactMechId}"></log>
|
||||
<else>
|
||||
<set-service-fields service-name="updatePartyEmailAddress" map="parameters" to-map="emailAddressContext"/>
|
||||
<call-service service-name="updatePartyEmailAddress" in-map-name="emailAddressContext">
|
||||
<result-to-field result-name="contactMechId" field="contactMechId"/>
|
||||
</call-service>
|
||||
<log level="info" message="Email Contact updated emailContactMechId is ${contactMechId}"></log>
|
||||
</else>
|
||||
</if-empty>
|
||||
<entity-one entity-name="ContactMech" value-field="contactMech"/>
|
||||
<field-to-result field="contactMech.infoString" result-name="emailAddress"/>
|
||||
<field-to-result field="contactMechId"/>
|
||||
</simple-method>
|
||||
</simple-methods>
|
||||
@@ -977,25 +977,4 @@ under the License.
|
||||
</if-empty>
|
||||
<field-to-result field="contactMechId"/>
|
||||
</simple-method>
|
||||
|
||||
<simple-method method-name="createUpdateEmailAddress" short-description="Create and update email address" login-required="false">
|
||||
<if-empty field="parameters.contactMechId">
|
||||
<set-service-fields service-name="createPartyEmailAddress" map="parameters" to-map="emailAddressContext"/>
|
||||
<set field="emailAddressContext.partyId" from-field="userLogin.partyId"/>
|
||||
<call-service service-name="createPartyEmailAddress" in-map-name="emailAddressContext">
|
||||
<result-to-field result-name="contactMechId" field="contactMechId"/>
|
||||
</call-service>
|
||||
<log level="info" message="Email Contact Created emailContactMechId is ${contactMechId}"></log>
|
||||
<else>
|
||||
<set-service-fields service-name="updatePartyEmailAddress" map="parameters" to-map="emailAddressContext"/>
|
||||
<call-service service-name="updatePartyEmailAddress" in-map-name="emailAddressContext">
|
||||
<result-to-field result-name="contactMechId" field="contactMechId"/>
|
||||
</call-service>
|
||||
<log level="info" message="Email Contact updated emailContactMechId is ${contactMechId}"></log>
|
||||
</else>
|
||||
</if-empty>
|
||||
<entity-one entity-name="ContactMech" value-field="contactMech"/>
|
||||
<field-to-result field="contactMech.infoString" result-name="emailAddress"/>
|
||||
<field-to-result field="contactMechId"/>
|
||||
</simple-method>
|
||||
</simple-methods>
|
||||
|
||||
@@ -1179,8 +1179,8 @@ under the License.
|
||||
<attribute name="roleTypeId" type="String" mode="IN" optional="true"/>
|
||||
<attribute name="contactMechId" type="String" mode="INOUT" optional="true"/>
|
||||
</service>
|
||||
<service name="createUpdateEmailAddress" engine="simple"
|
||||
location="component://party/script/org/ofbiz/party/party/PartyServices.xml" invoke="createUpdateEmailAddress" auth="false">
|
||||
<service name="createUpdatePartyEmailAddress" engine="simple"
|
||||
location="component://party/script/org/ofbiz/party/contact/PartyContactMechServices.xml" invoke="createUpdatePartyEmailAddress" auth="false">
|
||||
<description>Create and Update email address</description>
|
||||
<attribute name="partyId" type="String" mode="IN" optional="true"/>
|
||||
<attribute name="userLogin" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
|
||||
|
||||
@@ -919,11 +919,11 @@ under the License.
|
||||
processor-name="emailAddress" in-map-name="parameters" out-map-name="emailAddressContext"/>
|
||||
<check-errors/>
|
||||
|
||||
<set-service-fields service-name="createUpdateEmailAddress" map="emailAddressContext" to-map="createUpdateEmailCtx"/>
|
||||
<set field="createUpdateEmailCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
|
||||
<set field="createUpdateEmailCtx.userLogin" from-field="userLogin"/>
|
||||
<set field="createUpdateEmailCtx.partyId" from-field="parameters.partyId"/>
|
||||
<call-service service-name="createUpdateEmailAddress" in-map-name="createUpdateEmailCtx">
|
||||
<set-service-fields service-name="createUpdatePartyEmailAddress" map="emailAddressContext" to-map="createUpdatePartyEmailCtx"/>
|
||||
<set field="createUpdatePartyEmailCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
|
||||
<set field="createUpdatePartyEmailCtx.userLogin" from-field="userLogin"/>
|
||||
<set field="createUpdatePartyEmailCtx.partyId" from-field="parameters.partyId"/>
|
||||
<call-service service-name="createUpdatePartyEmailAddress" in-map-name="createUpdatePartyEmailCtx">
|
||||
<result-to-field result-name="contactMechId" field="parameters.emailContactMechId"/>
|
||||
</call-service>
|
||||
<field-to-request field="parameters.emailContactMechId" request-name="emailContactMechId"/>
|
||||
@@ -1354,12 +1354,12 @@ under the License.
|
||||
<call-map-processor xml-resource="component://ecommerce/script/org/ofbiz/ecommerce/customer/CheckoutMapProcs.xml"
|
||||
processor-name="emailAddress" in-map-name="parameters" out-map-name="emailAddressContext"/>
|
||||
<check-errors/>
|
||||
<set-service-fields service-name="createUpdateEmailAddress" map="emailAddressContext" to-map="createUpdateEmailCtx"/>
|
||||
<set field="createUpdateEmailCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
|
||||
<set field="createUpdateEmailCtx.contactMechId" from-field="parameters.emailContactMechId"/>
|
||||
<set field="createUpdateEmailCtx.userLogin" from-field="userLogin"/>
|
||||
<set field="createUpdateEmailCtx.partyId" from-field="parameters.partyId"/>
|
||||
<call-service service-name="createUpdateEmailAddress" in-map-name="createUpdateEmailCtx">
|
||||
<set-service-fields service-name="createUpdatePartyEmailAddress" map="emailAddressContext" to-map="createUpdatePartyEmailCtx"/>
|
||||
<set field="createUpdatePartyEmailCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
|
||||
<set field="createUpdatePartyEmailCtx.contactMechId" from-field="parameters.emailContactMechId"/>
|
||||
<set field="createUpdatePartyEmailCtx.userLogin" from-field="userLogin"/>
|
||||
<set field="createUpdatePartyEmailCtx.partyId" from-field="parameters.partyId"/>
|
||||
<call-service service-name="createUpdatePartyEmailAddress" in-map-name="createUpdatePartyEmailCtx">
|
||||
<result-to-field result-name="contactMechId" field="parameters.emailContactMechId"/>
|
||||
</call-service>
|
||||
</simple-method>
|
||||
|
||||
@@ -1775,7 +1775,7 @@ under the License.
|
||||
|
||||
<request-map uri="updatePartyEmailAddress">
|
||||
<security https="true" auth="true"/>
|
||||
<event type="jsonservice" invoke="createUpdateEmailAddress"/>
|
||||
<event type="jsonservice" invoke="createUpdatePartyEmailAddress"/>
|
||||
<response name="success" type="none"/>
|
||||
<response name="error" type="none"/>
|
||||
</request-map>
|
||||
|
||||
Reference in New Issue
Block a user