com.ibm.commerce.rest.marketing.handler

Class PromotionHandler

    • 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
        The Constant RESOURCE_NAME.
        See Also:
        Constant Field Values
      • RESOURCE_MAPPING_KEY

        public static final java.lang.String RESOURCE_MAPPING_KEY
        The Constant RESOURCE_MAPPING_KEY.
        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
    • Constructor Detail

      • PromotionHandler

        public PromotionHandler()
    • Method Detail

      • getUri

        public javax.ws.rs.core.UriInfo getUri()
        Get the URI of the atom feed request.
        Returns:
        the uri
      • getResourceName

        public java.lang.String getResourceName()
        This method returns the resource name.
        Returns:
        the resource name.
      • getHelper

        public PromotionHelper getHelper()
        Return the BOD helper associated with the eSpot resource.
        Returns:
        PromotionHelper
      • getPromotionsByQuery

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
        public javax.ws.rs.core.Response getPromotionsByQuery(@PathParam(value="storeId")
                                                                                                                                                                           java.lang.String storeId,
                                                                                                                                                                           @QueryParam(value="langId")
                                                                                                                                                                           java.lang.String langId,
                                                                                                                                                                           @QueryParam(value="q")
                                                                                                                                                                           java.lang.String q,
                                                                                                                                                                           @QueryParam(value="qName")
                                                                                                                                                                           java.lang.String name,
                                                                                                                                                                           @QueryParam(value="responseFormat")
                                                                                                                                                                           java.lang.String responseFormat,
                                                                                                                                                                           @QueryParam(value="pageNumber")
                                                                                                                                                                           int pageNumber,
                                                                                                                                                                           @QueryParam(value="pageSize")
                                                                                                                                                                           int pageSize)
        This method gets promotion list for the store. When q supplied with byName, it will perform search by name.
        Parameters:
        storeId - the store id.
        langId - the language id.
        q - query parameter.
        name - name to be search.
        responseFormat - the response format.
        pageNumber - the page number.
        pageSize - the page size.
        Returns:
        a collection of Promotion nouns in the specified format.
      • getPromotionByID

        @GET
         @Path(value="{promotionId}")
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
        public javax.ws.rs.core.Response getPromotionByID(@PathParam(value="storeId")
                                                                                                                                                                                                     java.lang.String storeId,
                                                                                                                                                                                                     @PathParam(value="promotionId")
                                                                                                                                                                                                     int promotionId,
                                                                                                                                                                                                     @QueryParam(value="langId")
                                                                                                                                                                                                     java.lang.String langId,
                                                                                                                                                                                                     @QueryParam(value="responseFormat")
                                                                                                                                                                                                     java.lang.String responseFormat)
        This method gets the promotion by promotion id.
        Parameters:
        storeId - The store id.
        promotionId - The promotion id.
        langId - The language id.
        responseFormat - The response format.
        Returns:
        The array of promotion details in the specified format.
      • 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.