Package org.cyclos.impl.system
Class GroupSubReportsHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseNetworkedHandlerImpl
-
- org.cyclos.impl.system.GroupSubReportsHandlerImpl
-
- All Implemented Interfaces:
GroupSubReportsHandler,GroupSubReportsTestableHandler,SubReportsHandler
@Component public class GroupSubReportsHandlerImpl extends BaseNetworkedHandlerImpl implements GroupSubReportsTestableHandler
Implementation for GroupSubReportsHandler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.cyclos.impl.system.SubReportsHandler
SubReportsHandler.PeriodLimit
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description GroupSubReportsHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountActiveUsers(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)counts the non-removed usersMap<GroupVO,Integer>countGroupUsers(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)counts users in each group for state reports.intcountRemovedUsers(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)counts the non-removed usersList<ReportSection>data(SystemReportQuery query)Returns the section that should be included in the reportprotected DBQuery<?>getBaseMemberQuery(Set<? extends Group> groups, boolean excludeRemoved, Date date, org.cyclos.impl.system.SubReportsHandlerImpl.QueryType type)gets the base query for checking group membership at a certain time/period against the group history log.protected DBQuery<?>getBaseMemberQuery(Set<? extends Group> groups, DateTime date, org.cyclos.impl.system.SubReportsHandlerImpl.QueryType type)protected DateTimegetPeriodLimit(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)protected DategetPeriodLimitAsDate(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)intorder()The order the report sections are shown-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
countActiveUsers
public int countActiveUsers(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)
counts the non-removed users- Specified by:
countActiveUsersin interfaceGroupSubReportsTestableHandler- Returns:
- an integer with all users in all groups which are not removed
-
countGroupUsers
public Map<GroupVO,Integer> countGroupUsers(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)
counts users in each group for state reports.- Specified by:
countGroupUsersin interfaceGroupSubReportsTestableHandler- Returns:
- a map with a groupVO as key for each group, and a Long as value indicating the number of users in that group
-
countRemovedUsers
public int countRemovedUsers(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)
counts the non-removed users- Specified by:
countRemovedUsersin interfaceGroupSubReportsTestableHandler- Returns:
- an integer with all users in all groups which are removed
-
data
public List<ReportSection> data(SystemReportQuery query)
Description copied from interface:SubReportsHandlerReturns the section that should be included in the report- Specified by:
datain interfaceSubReportsHandler
-
order
public int order()
Description copied from interface:SubReportsHandlerThe order the report sections are shown- Specified by:
orderin interfaceSubReportsHandler- Returns:
-
getBaseMemberQuery
protected DBQuery<?> getBaseMemberQuery(Set<? extends Group> groups, boolean excludeRemoved, Date date, org.cyclos.impl.system.SubReportsHandlerImpl.QueryType type) throws IllegalArgumentException
gets the base query for checking group membership at a certain time/period against the group history log.- Parameters:
ugl- QGroupHistoryLog, to invoke further where clauses ongroups- the groups to check ondate- The point in timesub- if true returns a DBSubQuery, if false a DBQuery- Returns:
- A DBQuery, depending on the sub parameter. The result should be casted to either of those.
- Throws:
IllegalArgumentException- if both startDate and endDate on the period are null.
-
getBaseMemberQuery
protected DBQuery<?> getBaseMemberQuery(Set<? extends Group> groups, DateTime date, org.cyclos.impl.system.SubReportsHandlerImpl.QueryType type) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getPeriodLimit
protected DateTime getPeriodLimit(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)
-
getPeriodLimitAsDate
protected Date getPeriodLimitAsDate(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)
-
-