Wednesday 9 March 2016

Examples for ATG Rest Webservices

1. Sample program for ATG Rest web services for form actor: (Rest web service example is for change password )

       <actor-chain id="changePassword" transaction="TX_SUPPORTS">
  <form id="profileFormHandler-changePassword" name="/atg/userprofiling/ProfileFormHandler" handle="changePassword" >
   <input name="value.email" value="${param.email}" />
   <input name="value.oldpassword" value="${param.oldpassword}" />
   <input name="value.password" value="${param.password}" />
   <input name="value.confirmPassword" value="${param.confirmPassword}" />
  </form>
 </actor-chain>

 <actor-chain id="changePassword-success">
  <output id="successMessage" value="Password has been successfully changed" name="Success"></output>
 </actor-chain>

 <actor-chain id="changePassword-error">
  <output id="errorMessage" value="Error" name="Error"></output>
 </actor-chain>

2. Sample program for ATG Rest web services for Droplet actor:


<actor-chain id="getAvailableShippingMethods" transaction="TX_SUPPORTS">
 <droplet id="availableShippingMethodsDroplet" name="/atg/commerce/pricing/AvailableShippingMethods" var="availableShippingMethodsDropletParamStack">
  <input name="shippingGroup" value="${nucleus['/atg/commerce/order/ShoppingCartModifier'].shippingGroup}" />
  <oparam name="output">
   <output id="availableShippingMethods" name="availableShippingMethods" value="${availableShippingMethodsDropletParamStack.availableShippingMethods}" />
  </oparam>
 </droplet>
</actor-chain>



3. Sample program for ATG Rest web services for component actor:
<actor-chain id="getDefaultShippingAddress">
 <component id="shippingAddress" name="/atg/userprofiling/Profile" component-var="profile">
  <output id="firstName" name="firstName" value="${profile.shippingAddress.firstName}" />
  <output id="lastName" name="lastName" value="${profile.shippingAddress.lastName}" />
  <output id="middleName" name="middleName" value="${profile.shippingAddress.middleName}" />
  <output id="city" name="city" value="${profile.shippingAddress.city}" />
  <output id="country" name="country" value="${profile.shippingAddress.country}" />
  <output id="area" name="area" value="${profile.shippingAddress.area}" />
 </component>
</actor-chain>


4. Sample program for ATG Rest web services for Bean filtering:

<repository name="/atg/commerce/order/OrderRepository">
    <item-descriptor default-filter="summary" name="order">
      <filter id="summary">
        <property name="commerceItems"/>
        <property name="priceInfo"/>
        <property name="totalCommerceItemCount"/>
  <property name="specialinstructions"/>
      </filter>
      <filter id="detailed">
        <property name="commerceItems"/>
        <property name="creationTime"/>
        <property name="id"/>
        <property name="lastModifiedTime"/>
        <property name="paymentGroupCount"/>
        <property name="paymentGroups"/>
        <property name="priceInfo"/>
        <property name="profileId"/>
        <property name="relationships"/>
        <property name="shippingGroupCount"/>
        <property name="shippingGroups"/>
        <property name="siteId"/>
        <property name="taxPriceInfo"/>
        <property name="totalCommerceItemCount"/>
  <property name="specialinstructions"/>
      </filter>
    </item-descriptor>
</repository>


0 comments:

Post a Comment

 
;