Skip to content
This repository has been archived by the owner on Jan 5, 2018. It is now read-only.

Commit

Permalink
Added country Geo to PostalAddres Info, display alpha code 3 in outpu…
Browse files Browse the repository at this point in the history
…t template if present
  • Loading branch information
jonesde committed May 3, 2015
1 parent 0e21fa7 commit aeca5c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions mantle-usl/service/mantle/party/ContactServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ This Work includes contributions authored by David E. Jones, not as a
<parameter name="postalContactMechPurposeId"/>
<parameter name="postalAddress" type="EntityValue"/>
<parameter name="postalAddressStateGeo" type="EntityValue"/>
<parameter name="postalAddressCountryGeo" type="EntityValue"/>
<parameter name="postalAddressGeoPoint" type="EntityValue"/>
<parameter name="telecomContactMechId"/>
<parameter name="telecomContactMech" type="EntityValue"/>
Expand Down Expand Up @@ -66,6 +67,7 @@ This Work includes contributions authored by David E. Jones, not as a
</entity-find-one>
</if>
<entity-find-related-one value-field="postalAddress" relationship-name="StateProvince#moqui.basic.Geo" to-value-field="postalAddressStateGeo"/>
<entity-find-related-one value-field="postalAddress" relationship-name="Country#moqui.basic.Geo" to-value-field="postalAddressCountryGeo"/>
<entity-find-related-one value-field="postalAddress" relationship-name="moqui.basic.GeoPoint" to-value-field="postalAddressGeoPoint"/>
</if>

Expand Down Expand Up @@ -158,6 +160,7 @@ This Work includes contributions authored by David E. Jones, not as a
<parameter name="postalContactMechPurposeId"/>
<parameter name="postalContactMechPurpose" type="EntityValue"/>
<parameter name="postalAddress" type="EntityValue"/>
<parameter name="postalAddressCountryGeo" type="EntityValue"/>
<parameter name="postalAddressStateGeo" type="EntityValue"/>
<parameter name="postalAddressGeoPoint" type="EntityValue"/>
<parameter name="telecomContactMechId"/>
Expand Down Expand Up @@ -211,6 +214,7 @@ This Work includes contributions authored by David E. Jones, not as a
<field-map field-name="contactMechPurposeId" from="postalPcm.contactMechPurposeId"/>
</entity-find-one>
<entity-find-related-one value-field="postalAddress" relationship-name="StateProvince#moqui.basic.Geo" to-value-field="postalAddressStateGeo"/>
<entity-find-related-one value-field="postalAddress" relationship-name="Country#moqui.basic.Geo" to-value-field="postalAddressCountryGeo"/>
<entity-find-related-one value-field="postalAddress" relationship-name="moqui.basic.GeoPoint" to-value-field="postalAddressGeoPoint"/>

<if condition="postalAddress.telecomContactMechId">
Expand All @@ -231,8 +235,8 @@ This Work includes contributions authored by David E. Jones, not as a

<set field="postalAddressInfo" from="[postalContactMechId:postalContactMechId, postalContactMech:postalContactMech,
postalContactMechPurposeId:postalPcm.contactMechPurposeId, postalContactMechPurpose:postalContactMechPurpose,
postalAddress:postalAddress,
postalAddressStateGeo:postalAddressStateGeo, postalAddressGeoPoint:postalAddressGeoPoint,
postalAddress:postalAddress, postalAddressStateGeo:postalAddressStateGeo,
postalAddressCountryGeo:postalAddressCountryGeo, postalAddressGeoPoint:postalAddressGeoPoint,
telecomContactMechId:telecomContactMechId, telecomContactMech:telecomContactMech, telecomNumber:telecomNumber,
emailContactMechId:emailContactMechId, emailContactMech:emailContactMech, emailAddress:emailContactMech?.infoString]"/>
<script>postalAddressList.add(postalAddressInfo)</script>
Expand Down
2 changes: 1 addition & 1 deletion mantle-usl/template/party/ContactInfo.html.gstring
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ ${contactInfo?.postalAddress?.toName ? '<p>To: ' + contactInfo.postalAddress.toN
${contactInfo?.postalAddress?.attnName ? '<p>Attn: ' + contactInfo.postalAddress.attnName + '</p>' : ''}
${contactInfo?.postalAddress?.address1 ? '<p>' + contactInfo.postalAddress.address1 + (contactInfo.postalAddress.unitNumber ? ' #' + contactInfo.postalAddress.unitNumber : '') + '</p>' : ''}
${contactInfo?.postalAddress?.address2 ? '<p>' + contactInfo.postalAddress.address2 + '</p>' : ''}
${contactInfo?.postalAddress ? '<p>' + (contactInfo.postalAddress.city ?: '') + (contactInfo.postalAddressStateGeo?.geoCodeAlpha2 ? ', ' + contactInfo.postalAddressStateGeo.geoCodeAlpha2 : '') + ' ' + (contactInfo.postalAddress.postalCode ?: '') + (contactInfo.postalAddress.postalCodeExt ? '-' + contactInfo.postalAddress.postalCodeExt : '') + '</p>' : ''}
${contactInfo?.postalAddress ? '<p>' + (contactInfo.postalAddress.city ?: '') + (contactInfo.postalAddressStateGeo?.geoCodeAlpha2 ? ', ' + contactInfo.postalAddressStateGeo.geoCodeAlpha2 : '') + ' ' + (contactInfo.postalAddress.postalCode ?: '') + (contactInfo.postalAddress.postalCodeExt ? '-' + contactInfo.postalAddress.postalCodeExt : '') + (contactInfo.postalAddressCountryGeo?.geoCodeAlpha3 ? ' ' + contactInfo.postalAddressCountryGeo.geoCodeAlpha3 : '') + '</p>' : ''}
${contactInfo?.telecomNumber ? '<p>' + (contactInfo.telecomNumber.countryCode ? contactInfo.telecomNumber.countryCode + '-' : '') + (contactInfo.telecomNumber.areaCode ? contactInfo.telecomNumber.areaCode + '-' : '') + (contactInfo.telecomNumber.contactNumber ?: '') + '</p>' : ''}
${contactInfo?.emailAddress ? '<p>' + contactInfo.emailAddress + '</p>' : ''}

0 comments on commit aeca5c9

Please sign in to comment.