com.elasticpath.cmweb.ajaxservice.impl
Class DashboardAjaxServiceImpl

java.lang.Object
  extended by com.elasticpath.service.impl.AbstractEpServiceImpl
      extended by com.elasticpath.cmweb.ajaxservice.impl.DashboardAjaxServiceImpl
All Implemented Interfaces:
DashboardAjaxService, EpService

public class DashboardAjaxServiceImpl
extends AbstractEpServiceImpl
implements DashboardAjaxService

This service provides access to functionality and data (beans) for manipulating catalog objects on the Javascript client Dashboard page.


Constructor Summary
DashboardAjaxServiceImpl()
           
 
Method Summary
 java.util.List getCurrentMonthSalesStats(java.lang.String currencyCode)
          Get monthly sales stats -- an array of stats (# orders, #items, average items per order, average order value, revenue).
 java.util.List getCurrentWeekSalesStats(java.lang.String currencyCode)
          Get current week's sales stats -- an array of stats (# orders, #items, average items per order, average order value, revenue).
 java.util.List getCurrentYearSalesStats(java.lang.String currencyCode)
          Get current year's sales stats -- an array of stats (# orders, #items, average items per order, average order value, revenue).
 java.util.List getLastWeekSalesStats(java.lang.String currencyCode)
          Get sales stats for last week -- an array of stats (# orders, #items, average items per order, average order value, revenue).
 java.util.Map getQuickLinkStats()
          Get a map of order and promotion statistics, mapping from status (openOrders, holdOrders, activePromotions) to count.
 java.util.Map getStoreUsageStats()
          Get a map of store usage stats, mapping a period (day, lastDay, week, lastWeek, month, year) to an array of statistics (#registrations, #return customers, #new customers).
 java.util.List getTodaySalesStats(java.lang.String currencyCode)
          Get today's sales stats -- an array of stats (# orders, #items, average items per order, average order value, revenue).
 java.util.List getTopCategoriesStats(java.lang.String period, int maxResults)
          Get a list of the top selling leaf categories for the given time period.
 java.util.List getTopProductsStats(java.lang.String period, int maxResults)
          Get a list of the top selling products for the given time period.
 java.util.List getYesterdaySalesStats(java.lang.String currencyCode)
          Get yesterday's sales stats -- an array of stats (# orders, #items, average items per order, average order value, revenue).
 void setCategoryService(CategoryService categoryService)
          Set the category service.
 void setCustomerReportService(CustomerReportService customerReportService)
          Set the Customer Report Service.
 void setOrderReportService(OrderReportService orderReportService)
          Set the Order Report Service.
 void setProductService(ProductService productService)
          Set the Product Service.
 void setPromotionReportService(PromotionReportService promotionReportService)
          Set the promotion Report Service.
 void setTopSellerService(TopSellerService topSellerService)
          Set the Top Seller Service.
 
Methods inherited from class com.elasticpath.service.impl.AbstractEpServiceImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Constructor Detail

DashboardAjaxServiceImpl

public DashboardAjaxServiceImpl()
Method Detail

getCurrentMonthSalesStats

public java.util.List getCurrentMonthSalesStats(java.lang.String currencyCode)
Get monthly sales stats -- an array of stats (# orders, #items, average items per order, average order value, revenue).

Specified by:
getCurrentMonthSalesStats in interface DashboardAjaxService
Parameters:
currencyCode - The currency code to calculate statistics for.
Returns:
an array of sales stats data.

getCurrentWeekSalesStats

public java.util.List getCurrentWeekSalesStats(java.lang.String currencyCode)
Get current week's sales stats -- an array of stats (# orders, #items, average items per order, average order value, revenue).

Specified by:
getCurrentWeekSalesStats in interface DashboardAjaxService
Parameters:
currencyCode - The currency code to calculate statistics for.
Returns:
an array of sales stats data.

getCurrentYearSalesStats

public java.util.List getCurrentYearSalesStats(java.lang.String currencyCode)
Get current year's sales stats -- an array of stats (# orders, #items, average items per order, average order value, revenue).

Specified by:
getCurrentYearSalesStats in interface DashboardAjaxService
Parameters:
currencyCode - The currency code to calculate statistics for.
Returns:
an array of sales stats data.

getLastWeekSalesStats

public java.util.List getLastWeekSalesStats(java.lang.String currencyCode)
Get sales stats for last week -- an array of stats (# orders, #items, average items per order, average order value, revenue).

Specified by:
getLastWeekSalesStats in interface DashboardAjaxService
Parameters:
currencyCode - The currency code to calculate statistics for.
Returns:
an array of sales stats data.

getQuickLinkStats

public java.util.Map getQuickLinkStats()
Get a map of order and promotion statistics, mapping from status (openOrders, holdOrders, activePromotions) to count.

Specified by:
getQuickLinkStats in interface DashboardAjaxService
Returns:
Map of usage data.

getStoreUsageStats

public java.util.Map getStoreUsageStats()
Get a map of store usage stats, mapping a period (day, lastDay, week, lastWeek, month, year) to an array of statistics (#registrations, #return customers, #new customers).

Specified by:
getStoreUsageStats in interface DashboardAjaxService
Returns:
Map of usage data.

getTodaySalesStats

public java.util.List getTodaySalesStats(java.lang.String currencyCode)
Get today's sales stats -- an array of stats (# orders, #items, average items per order, average order value, revenue).

Specified by:
getTodaySalesStats in interface DashboardAjaxService
Parameters:
currencyCode - The currency code to calculate statistics for.
Returns:
an array of sales stats data.

getTopCategoriesStats

public java.util.List getTopCategoriesStats(java.lang.String period,
                                            int maxResults)
Get a list of the top selling leaf categories for the given time period.

Specified by:
getTopCategoriesStats in interface DashboardAjaxService
Parameters:
period - Time period to calculate for (day, lastDay, week, lastWeek, month, year).
maxResults - Number of top categories to return.
Returns:
List of size maxResults containing arrays Category Product Name and Sales Count.

getTopProductsStats

public java.util.List getTopProductsStats(java.lang.String period,
                                          int maxResults)
Get a list of the top selling products for the given time period.

Specified by:
getTopProductsStats in interface DashboardAjaxService
Parameters:
period - Time period to calculate for (day, lastDay, week, lastWeek, month, year).
maxResults - Number of top products to return.
Returns:
List of size maxResults containing arrays of Product Name and Sales Count.

getYesterdaySalesStats

public java.util.List getYesterdaySalesStats(java.lang.String currencyCode)
Get yesterday's sales stats -- an array of stats (# orders, #items, average items per order, average order value, revenue).

Specified by:
getYesterdaySalesStats in interface DashboardAjaxService
Parameters:
currencyCode - The currency code to calculate statistics for.
Returns:
an array of sales stats data.

setCategoryService

public void setCategoryService(CategoryService categoryService)
Set the category service.

Parameters:
categoryService - The service

setCustomerReportService

public void setCustomerReportService(CustomerReportService customerReportService)
Set the Customer Report Service.

Parameters:
customerReportService - The report service

setOrderReportService

public void setOrderReportService(OrderReportService orderReportService)
Set the Order Report Service.

Parameters:
orderReportService - The report service

setProductService

public void setProductService(ProductService productService)
Set the Product Service.

Parameters:
productService - The service

setPromotionReportService

public void setPromotionReportService(PromotionReportService promotionReportService)
Set the promotion Report Service.

Parameters:
promotionReportService - The report service

setTopSellerService

public void setTopSellerService(TopSellerService topSellerService)
Set the Top Seller Service.

Parameters:
topSellerService - The report service