com.ibm.commerce.rest.order.handler

Class OrderHandler

    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • RESOURCE_NAME

        public static final java.lang.String RESOURCE_NAME
        Resource name
        See Also:
        Constant Field Values
      • ORDER_SUMMARY_MAPPING_KEY

        public static final java.lang.String ORDER_SUMMARY_MAPPING_KEY
        Resource mapping key for order summary
        See Also:
        Constant Field Values
      • ORDER_DETAIL_MAPPING_KEY

        public static final java.lang.String ORDER_DETAIL_MAPPING_KEY
        Resource mapping key for order detail
        See Also:
        Constant Field Values
      • ORDER_ITEM_CONFIGURATION_MAPPING_KEY

        public static final java.lang.String ORDER_ITEM_CONFIGURATION_MAPPING_KEY
        Resource mapping key for order item configuration
        See Also:
        Constant Field Values
      • FORMAT_GROUP_NAME

        public static final java.lang.String FORMAT_GROUP_NAME
        The constant FORMAT_GROUP_NAME
        See Also:
        Constant Field Values
      • ORDER_HISTORY_STATUS

        public static final java.lang.String ORDER_HISTORY_STATUS
        Deprecated. Replaced by "N,M,A,B,C,R,S,D,F,G,L,X"
        All possible status (with states of N, M, A, B, C, R, S, D, F, and G) for order history.
        See Also:
        Constant Field Values
      • PARAMETER_EXTERNAL_ORDER_ID

        public static final java.lang.String PARAMETER_EXTERNAL_ORDER_ID
        external order identifier
        See Also:
        Constant Field Values
      • PARAMETER_EXTERNAL_ORDER_ID_DESCRIPTION

        public static final java.lang.String PARAMETER_EXTERNAL_ORDER_ID_DESCRIPTION
        external order identifier description
        See Also:
        Constant Field Values
      • PARAMETER_IS_SUMMARY

        public static final java.lang.String PARAMETER_IS_SUMMARY
        summary value
        See Also:
        Constant Field Values
      • PARAMETER_IS_SUMMARY_DESCRIPTION

        public static final java.lang.String PARAMETER_IS_SUMMARY_DESCRIPTION
        summary value description
        See Also:
        Constant Field Values
      • PARAMETER_ORDER_ID

        public static final java.lang.String PARAMETER_ORDER_ID
        order identifier
        See Also:
        Constant Field Values
      • PARAMETER_ORDER_ID_DESCRIPTION

        public static final java.lang.String PARAMETER_ORDER_ID_DESCRIPTION
        order identifier description
        See Also:
        Constant Field Values
      • PARAMETER_ORDER_ITEM_ID

        public static final java.lang.String PARAMETER_ORDER_ITEM_ID
        order item identifier
        See Also:
        Constant Field Values
      • PARAMETER_ORDER_ITEM_ID_DESCRIPTION

        public static final java.lang.String PARAMETER_ORDER_ITEM_ID_DESCRIPTION
        order item identifier description
        See Also:
        Constant Field Values
      • PARAMETER_RECORD_SET_TOTAL

        public static final java.lang.String PARAMETER_RECORD_SET_TOTAL
        total number of records in set
        See Also:
        Constant Field Values
      • PARAMETER_RECORD_SET_TOTAL_DESCRIPTION

        public static final java.lang.String PARAMETER_RECORD_SET_TOTAL_DESCRIPTION
        record set total description
        See Also:
        Constant Field Values
      • PARAMETER_RETRIEVAL_ORDER_STATUS

        public static final java.lang.String PARAMETER_RETRIEVAL_ORDER_STATUS
        retrieval order status
        See Also:
        Constant Field Values
      • PARAMETER_RETRIEVAL_ORDER_STATUS_DESCRIPTION

        public static final java.lang.String PARAMETER_RETRIEVAL_ORDER_STATUS_DESCRIPTION
        retrieval order status description
        See Also:
        Constant Field Values
      • PARAMETER_START_TIME

        public static final java.lang.String PARAMETER_START_TIME
        start time name
        See Also:
        Constant Field Values
      • PARAMETER_START_TIME_DESCRIPTION

        public static final java.lang.String PARAMETER_START_TIME_DESCRIPTION
        start time description
        See Also:
        Constant Field Values
      • PARAMETER_STATUS

        public static final java.lang.String PARAMETER_STATUS
        order status
        See Also:
        Constant Field Values
      • PARAMETER_STATUS_DESCRIPTION

        public static final java.lang.String PARAMETER_STATUS_DESCRIPTION
        order status description
        See Also:
        Constant Field Values
      • PARAMETER_USER_ID

        public static final java.lang.String PARAMETER_USER_ID
        user identifier
        See Also:
        Constant Field Values
      • PARAMETER_BUYER_ID

        public static final java.lang.String PARAMETER_BUYER_ID
        user identifier
        See Also:
        Constant Field Values
      • PARAMETER_ORMORDER

        public static final java.lang.String PARAMETER_ORMORDER
        user identifier
        See Also:
        Constant Field Values
      • PARAMETER_USER_ID_DESCRIPTION

        public static final java.lang.String PARAMETER_USER_ID_DESCRIPTION
        user identifier description
        See Also:
        Constant Field Values
      • PARAMETER_SORT_ORDER_ASC

        public static final java.lang.String PARAMETER_SORT_ORDER_ASC
        sort comment asc
        See Also:
        Constant Field Values
      • PARAMETER_SORT_ORDER_ASC_DESCRIPTION

        public static final java.lang.String PARAMETER_SORT_ORDER_ASC_DESCRIPTION
        sort comment asc description
        See Also:
        Constant Field Values
      • PARAMETER_ORDER_BY_FIELD

        public static final java.lang.String PARAMETER_ORDER_BY_FIELD
        order by filed
        See Also:
        Constant Field Values
      • PARAMETER_ORDER_BY_FIELD_DESCRIPTION

        public static final java.lang.String PARAMETER_ORDER_BY_FIELD_DESCRIPTION
        order by field description
        See Also:
        Constant Field Values
      • PARAMETER_MODE

        public static final java.lang.String PARAMETER_MODE
        csr add comment mode, csr can add comment onbehalf mode
        See Also:
        Constant Field Values
      • PARAMETR_MODE_DESCRIPTION

        public static final java.lang.String PARAMETR_MODE_DESCRIPTION
        csr add comment mode description
        See Also:
        Constant Field Values
      • ONBEHALF_MODE

        public static final java.lang.String ONBEHALF_MODE
        onbehalf mode
        See Also:
        Constant Field Values
      • ORDER_HISTORY_DEFAULT_STATUS

        public static final java.lang.String ORDER_HISTORY_DEFAULT_STATUS
        All possible status (with states of N, M, A, B, C, R, S, D, F, G, L, and X) for order history.
        See Also:
        Constant Field Values
      • CONFIG_GROUPING_SIDE_BY_SIDE_INTEGRATION

        public static final java.lang.String CONFIG_GROUPING_SIDE_BY_SIDE_INTEGRATION
        Name of the configuration grouping for the side-by-side integration flow.
        See Also:
        Constant Field Values
      • CONFIG_PROPERTY_OMS_PROVIDER

        public static final java.lang.String CONFIG_PROPERTY_OMS_PROVIDER
        Name of the configuration property for OMS provider.
        See Also:
        Constant Field Values
      • CONFIG_OMS_STERLING

        public static final java.lang.String CONFIG_OMS_STERLING
        Name of the configuration property for SterlingOMS.
        See Also:
        Constant Field Values
      • CONFIG_GENERAL_OMS

        public static final java.lang.String CONFIG_GENERAL_OMS
        Name of the configuration property for SterlingOMS.
        See Also:
        Constant Field Values
    • Constructor Detail

      • OrderHandler

        public OrderHandler()
    • Method Detail

      • getResourceName

        public java.lang.String getResourceName()
        Description copied from interface: IResourceHandler
        This method returns the name of the resource used primarily to determine the representation of the resource. This class can be overridden to change the name of the resource and therefore the representation, while keeping all the methods in this class.
        Returns:
        the resource name
      • getHelper

        public OrderHelper getHelper()
        This method returns the BOD helper used to get order data
        Returns:
        OrderHelper
      • findOrderHistory

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="@history")
        public javax.ws.rs.core.Response findOrderHistory(@PathParam(value="storeId")
                                                                                                                                                                                                java.lang.String storeId,
                                                                                                                                                                                                @QueryParam(value="responseFormat")
                                                                                                                                                                                                java.lang.String responseFormat,
                                                                                                                                                                                                @QueryParam(value="pageNumber")
                                                                                                                                                                                                int pageNumber,
                                                                                                                                                                                                @QueryParam(value="pageSize")
                                                                                                                                                                                                int pageSize)
        This method retrieves order history for the current shopper. It returns a list of order summary data that do not include individual order items. It will use the default list of statuses returned by getOrderHistoryDefaultStatus().
        Parameters:
        storeId - The store Id of the request.
        responseFormat - The response format.
        pageNumber - The page number.
        pageSize - The page size.
        Returns:
        The Response document.
      • findByOrderId

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="{orderId}")
        public javax.ws.rs.core.Response findByOrderId(@PathParam(value="orderId")
                                                                                                                                                                                              java.lang.String orderId,
                                                                                                                                                                                              @PathParam(value="storeId")
                                                                                                                                                                                              java.lang.String storeId,
                                                                                                                                                                                              @QueryParam(value="responseFormat")
                                                                                                                                                                                              java.lang.String responseFormat,
                                                                                                                                                                                              @QueryParam(value="pageNumber")
                                                                                                                                                                                              int pageNumber,
                                                                                                                                                                                              @QueryParam(value="pageSize")
                                                                                                                                                                                              int pageSize)
        This method retrieves order detail by an order id. It returns order detail including order items.
        Parameters:
        orderId - The Order orderId.
        storeId - The store Id.
        responseFormat - The response format (xml, json, or atom).
        pageNumber - The page number.
        pageSize - The page size.
        Returns:
        The Order noun in the specified format.
      • findByStatus

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="byStatus/{status}")
        public javax.ws.rs.core.Response findByStatus(@PathParam(value="storeId")
                                                                                                                                                                                                     java.lang.String storeId,
                                                                                                                                                                                                     @PathParam(value="status")
                                                                                                                                                                                                     java.lang.String status,
                                                                                                                                                                                                     @QueryParam(value="responseFormat")
                                                                                                                                                                                                     java.lang.String responseFormat,
                                                                                                                                                                                                     @QueryParam(value="pageNumber")
                                                                                                                                                                                                     int pageNumber,
                                                                                                                                                                                                     @QueryParam(value="pageSize")
                                                                                                                                                                                                     int pageSize)
        This method retrieves orders by status. It returns a list of order summary data that do not include individual order items.
        Parameters:
        storeId - The store Id.
        status - The Order status.
        responseFormat - The response format (xml, json, or atom).
        pageNumber - The page number.
        pageSize - The page size.
        Returns:
        The Order noun in the specified format.
      • findByBuyerId

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="byBuyerId/{buyerId}")
        public javax.ws.rs.core.Response findByBuyerId(@PathParam(value="storeId")
                                                                                                                                                                                                        java.lang.String storeId,
                                                                                                                                                                                                        @PathParam(value="buyerId")
                                                                                                                                                                                                        java.lang.String buyerId,
                                                                                                                                                                                                        @QueryParam(value="responseFormat")
                                                                                                                                                                                                        java.lang.String responseFormat,
                                                                                                                                                                                                        @QueryParam(value="pageNumber")
                                                                                                                                                                                                        int pageNumber,
                                                                                                                                                                                                        @QueryParam(value="pageSize")
                                                                                                                                                                                                        int pageSize)
        This method retrieves orders by status. It returns a list of order summary data that do not include individual order items.
        Parameters:
        storeId - The store Id.
        status - The Order status.
        responseFormat - The response format (xml, json, or atom).
        pageNumber - The page number.
        pageSize - The page size.
        Returns:
        The Order noun in the specified format.
      • findOMSOrderDetailsByExternalOrderId

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="oms_order/{extOrderId}")
        public javax.ws.rs.core.Response findOMSOrderDetailsByExternalOrderId(@PathParam(value="storeId")
                                                                                                                                                                                                                                  java.lang.String storeId,
                                                                                                                                                                                                                                  @PathParam(value="extOrderId")
                                                                                                                                                                                                                                  java.lang.String extOrderId,
                                                                                                                                                                                                                                  @QueryParam(value="responseFormat")
                                                                                                                                                                                                                                  java.lang.String responseFormat)
        This method retrieves OMS order detail by an external order id. It returns order detail including order items.
        Parameters:
        extOrderId - The external order orderId.
        storeId - The store Id.
        responseFormat - The response format (xml, json, or atom).
        Returns:
        The OMS Order noun in the specified format.
      • processOMSOrderByExternalOrderId

        @POST
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="process_oms_order/{extOrderId}")
        public javax.ws.rs.core.Response processOMSOrderByExternalOrderId(@PathParam(value="storeId")
                                                                                                                                                                                                                                       java.lang.String storeId,
                                                                                                                                                                                                                                       @PathParam(value="extOrderId")
                                                                                                                                                                                                                                       java.lang.String extOrderId,
                                                                                                                                                                                                                                       @QueryParam(value="responseFormat")
                                                                                                                                                                                                                                       java.lang.String responseFormat)
        This method process OMS order by an external order id.
        Parameters:
        extOrderId - The external order orderId.
        storeId - The store Id.
        responseFormat - The response format (xml, json, or atom).
        Returns:
        The response.
      • copyOMSOrderByExternalOrderId

        @POST
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="copy_oms_order/{extOrderId}")
        public javax.ws.rs.core.Response copyOMSOrderByExternalOrderId(@PathParam(value="storeId")
                                                                                                                                                                                                                                 java.lang.String storeId,
                                                                                                                                                                                                                                 @PathParam(value="extOrderId")
                                                                                                                                                                                                                                 java.lang.String extOrderId,
                                                                                                                                                                                                                                 @QueryParam(value="responseFormat")
                                                                                                                                                                                                                                 java.lang.String responseFormat)
        This method copies OMS order by an external order id.
        Parameters:
        extOrderId - The external order orderId.
        storeId - The store Id.
        responseFormat - The response format (xml, json, or atom).
        Returns:
        The response.
      • findByParentOrderId

        public javax.ws.rs.core.Response findByParentOrderId(@PathParam(value="storeId")
                                                             java.lang.String storeId)
        This method retrieves orders by the parent order identifier.
        Parameters:
        storeId - The store identifier.
        Returns:
        The response.
      • findByQuery

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
        public javax.ws.rs.core.Response findByQuery(@PathParam(value="storeId")
                                                                                                                                                                  java.lang.String storeId,
                                                                                                                                                                  @QueryParam(value="q")
                                                                                                                                                                  java.lang.String queryName,
                                                                                                                                                                  @QueryParam(value="responseFormat")
                                                                                                                                                                  java.lang.String responseFormat)
        Finds orders by a query. See each query for details on input and output.
        Parameters:
        storeId - The store ID.
        queryName - The query name.
        responseFormat - The response format.
        Returns:
        The response.
      • findByStatusExt

        public javax.ws.rs.core.Response findByStatusExt(@PathParam(value="storeId")
                                                         java.lang.String storeId)
        This method retrieves order status by the external order ID.
        Parameters:
        storeId - The store identifier.
        Returns:
        The response.
      • findChildOrderByOrderItemId

        public javax.ws.rs.core.Response findChildOrderByOrderItemId(@PathParam(value="storeId")
                                                                     java.lang.String storeId)
        This method retrieves child orders by the order item identifier.
        Parameters:
        storeId - The store identifier.
        Returns:
        The response.
      • findConfigurationByOrderItemId

        public javax.ws.rs.core.Response findConfigurationByOrderItemId(@PathParam(value="storeId")
                                                                        java.lang.String storeId)
        This method retrieves the order item configuration by an order item ID. The catalog entry type of this order item should be a dynamic kit.
        Parameters:
        storeId - The store identifier
        Returns:
        The response containing the order item configuration
      • findByORMOrder

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="byORMOrder/{ORMOrder}")
        public javax.ws.rs.core.Response findByORMOrder(@PathParam(value="storeId")
                                                                                                                                                                                                           java.lang.String storeId,
                                                                                                                                                                                                           @PathParam(value="ORMOrder")
                                                                                                                                                                                                           java.lang.String ORMOrder,
                                                                                                                                                                                                           @QueryParam(value="responseFormat")
                                                                                                                                                                                                           java.lang.String responseFormat,
                                                                                                                                                                                                           @QueryParam(value="pageNumber")
                                                                                                                                                                                                           int pageNumber,
                                                                                                                                                                                                           @QueryParam(value="pageSize")
                                                                                                                                                                                                           int pageSize)
        This method retrieves orders by ORMORder. It returns a list of order summary data that do not include individual order items.
        Parameters:
        storeId - The store Id.
        ORMORDER - The external order id.
        responseFormat - The response format (xml, json, or atom).
        pageNumber - The page number.
        pageSize - The page size.
        Returns:
        The Order noun in the specified format.
      • orderProfile

        public javax.ws.rs.core.Response orderProfile(@PathParam(value="storeId")
                                                      java.lang.String storeId)
                                               throws com.ibm.commerce.foundation.rest.resourcehandler.RestException
        This method retrieves the order profile by a user identifier.
        Parameters:
        storeId - The store identifier
        Returns:
        The response containing the order profile information
        Throws:
        com.ibm.commerce.foundation.rest.resourcehandler.RestException
      • findOrderPromotions

        public javax.ws.rs.core.Response findOrderPromotions(@PathParam(value="storeId")
                                                             java.lang.String storeId)
        This method retrieves the order promotions information.
        Parameters:
        storeId - The store identifier
        Returns:
        The response containing the order promotions information.
      • postProcess

        public void postProcess(java.util.Map<java.lang.String,java.lang.Object> responseMap)
        Method to provide post process in out of box JSON/XML entity providers after each DataObject has been converted to a Map and before constructing the REST response. By default, it does nothing. Overwrite this method in your resource handler class to perform any post process, for example, merge maps from multiple DataObjects into a single Map.
        Specified by:
        postProcess in interface IResourceHandler
        Overrides:
        postProcess in class AbstractBaseResourceHandler
        Parameters:
        responseMap - The response Map after each DataObject has been converted to a Map.
      • ordersICanWorkonbehalf

        public javax.ws.rs.core.Response ordersICanWorkonbehalf(@PathParam(value="storeId")
                                                                java.lang.String storeId)
        This allows a CSR to find orders that he/she can work on behalf.
        Parameters:
        storeId - The store ID.
        Returns:
        The response.
      • addCSROrderComments

        @POST
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Consumes(value={"application/json","application/xml"})
         @Path(value="{orderId}/comment")
        public javax.ws.rs.core.Response addCSROrderComments(@PathParam(value="storeId")
                                                                                                                                                                                                                                                                      java.lang.String storeId,
                                                                                                                                                                                                                                                                      @PathParam(value="orderId")
                                                                                                                                                                                                                                                                      java.lang.String orderId,
                                                                                                                                                                                                                                                                      @QueryParam(value="mode")
                                                                                                                                                                                                                                                                      java.lang.String mode,
                                                                                                                                                                                                                                                                      @QueryParam(value="responseFormat")
                                                                                                                                                                                                                                                                      java.lang.String responseFormat)
        This allows to add CSR comments to the order.
        Parameters:
        storeId - the store id.
        orderId - the order id.
        responseFormat -
        Returns:
      • getOrderCommentsByOrderId

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="{orderId}/comment")
        public javax.ws.rs.core.Response getOrderCommentsByOrderId(@PathParam(value="storeId")
                                                                                                                                                                                                                  java.lang.String storeId,
                                                                                                                                                                                                                  @PathParam(value="orderId")
                                                                                                                                                                                                                  java.lang.String orderId,
                                                                                                                                                                                                                  @QueryParam(value="isAsc")
                                                                                                                                                                                                                  boolean isAsc,
                                                                                                                                                                                                                  @QueryParam(value="orderByField")
                                                                                                                                                                                                                  java.lang.String orderByField,
                                                                                                                                                                                                                  @QueryParam(value="responseFormat")
                                                                                                                                                                                                                  java.lang.String responseFormat,
                                                                                                                                                                                                                  @QueryParam(value="pageNumber")
                                                                                                                                                                                                                  int pageNumber,
                                                                                                                                                                                                                  @QueryParam(value="pageSize")
                                                                                                                                                                                                                  int pageSize)
        Gets the comments for the specific order by order id.
        Parameters:
        storeId - the store id
        orderId - the order id.
        isAsc - if the returned comment sort by ascending or not.
        orderByField - the order by field.
        responseFormat - the response format.
        pageNumber - the page number.
        pageSize - the page size.
        Returns: