From 0b3f07add9240972711032fc0cfd637b5334d026 Mon Sep 17 00:00:00 2001 From: frea Date: Mon, 24 Jun 2024 11:47:44 +0200 Subject: [PATCH 1/2] adjust json-string --- RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl | 4 ++-- RFXtoRP_HsaItm_ItemCreated.ftl | 4 ++-- RFXtoRP_HsrPro_ExecutionflowDetected.ftl | 18 +++++++++--------- RPtoRFX_PrepOrder.ftl | 18 +++++++++--------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl b/RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl index 81560f3..c61e73b 100644 --- a/RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl +++ b/RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl @@ -16,8 +16,8 @@ "Codes": [ <#list lv.id_list as id> { - "Key": "${id.logistical_variant_ID_type_code?json_string!""}", - "Value": "${id.logistical_variant_ID_code?json_string!""}" + "Key": "${(id.logistical_variant_ID_type_code!"")?json_string}", + "Value": "${(id.logistical_variant_ID_code!"")?json_string}" }<#sep>, ], diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl index 6ef16c0..a8ce5c9 100644 --- a/RFXtoRP_HsaItm_ItemCreated.ftl +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -39,8 +39,8 @@ "Codes": [ <#list logistical_variant.id_list as id> { - "Key": "${id.logistical_variant_ID_type_code?json_string!""}", - "Value": "${id.logistical_variant_ID_code?json_string!""}" + "Key": "${(id.logistical_variant_ID_type_code!"")?json_string}", + "Value": "${(id.logistical_variant_ID_code!"")?json_string}" }<#sep>, ], diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index d1f4107..1de6b02 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -52,23 +52,23 @@ <#else> "Actor": { - "Name" : "${preparation_order.address.name_or_company_name?json_string!""}", + "Name" : "${(preparation_order.address.name_or_company_name!"")?json_string}", "Address" : { - "City" : "${preparation_order.address.post_code_area_name?json_string!""}", + "City" : "${(preparation_order.address.post_code_area_name!"")?json_string}", "CountryCode" : "${preparation_order.address.iso_country_code!""}", "PostalCode" : "${preparation_order.address.postal_code!""}", - "StreetAddressOne" : "${preparation_order.address.street_and_number_and_po_box?json_string!""}", - "StreetAddressTwo" : "${preparation_order.address.additional_address_data_1?json_string!""}", - "StreetAddressThree" : "${preparation_order.address.additional_address_data_2?json_string!""}" + "StreetAddressOne" : "${(preparation_order.address.street_and_number_and_po_box!"")?json_string}", + "StreetAddressTwo" : "${(preparation_order.address.additional_address_data_1!"")?json_string}", + "StreetAddressThree" : "${(preparation_order.address.additional_address_data_2!"")?json_string}" } }, "Contact" : { - "FirstName" : "${preparation_order.address.first_name?json_string!""}", - "LastName" : "${preparation_order.address.last_name?json_string!""}", - "Emails" : ${splitEmailsIntoArray(preparation_order.address.mail_address!""?json_string)}, - "Phones" : ["${preparation_order.address.mobile_phone_number?json_string!""}","${preparation_order.address.land_line_phone_number?json_string!""}", "${preparation_order.address.fax_number?json_string!""}" ] + "FirstName" : "${(preparation_order.address.first_name!"")?json_string}", + "LastName" : "${(preparation_order.address.last_name!"")?json_string}", + "Emails" : ${splitEmailsIntoArray((preparation_order.address.mail_address!"")?json_string)}, + "Phones" : ["${(preparation_order.address.mobile_phone_number!"")?json_string}","${(preparation_order.address.land_line_phone_number!"")?json_string}", "${(preparation_order.address.fax_number!"")?json_string}" ] } }, diff --git a/RPtoRFX_PrepOrder.ftl b/RPtoRFX_PrepOrder.ftl index 1aa6431..a33d6d5 100644 --- a/RPtoRFX_PrepOrder.ftl +++ b/RPtoRFX_PrepOrder.ftl @@ -52,21 +52,21 @@ "title_code" : "${titlecode}", "contact_type_code" : "${contacttypecode}", "address_type_code" : "${adresstypecode}", - "first_name": "${executionflow.ShipTo.Contact.FirstName!""?json_string}", - "last_name" :"${executionflow.ShipTo.Contact.LastName!""?json_string}", - "name_or_company_name" : "${executionflow.ShipTo.Contact.FirstName!""?json_string} ${executionflow.ShipTo.Contact.LastName!""?json_string}", + "first_name": "${(executionflow.ShipTo.Contact.FirstName!"")?json_string}", + "last_name" :"${(executionflow.ShipTo.Contact.LastName!"")?json_string}", + "name_or_company_name" : "${(executionflow.ShipTo.Contact.FirstName!"")?json_string} ${(executionflow.ShipTo.Contact.LastName!"")?json_string}", <#if executionflow.ShipTo.Contact.Emails?? && executionflow.ShipTo.Contact.Emails[0]!=""> "mail_address": "${executionflow.ShipTo.Contact.Emails[0]}", <#if executionflow.ShipTo.Contact.Phones?? && executionflow.ShipTo.Contact.Phones[0]!=""> "mobile_phone_number": "${executionflow.ShipTo.Contact.Phones[0]}", - "street_and_number_and_po_box": "${executionflow.ShipTo.Actor.Address.StreetAddressOne!""?json_string}", - "additional_address_data_1": "${executionflow.ShipTo.Actor.Address.StreetAddressTwo!""?json_string}", - "additional_address_data_2": "${executionflow.ShipTo.Actor.Address.StreetAddressThree!""?json_string}", - "postal_code": "${executionflow.ShipTo.Actor.Address.PostalCode!""}", - "post_code_area_name" : "${executionflow.ShipTo.Actor.Address.City!""}", - "iso_country_code": "${executionflow.ShipTo.Actor.Address.CountryCode!""}" + "street_and_number_and_po_box": "${(executionflow.ShipTo.Actor.Address.StreetAddressOne!"")?json_string}", + "additional_address_data_1": "${(executionflow.ShipTo.Actor.Address.StreetAddressTwo!"")?json_string}", + "additional_address_data_2": "${(executionflow.ShipTo.Actor.Address.StreetAddressThree!"")?json_string}", + "postal_code": "${(executionflow.ShipTo.Actor.Address.PostalCode!"")?json_string}", + "post_code_area_name" : "${(executionflow.ShipTo.Actor.Address.City!"")?json_string}", + "iso_country_code": "${(executionflow.ShipTo.Actor.Address.CountryCode!"")?json_string}" } <#if executionflow.Lines??> From 22b26ac7d3bf8d37e3463660dab1d02a8de3bc7a Mon Sep 17 00:00:00 2001 From: frea Date: Tue, 25 Jun 2024 17:29:36 +0200 Subject: [PATCH 2/2] adjust json_string (cherry picked from commit af29a11b220facebebc3e39e5eb49ed84cf732b6) --- RFXtoRP_PrepOrder_ShipFromAcked.ftl | 2 +- RFXtoRP_Receipt_ShipToAcked.ftl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RFXtoRP_PrepOrder_ShipFromAcked.ftl b/RFXtoRP_PrepOrder_ShipFromAcked.ftl index 6a4ab2c..cf47d44 100644 --- a/RFXtoRP_PrepOrder_ShipFromAcked.ftl +++ b/RFXtoRP_PrepOrder_ShipFromAcked.ftl @@ -4,7 +4,7 @@ "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${id.refid}" + "RefID": "${id.refid?json_string}" }, "Payload": { diff --git a/RFXtoRP_Receipt_ShipToAcked.ftl b/RFXtoRP_Receipt_ShipToAcked.ftl index ae00aae..a094aeb 100644 --- a/RFXtoRP_Receipt_ShipToAcked.ftl +++ b/RFXtoRP_Receipt_ShipToAcked.ftl @@ -4,7 +4,7 @@ "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${id.refid}" + "RefID": "${id.refid?json_string}" }, "Payload": {