Package org.cyclos.impl.system
Class AdsSubReportsHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseNetworkedHandlerImpl
-
- org.cyclos.impl.system.AdsSubReportsHandlerImpl
-
- All Implemented Interfaces:
AdsSubReportsHandler,AdsSubReportsTestableHandler,SubReportsHandler
@Component public class AdsSubReportsHandlerImpl extends BaseNetworkedHandlerImpl implements AdsSubReportsTestableHandler
Implementation for AdsSubReportsHandler
-
-
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 AdsSubReportsHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountActiveUsersWithAds(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)counts all the users having active ads at present, for state reports.Map<AdStatus,Integer>countAds(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)gets the ad count for each AdStatus.List<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
-
countActiveUsersWithAds
public int countActiveUsersWithAds(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)
counts all the users having active ads at present, for state reports.- Specified by:
countActiveUsersWithAdsin interfaceAdsSubReportsTestableHandler- Returns:
-
countAds
public Map<AdStatus,Integer> countAds(SystemReportQuery query, SubReportsHandler.PeriodLimit periodLimit)
gets the ad count for each AdStatus. Used for state reports- Specified by:
countAdsin interfaceAdsSubReportsTestableHandler- Returns:
-
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)
-
-