pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.statistics.user
Class UserStatisticsController

java.lang.Object
  extended by org.torweg.pulse.bundle.Controller
      extended by org.torweg.pulse.component.statistics.user.UserStatisticsController
All Implemented Interfaces:
Configurable<UserStatisticsControllerConfiguration>
Direct Known Subclasses:
UserStatisticsGFXController

public class UserStatisticsController
extends Controller
implements Configurable<UserStatisticsControllerConfiguration>

Displays statistical information about Users.

Version:
$Revision: 1914 $
Author:
Daniel Dietz

Nested Class Summary
 
Nested classes/interfaces inherited from class org.torweg.pulse.bundle.Controller
Controller.AlwaysRun
 
Field Summary
protected static org.slf4j.Logger LOGGER
          The logger.
 
Constructor Summary
UserStatisticsController()
           
 
Method Summary
protected  UserStatisticsControllerResult buildInitialisationResult(java.lang.Integer year, java.lang.Integer months)
          Returns an UserStatisticsControllerResult for initialising the user-statistics within the pulse website-administration.
protected  UserStatisticsControllerConfiguration getConfiguration()
          Returns the UserStatisticsControllerConfiguration.
 void initialize(UserStatisticsControllerConfiguration conf)
          Initialises the Controller with the given Configuration.
 UserStatisticsControllerResult initUserStatistics(ServiceRequest request)
          Returns a JAXB-able result-object to initialise the pulse User- statistics-administration within the website-administration.
protected  java.util.Map<java.lang.String,java.lang.Long> loadMonthTotals(org.hibernate.Session s, java.lang.Integer months)
          Loads the monthly totals.
protected  java.lang.Long loadTotal(org.hibernate.Session s)
          Loads the total.
protected  java.util.Map<java.lang.Integer,java.lang.Long> loadYearTotals(org.hibernate.Session s, java.lang.Integer year)
          Loads the year totals.
 
Methods inherited from class org.torweg.pulse.bundle.Controller
getAlwaysRun, isAlwaysRun, setAlwaysRun
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final org.slf4j.Logger LOGGER
The logger.

Constructor Detail

UserStatisticsController

public UserStatisticsController()
Method Detail

initUserStatistics

@RequireToken
@Action(value="initUserStatistics", generate=true)
@Permission(value="initUserStatistics")
@Groups(values="Admin.User.Statistics")
public final UserStatisticsControllerResult initUserStatistics(ServiceRequest request)
Returns a JAXB-able result-object to initialise the pulse User- statistics-administration within the website-administration.

request parameter name description required default
year the year to start from (e.g. 2000 will produce chart for all Users created from 2000 until now) false as configured
months number of months to go back from current false as configured

Parameters:
request - the current ServiceRequest
Returns:
a JAXB-able result-object

buildInitialisationResult

protected final UserStatisticsControllerResult buildInitialisationResult(java.lang.Integer year,
                                                                         java.lang.Integer months)
Returns an UserStatisticsControllerResult for initialising the user-statistics within the pulse website-administration.

Parameters:
year - the (start-)year
months - the months to go back
Returns:
UserStatisticsControllerResult

loadTotal

protected final java.lang.Long loadTotal(org.hibernate.Session s)
Loads the total.

Parameters:
s - the current hibernateTM-Session.
Returns:
the total

loadYearTotals

protected final java.util.Map<java.lang.Integer,java.lang.Long> loadYearTotals(org.hibernate.Session s,
                                                                               java.lang.Integer year)
Loads the year totals.

Parameters:
s - the current hibernateTM-Session.
year - the year to start with when loading the data
Returns:
the year totals

loadMonthTotals

protected final java.util.Map<java.lang.String,java.lang.Long> loadMonthTotals(org.hibernate.Session s,
                                                                               java.lang.Integer months)
Loads the monthly totals.

Parameters:
s - the current hibernateTM-Session.
months - the number of months to go back from current
Returns:
the monthly totals

initialize

public final void initialize(UserStatisticsControllerConfiguration conf)
Initialises the Controller with the given Configuration.

Specified by:
initialize in interface Configurable<UserStatisticsControllerConfiguration>
Parameters:
conf - the Configuration

getConfiguration

protected final UserStatisticsControllerConfiguration getConfiguration()
Returns the UserStatisticsControllerConfiguration.

Returns:
UserStatisticsControllerConfiguration