ilscipio/scipio-erp

View on GitHub
applications/product/data/ApiSchemaDhl.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<!-- FreeMarker template for DHL ShipIT Services. If the DHL ShipIt API ever changes its schema, we only need to change this file. -->

<entity-engine-xml>

    <DataResource dataResourceId="api.schema.DHL" dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="FTL"/>

<ElectronicText dataResourceId="api.schema.DHL">
<textData><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<ECommerce action="Request" version="1.1">
    <Requestor>
        <ID>${userid}</ID>
        <Password>${password}</Password>
    </Requestor>
    <Shipment action="${action}" version="1.0">
        <ShippingCredentials>
          <ShippingKey>${shippingKey}</ShippingKey>
          <AccountNbr>${accountNbr}</AccountNbr>
        </ShippingCredentials>
       <ShipmentDetail>
          <ShipDate>${shipDate?string("yyyy-MM-dd")}</ShipDate>
          <Service><Code>${dhlShipmentDetailCode}</Code></Service>
          <ShipmentType><Code>P</Code></ShipmentType>
          <Weight>${weight}</Weight>
          <ContentDesc>${contentDesc?if_exists}</ContentDesc>
          <ShipperReference>${shipperReference?if_exists}</ShipperReference>
          <#if (dimensions?if_exists) && (dimensions != null) && (dimensions.size() > 0) >
            <Dimensions>
                <Height>${dimensions.get("height")}</Height>
                <Width>${dimensions.get("width")}</Width>
                <Length>${dimensions.get("length")}</Length>
            </Dimensions>
          </#if>
      </ShipmentDetail>
      <Billing>
           <Party><Code>S</Code></Party>
      </Billing>
      <Sender>
        <SentBy>${sentBy?if_exists}</SentBy> <!-- CDATA (if left out, will default to information stored in our account -->
        <PhoneNbr>${senderPhoneNbr?if_exists}</PhoneNbr>
      </Sender>
      <Receiver>
          <Address>
            <#if (action == "GenerateLabel")>
                <CompanyName>${companyName?if_exists?upper_case?xml}</CompanyName>  <!-- CDATA -->
                <SuiteDepartmentName>${suiteDepartmentName?if_exists?upper_case?xml}</SuiteDepartmentName> <!-- CDATA -->
                <Street>${street?upper_case?xml}</Street> <!-- CDATA -->
                <StreetLine2>${streetLine2?if_exists?upper_case?xml}</StreetLine2> <!-- CDATA -->
                <City>${city?upper_case?xml}</City> <!-- CDATA -->
            </#if>
            <State>${state}</State>
            <PostalCode>${postalCode}</PostalCode>
            <Country>US</Country>
         </Address>
         <AttnTo>${attnTo?if_exists?upper_case}</AttnTo> <!--CDATA -->
         <#if phoneNbr?exists>
             <PhoneNbr>${phoneNbr}</PhoneNbr>
         </#if>
      </Receiver>
      <ShipmentProcessingInstructions>
        <#if labelImageType?exists>
            <Label><ImageType>${labelImageType}</ImageType></Label>
        </#if>
        <#if overrideCode?exists>
            <Overrides><Override><Code>${overrideCode}</Code></Override></Overrides>
        </#if>
        <#if notifyEmailAddress?exists>
            <Notification>
               <!-- TODO: up to 42 of these -->
               <Notify><EmailAddress>${notifyEmailAddress?if_exists}</EmailAddress></Notify>
               <#if notifyEmailMessage?has_content>
               <!-- CDATA here -->
               <Message>${notifyEmailMessage}</Message>
               </#if>
            </Notification>
        </#if>
      </ShipmentProcessingInstructions>
  </Shipment>
</ECommerce>
]]></textData>
</ElectronicText>

    <Content contentId="api.schema.DHL" contentTypeId="DOCUMENT" dataResourceId="api.schema.DHL"/>
</entity-engine-xml>