ilscipio/scipio-erp

View on GitHub
applications/order/servicedef/services_cart.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.
-->

<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
    <description>Order (ShoppingCart) Services</description>
    <vendor>OFBiz</vendor>
    <version>1.0</version>

    <service name="assignItemShipGroup" engine="java" auth="false"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="assignItemShipGroup">
        <description>Assign a ShoppingCartItem -> Quantity to a ship group</description>
        <property name="shoppingCart.update" type="Boolean" value="true"><description>SCIPIO: Modifies the passed shoppingCart</description></property>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
        <attribute name="fromGroupIndex" type="Integer" mode="IN" optional="false"/>
        <attribute name="toGroupIndex" type="Integer" mode="IN" optional="false"/>
        <attribute name="itemIndex" type="Integer" mode="IN" optional="false"/>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="false"/>
        <attribute name="clearEmptyGroups" type="Boolean" mode="IN" optional="true"/>
    </service>

    <service name="setCartShippingOptions" engine="java" auth="false"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="setShippingOptions">
        <description>Sets The ShoppingCart Shipping Options</description>
        <property name="shoppingCart.update" type="Boolean" value="true"><description>SCIPIO: This service modifies the passed shoppingCart</description></property>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
        <attribute name="groupIndex" type="Integer" mode="IN" optional="false"/>
        <attribute name="shippingContactMechId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderUiLabels" property="checkhelper.select_shipping_destination"/>
            </type-validate>
        </attribute>
        <attribute name="shipmentMethodString" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderUiLabels" property="checkhelper.select_shipping_method"/>
            </type-validate>
        </attribute>
        <attribute name="shippingInstructions" type="String" mode="IN" optional="true"/>
        <attribute name="maySplit" type="Boolean" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderUiLabels" property="checkhelper.select_splitting_preference"/>
            </type-validate>
        </attribute>
        <attribute name="isGift" type="Boolean" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderUiLabels" property="checkhelper.specify_if_order_is_gift"/>
            </type-validate>
        </attribute>
        <attribute name="giftMessage" type="String" mode="IN" optional="true"/>
    </service>

    <service name="setCartShippingAddress" engine="java" auth="false"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="setShippingOptions">
        <description>Sets The ShoppingCart Shipping Options</description>
        <property name="shoppingCart.update" type="Boolean" value="true"><description>SCIPIO: This service modifies the passed shoppingCart</description></property>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
        <attribute name="groupIndex" type="Integer" mode="IN" optional="false"/>
        <attribute name="shippingContactMechId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderUiLabels" property="checkhelper.select_shipping_destination"/>
            </type-validate>
        </attribute>
    </service>

    <service name="setCartPaymentOptions" engine="java" auth="false"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="setPaymentOptions">
        <description>Sets the ShoppingCart Payment Options</description>
        <property name="shoppingCart.update" type="Boolean" value="true"><description>SCIPIO: This service modifies the passed shoppingCart</description></property>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
        <attribute name="paymentInfoId" type="String" mode="IN" optional="false"/>
        <attribute name="amount" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="refNum" type="String" mode="IN" optional="true"/>
    </service>

    <service name="setCartOtherOptions" engine="java" auth="false"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="setOtherOptions">
        <description>Sets the ShoppingCart Other Options (besided payment and shipping)</description>
        <property name="shoppingCart.update" type="Boolean" value="true"><description>SCIPIO: This service modifies the passed shoppingCart</description></property>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
        <attribute name="orderAdditionalEmails" type="String" mode="IN" optional="true"/>
        <attribute name="correspondingPoId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="loadCartFromOrder" engine="java" auth="true"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="loadCartFromOrder">
        <description>Create a ShoppingCart Object based on an existing order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="createAsNewOrder" type="String" mode="IN" default-value="N"/>
        <attribute name="skipInventoryChecks" type="Boolean" mode="IN" optional="true"/>
        <attribute name="skipProductChecks" type="Boolean" mode="IN" optional="true"/>
        <attribute name="includePromoItems" type="Boolean" mode="IN" optional="true"/>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
    </service>

    <service name="loadCartFromQuote" engine="java" auth="true"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="loadCartFromQuote">
        <description>Create a ShoppingCart Object based on an existing quote. If applyQuoteAdjustments is set to false then standard cart adjustments are generated.</description>
        <attribute name="quoteId" type="String" mode="IN" optional="false"/>
        <attribute name="applyQuoteAdjustments" type="String" mode="IN" optional="true"/>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
    </service>
    <service name="loadCartFromShoppingList" engine="java" auth="true"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="loadCartFromShoppingList">
        <description>Create a ShoppingCart Object based on an existing shopping list.</description>
        <attribute name="shoppingListId" type="String" mode="IN" optional="false"/>
        <attribute name="applyStorePromotions" type="String" mode="IN" optional="true"/>
        <attribute name="orderPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
    </service>

    <service name="getShoppingCartData" engine="java" auth="false"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="getShoppingCartData">
        <description>Get the ShoppingCart data</description>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
        <attribute name="totalQuantity" type="BigDecimal" mode="OUT" optional="true"/>
        <attribute name="currencyIsoCode" type="String" mode="OUT" optional="true"/>
        <attribute name="subTotal" type="BigDecimal" mode="OUT" optional="true"/>
        <attribute name="subTotalCurrencyFormatted" type="String" mode="OUT" optional="true"/>
        <attribute name="totalShipping" type="BigDecimal" mode="OUT" optional="true"/>
        <attribute name="totalShippingCurrencyFormatted" type="String" mode="OUT" optional="true"/>
        <attribute name="totalSalesTax" type="BigDecimal" mode="OUT" optional="true"/>
        <attribute name="totalSalesTaxCurrencyFormatted" type="String" mode="OUT" optional="true"/>
        <attribute name="displayGrandTotal" type="BigDecimal" mode="OUT" optional="true"/>
        <attribute name="displayGrandTotalCurrencyFormatted" type="String" mode="OUT" optional="true"/>
        <attribute name="cartItemData" type="Map" mode="OUT"/>
        <attribute name="displayOrderAdjustmentsTotalCurrencyFormatted" type="String" mode="OUT" optional="true"/>
    </service>

    <service name="getShoppingCartItemIndex" engine="java" auth="false"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="getShoppingCartItemIndex">
        <description>Get the ShoppingCart info from the productId</description>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
        <attribute name="productId" type="String" mode="IN" optional="false"/>
        <attribute name="itemIndex" type="String" mode="OUT" optional="true"/>
    </service>

    <service name="resetShipGroupItems" engine="java" auth="false"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="resetShipGroupItems">
        <description>Reset the ship Groups in the cart and put the items in default group</description>
        <property name="shoppingCart.update" type="Boolean" value="true"><description>SCIPIO: This service modifies the passed shoppingCart</description></property>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
    </service>

    <service name="prepareVendorShipGroups" engine="java" auth="false"
            location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="prepareVendorShipGroups">
        <description>Split the default shipgroup to individual shipgroups that are unique to a vendor</description>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
    </service>

    <service name="createCartAbandonedLine" default-entity-name="CartAbandonedLine" engine="entity-auto" invoke="create" auth="true">
        <description>Create CartAbandonedLine record</description>
        <auto-attributes include="pk" mode="IN"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateCartAbandonedLine" default-entity-name="CartAbandonedLine" engine="entity-auto" invoke="update" auth="true">
        <description>Update CartAbandonedLine record</description>
        <auto-attributes include="pk" mode="IN"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteCartAbandonedLine" default-entity-name="CartAbandonedLine" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete CartAbandonedLine record</description>
        <auto-attributes include="pk" mode="IN"/>
    </service>

    <!-- SCIPIO: NEW ABANDONED CART SERVICES -->
    <!-- SCIPIO: Added 2.1.0: Finds abandoned carts -->
    <service name="findAbandonedCarts" engine="java" location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="findAbandonedCarts" auth="true">
        <description>Finds abandoned carts</description>
        <attribute name="productStoreId" mode="IN" type="String" optional="false" />
        <attribute name="fromDate" mode="IN" type="Timestamp" optional="true" />
        <attribute name="daysOffset" mode="IN" type="Long" optional="true" />
        <attribute name="abandonedCarts" type="java.util.List" mode="OUT" optional="false"/>
    </service>
    <!-- SCIPIO: Added 2.1.0: Send abandoned cart email reminder -->
    <service name="sendAbandonedCartEmailReminder" engine="java" location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="sendAbandonedCartEmailReminder" auth="true">
        <description>Send abandoned cart email reminder</description>
        <attribute name="productStoreId" mode="IN" type="String" optional="true" />
        <attribute name="abandonedCarts" type="java.util.List" mode="IN" optional="false"/>
    </service>
    <!-- SCIPIO: Added 2.1.0: Load abandoned carts into ShoppingCart -->
    <service name="loadCartFromAbandonedCart" engine="java" auth="true"
             location="org.ofbiz.order.shoppingcart.ShoppingCartServices" invoke="loadCartFromAbandonedCart">
        <description>Create a ShoppingCart Object based on an existing abandoned cart.</description>
        <attribute name="visitId" type="String" mode="IN" optional="false"/>
        <attribute name="abandonedCart" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
        <attribute name="abandonedCartStatus" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
        <attribute name="abandonedCartLines" type="java.util.List" mode="IN" optional="true"/>
        <attribute name="isUserInSession" type="Boolean" mode="IN" optional="true" default-value="false"/>
        <attribute name="applyStorePromotions" type="String" mode="IN" optional="true"/>
        <attribute name="cartPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
    </service>

    <!-- SCIPIO: Added 2.1.0: Finds abandoned carts and sends reminder emails. Meant to be used as scheduled service -->
    <service name="findAbandonedCartsAndSendReminderEmails" engine="group" transaction-timeout="36000">
        <description></description>
        <group send-mode="all">
            <invoke name="findAbandonedCarts" mode="sync" parameters="preserve" result-to-context="true"/>
            <invoke name="sendAbandonedCartEmailReminder" mode="sync" />
        </group>
    </service>


</services>