Class PageViewReport

java.lang.Object
com.day.crx.statistics.Report
com.day.cq.wcm.core.stats.PageViewReport

public class PageViewReport extends Report
PageViewReport implements a report that returns historical data about Page views.
  • Constructor Details

    • PageViewReport

      public PageViewReport(String dataPath, Page page, WCMMode mode)
      Creates a new report.
      Parameters:
      dataPath - the location where the result statistics are stored.
      page - the page that was viewed
      mode - the WCM mode that was used to view the page
  • Method Details

    • getResult

      public Iterator<Object[]> getResult(Session session) throws RepositoryException
      Runs the report and returns a result iterator over Object[] instances. Returns result rows with the following objects:
      • Path String, which indicates the day
      • Long count :how many times the page has been viewed on thath day
      • Long rollingCount: how many times the page has been viewed in the last 30days
      Specified by:
      getResult in class Report
      Parameters:
      session - the session giving access to the workspace.
      Returns:
      Iterator over Object results.
      Throws:
      RepositoryException - if an error occurs while reading from the repository.
    • getPeriod

      public int getPeriod()
      Returns:
      the report period in number of days
    • setPeriod

      public void setPeriod(int period)
      Parameters:
      period - the report period in number of days