com.solidstategroup.sitetracker.data
Class PageDataHome

java.lang.Object
  extended by com.solidstategroup.data.DataAccess
      extended by com.solidstategroup.data.FilteredDataAccess
          extended by com.solidstategroup.sitetracker.data.PageDataHome

public class PageDataHome
extends FilteredDataAccess

User: Phil Date: 31-Mar-2005 Time: 12:56:09


Field Summary
static int ORDER_BY_FIRST_VIEWED
           
static int ORDER_BY_LAST_VIEWED
           
static int ORDER_BY_PAGE_IMPRESSIONS
           
static int ORDER_BY_SESSION_VISITS
           
static int ORDER_BY_TOTAL_VIEWING_TIMES
           
static java.lang.String SQL_GETBY_DATE_RAT_ALL
           
static java.lang.String SQL_GETBY_DATE_RAT_DAY
           
static java.lang.String SQL_GETBY_DATE_RAT_HOUR
           
static java.lang.String SQL_GETBY_DATE_RAT_MONTH
           
static java.lang.String SQL_INSERT_ALL
           
static java.lang.String SQL_INSERT_DAY
           
static java.lang.String SQL_INSERT_HOUR
           
static java.lang.String SQL_INSERT_MONTH
           
static java.lang.String SQL_TIMEVIEWED
          SQL Statements
static int TYPE_ALL
           
static int TYPE_DAY
           
static int TYPE_HOUR
           
static int TYPE_MONTH
           
 
Fields inherited from class com.solidstategroup.data.DataAccess
connection, DATA_NO, DATA_YES, NULL_VALUE, ORDER_BY_COUNT, SQL_COUNT, SQL_LIMIT
 
Constructor Summary
PageDataHome(java.sql.Connection connection)
           
 
Method Summary
protected  java.util.Collection configFilter(DataFilter filter, java.lang.StringBuffer stmt)
          Builds up the SQL statement for extracting PageVisits based on the Filter
 int countByFilter(DataFilter filter)
           
protected  java.lang.Object extractData(java.sql.ResultSet rs)
           
 java.util.Collection findByFilter(DataFilter filter)
           
 Page getByDateAndRootArticleId(java.util.Date date, int rootArticleId, int rootArticleTypeId, int templateId, int type)
          this Will attempt to pull the PageData first from the map cache then from the database.
 double[] getHourlyAverage(PageDataFilter filter)
          Found this fantastic MYSQL function for grouping by day ;-)
 java.util.Collection getPopularPages(PageDataFilter filter)
           
protected  java.lang.String getSelectByRow()
           
protected  java.lang.String getSelectCount()
           
 void persistCachedData()
           
 void store(Page pageData)
          decides wether to insert or update
 void store(Pages pages)
           
 
Methods inherited from class com.solidstategroup.data.DataAccess
createEqualClause, createGreaterClause, createGreaterEqualClause, createInClause, createInt, createLessClause, createLessEqualClause, createLikeClause, findByPrimaryKey, getConnection, getCount, getDate, getInt, getResultSet, getRows, insertSql, setConnection, setDate, setInt, updateSql
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_HOUR

public static final int TYPE_HOUR
See Also:
Constant Field Values

TYPE_DAY

public static final int TYPE_DAY
See Also:
Constant Field Values

TYPE_MONTH

public static final int TYPE_MONTH
See Also:
Constant Field Values

TYPE_ALL

public static final int TYPE_ALL
See Also:
Constant Field Values

ORDER_BY_PAGE_IMPRESSIONS

public static final int ORDER_BY_PAGE_IMPRESSIONS
See Also:
Constant Field Values

ORDER_BY_TOTAL_VIEWING_TIMES

public static final int ORDER_BY_TOTAL_VIEWING_TIMES
See Also:
Constant Field Values

ORDER_BY_SESSION_VISITS

public static final int ORDER_BY_SESSION_VISITS
See Also:
Constant Field Values

ORDER_BY_FIRST_VIEWED

public static final int ORDER_BY_FIRST_VIEWED
See Also:
Constant Field Values

ORDER_BY_LAST_VIEWED

public static final int ORDER_BY_LAST_VIEWED
See Also:
Constant Field Values

SQL_TIMEVIEWED

public static final java.lang.String SQL_TIMEVIEWED
SQL Statements

See Also:
Constant Field Values

SQL_INSERT_HOUR

public static final java.lang.String SQL_INSERT_HOUR
See Also:
Constant Field Values

SQL_INSERT_DAY

public static final java.lang.String SQL_INSERT_DAY
See Also:
Constant Field Values

SQL_INSERT_MONTH

public static final java.lang.String SQL_INSERT_MONTH
See Also:
Constant Field Values

SQL_INSERT_ALL

public static final java.lang.String SQL_INSERT_ALL
See Also:
Constant Field Values

SQL_GETBY_DATE_RAT_HOUR

public static final java.lang.String SQL_GETBY_DATE_RAT_HOUR
See Also:
Constant Field Values

SQL_GETBY_DATE_RAT_DAY

public static final java.lang.String SQL_GETBY_DATE_RAT_DAY
See Also:
Constant Field Values

SQL_GETBY_DATE_RAT_MONTH

public static final java.lang.String SQL_GETBY_DATE_RAT_MONTH
See Also:
Constant Field Values

SQL_GETBY_DATE_RAT_ALL

public static final java.lang.String SQL_GETBY_DATE_RAT_ALL
See Also:
Constant Field Values
Constructor Detail

PageDataHome

public PageDataHome(java.sql.Connection connection)
Method Detail

getPopularPages

public java.util.Collection getPopularPages(PageDataFilter filter)

getHourlyAverage

public double[] getHourlyAverage(PageDataFilter filter)
Found this fantastic MYSQL function for grouping by day ;-)


findByFilter

public java.util.Collection findByFilter(DataFilter filter)
Overrides:
findByFilter in class FilteredDataAccess

countByFilter

public int countByFilter(DataFilter filter)
Overrides:
countByFilter in class FilteredDataAccess

getByDateAndRootArticleId

public Page getByDateAndRootArticleId(java.util.Date date,
                                      int rootArticleId,
                                      int rootArticleTypeId,
                                      int templateId,
                                      int type)
this Will attempt to pull the PageData first from the map cache then from the database. It will create a the object with these details if not found this should only be called from the SiteProcessor

Parameters:
date -
rootArticleId -
type -

persistCachedData

public void persistCachedData()

store

public void store(Pages pages)

store

public void store(Page pageData)
decides wether to insert or update

Parameters:
pageData -

configFilter

protected java.util.Collection configFilter(DataFilter filter,
                                            java.lang.StringBuffer stmt)
Builds up the SQL statement for extracting PageVisits based on the Filter

Specified by:
configFilter in class FilteredDataAccess
Parameters:
filter -
stmt -

getSelectByRow

protected java.lang.String getSelectByRow()
Specified by:
getSelectByRow in class FilteredDataAccess

getSelectCount

protected java.lang.String getSelectCount()
Specified by:
getSelectCount in class FilteredDataAccess

extractData

protected java.lang.Object extractData(java.sql.ResultSet rs)
                                throws java.sql.SQLException
Specified by:
extractData in class DataAccess
Throws:
java.sql.SQLException