com.day.cq.wcm.core.stats.PageViewReport Maven / Gradle / Ivy
/*
* Copyright 1997-2008 Day Management AG
* Barfuesserplatz 6, 4001 Basel, Switzerland
* All Rights Reserved.
*
* This software is the confidential and proprietary information of
* Day Management AG, ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Day.
*/
package com.day.cq.wcm.core.stats;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.jcr.Item;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import org.apache.jackrabbit.util.Text;
import com.day.cq.wcm.api.Page;
import com.day.cq.wcm.api.WCMMode;
import com.day.crx.statistics.Report;
/**
* PageViewReport
implements a report that returns historical data
* about {@link Page} views.
*
* @author asaar
*/
public class PageViewReport extends Report {
/** Default period is 30 days*/
private int period = 30;
/** The page */
private final Page page;
/** The WCM mode */
private final WCMMode mode;
/**
* Creates a new report.
*
* @param dataPath
* the location where the result statistics are stored.
* @param page
* the page that was viewed
* @param mode
* the WCM mode that was used to view the page
*/
public PageViewReport(String dataPath, Page page, WCMMode mode) {
super(dataPath);
this.page = page;
this.mode = mode;
}
/**
* {@inheritDoc} 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
*
*/
public Iterator