Class DashboardServiceImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v2.service.dashboard.DashboardServiceImpl
-
- All Implemented Interfaces:
DashboardService
public class DashboardServiceImpl extends Object implements DashboardService
-
-
Constructor Summary
Constructors Constructor Description DashboardServiceImpl(ActivityStreamServiceInternal activityStreamServiceInternal, PublishServiceInternal publishServiceInternal, ContentServiceInternal contentServiceInternal, SecurityService securityService, WorkflowServiceInternal workflowServiceInternal, ItemServiceInternal itemServiceInternal, SearchService searchService, StudioConfiguration studioConfiguration, SiteService siteService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Activity>getActivitiesForUsers(String siteId, List<String> usernames, List<String> actions, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit)Get activities for usersintgetActivitiesForUsersTotal(String siteId, List<String> usernames, List<String> actions, ZonedDateTime dateFrom, ZonedDateTime dateTo)Get total number of result for activities of given usersExpiringContentResultgetContentExpired(String siteId, int offset, int limit)Get content that expiredExpiringContentResultgetContentExpiring(String siteId, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit)Get content that is expiringList<DetailedItem>getContentPendingApproval(String siteId, int offset, int limit)Get pending content for approvalList<SandboxItem>getContentPendingApprovalDetail(String siteId, String publishingPackageId)Get content pending approval package detailsintgetContentPendingApprovalTotal(String siteId)Get total number of content packages pending approvalList<SandboxItem>getContentUnpublished(String siteId, int offset, int limit)Get unpublished content itemsintgetContentUnpublishedTotal(String siteId)Get total number of unpublished contentList<Activity>getMyActivities(String siteId, List<String> actions, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit)Get my activitiesintgetMyActivitiesTotal(String siteId, List<String> actions, ZonedDateTime dateFrom, ZonedDateTime dateTo)Get total number of result for my activitiesList<DashboardPublishingPackage>getPublishingHistory(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit)Get publishing historyList<SandboxItem>getPublishingHistoryDetail(String siteId, String publishingPackageId)Get publishing package detailsintgetPublishingHistoryTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo)Get total number of result for publishing history with given filtersList<DashboardPublishingPackage>getPublishingScheduled(String siteId, String publishingTarget, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit)Get publishing scheduledList<SandboxItem>getPublishingScheduledDetail(String siteId, String publishingPackageId)Get publishing package detailsintgetPublishingScheduledTotal(String siteId, String publishingTarget, ZonedDateTime dateFrom, ZonedDateTime dateTo)Get total number of result for publishing scheduled with given filtersPublishingStatsgetPublishingStats(String siteId, int days)Get publishing stats for site for given time periodprotected voidprepareSearchParams(SearchParams searchParams, String query, String order, int offset, int limit)protected ExpiringContentResultprocessResults(SearchResult results)
-
-
-
Constructor Detail
-
DashboardServiceImpl
@ConstructorProperties({"activityStreamServiceInternal","publishServiceInternal","contentServiceInternal","securityService","workflowServiceInternal","itemServiceInternal","searchService","studioConfiguration","siteService"}) public DashboardServiceImpl(ActivityStreamServiceInternal activityStreamServiceInternal, PublishServiceInternal publishServiceInternal, ContentServiceInternal contentServiceInternal, SecurityService securityService, WorkflowServiceInternal workflowServiceInternal, ItemServiceInternal itemServiceInternal, SearchService searchService, StudioConfiguration studioConfiguration, SiteService siteService)
-
-
Method Detail
-
getActivitiesForUsersTotal
public int getActivitiesForUsersTotal(String siteId, List<String> usernames, List<String> actions, ZonedDateTime dateFrom, ZonedDateTime dateTo) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet total number of result for activities of given users- Specified by:
getActivitiesForUsersTotalin interfaceDashboardService- Parameters:
siteId- site identifierusernames- list of usernamesactions- list of actions to filterdateFrom- lower boundary to filter by date-time rangedateTo- upper boundary to filter by date-time range- Returns:
- number of results
- Throws:
SiteNotFoundException
-
getActivitiesForUsers
public List<Activity> getActivitiesForUsers(String siteId, List<String> usernames, List<String> actions, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet activities for users- Specified by:
getActivitiesForUsersin interfaceDashboardService- Parameters:
siteId- site identifierusernames- list of usernamesactions- list of actions to filterdateFrom- lower boundary to filter by date-time rangedateTo- upper boundary to filter by date-time rangeoffset- offset of the first result itemlimit- number of results to return- Returns:
- the list of activities
- Throws:
SiteNotFoundException
-
getMyActivitiesTotal
public int getMyActivitiesTotal(String siteId, List<String> actions, ZonedDateTime dateFrom, ZonedDateTime dateTo) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet total number of result for my activities- Specified by:
getMyActivitiesTotalin interfaceDashboardService- Parameters:
siteId- site identifieractions- list of actions to filterdateFrom- lower boundary to filter by date-time rangedateTo- upper boundary to filter by date-time range- Returns:
- number of results
- Throws:
SiteNotFoundException
-
getMyActivities
public List<Activity> getMyActivities(String siteId, List<String> actions, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet my activities- Specified by:
getMyActivitiesin interfaceDashboardService- Parameters:
siteId- site identifieractions- list of actions to filterdateFrom- lower boundary to filter by date-time rangedateTo- upper boundary to filter by date-time rangeoffset- offset of the first result itemlimit- number of results to return- Returns:
- the list of activities
- Throws:
SiteNotFoundException
-
getContentPendingApprovalTotal
public int getContentPendingApprovalTotal(String siteId) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet total number of content packages pending approval- Specified by:
getContentPendingApprovalTotalin interfaceDashboardService- Parameters:
siteId- site identifier- Returns:
- number of results to return
- Throws:
SiteNotFoundException
-
getContentPendingApproval
public List<DetailedItem> getContentPendingApproval(String siteId, int offset, int limit) throws ServiceLayerException, UserNotFoundException
Description copied from interface:DashboardServiceGet pending content for approval- Specified by:
getContentPendingApprovalin interfaceDashboardService- Returns:
- list of DetailedItem waiting for approval
- Throws:
ServiceLayerExceptionUserNotFoundException
-
getContentPendingApprovalDetail
public List<SandboxItem> getContentPendingApprovalDetail(String siteId, String publishingPackageId) throws UserNotFoundException, ServiceLayerException
Description copied from interface:DashboardServiceGet content pending approval package details- Specified by:
getContentPendingApprovalDetailin interfaceDashboardService- Parameters:
siteId- site identifierpublishingPackageId- publishing package identifier- Returns:
- list of sandbox items included in given package
- Throws:
UserNotFoundExceptionServiceLayerException
-
getContentUnpublishedTotal
public int getContentUnpublishedTotal(String siteId) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet total number of unpublished content- Specified by:
getContentUnpublishedTotalin interfaceDashboardService- Parameters:
siteId- site identifier- Returns:
- number of results to return
- Throws:
SiteNotFoundException
-
getContentUnpublished
public List<SandboxItem> getContentUnpublished(String siteId, int offset, int limit) throws UserNotFoundException, ServiceLayerException
Description copied from interface:DashboardServiceGet unpublished content items- Specified by:
getContentUnpublishedin interfaceDashboardService- Returns:
- Throws:
UserNotFoundExceptionServiceLayerException
-
prepareSearchParams
protected void prepareSearchParams(SearchParams searchParams, String query, String order, int offset, int limit)
-
getContentExpiring
public ExpiringContentResult getContentExpiring(String siteId, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit) throws AuthenticationException, ServiceLayerException
Description copied from interface:DashboardServiceGet content that is expiring- Specified by:
getContentExpiringin interfaceDashboardService- Parameters:
siteId- site identifierdateFrom- lower boundary to filter by date-time rangedateTo- upper boundary to filter by date-time rangeoffset- offset of the first result itemlimit- number of results to return- Returns:
- list of content items that is expiring
- Throws:
AuthenticationExceptionServiceLayerException
-
getContentExpired
public ExpiringContentResult getContentExpired(String siteId, int offset, int limit) throws AuthenticationException, ServiceLayerException
Description copied from interface:DashboardServiceGet content that expired- Specified by:
getContentExpiredin interfaceDashboardService- Parameters:
siteId- site identifieroffset- offset of the first result itemlimit- number of results to return- Returns:
- list of content items that expired
- Throws:
AuthenticationExceptionServiceLayerException
-
processResults
protected ExpiringContentResult processResults(SearchResult results)
-
getPublishingScheduledTotal
public int getPublishingScheduledTotal(String siteId, String publishingTarget, ZonedDateTime dateFrom, ZonedDateTime dateTo) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet total number of result for publishing scheduled with given filters- Specified by:
getPublishingScheduledTotalin interfaceDashboardService- Parameters:
siteId- site identifierpublishingTarget- publishing target to filter bydateFrom- lower boundary to filter by date-time rangedateTo- upper boundary to filter by date-time range- Returns:
- number of results
- Throws:
SiteNotFoundException
-
getPublishingScheduled
public List<DashboardPublishingPackage> getPublishingScheduled(String siteId, String publishingTarget, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet publishing scheduled- Specified by:
getPublishingScheduledin interfaceDashboardService- Parameters:
siteId- site identifierpublishingTarget- publishing target to filter bydateFrom- lower boundary to filter by date-time rangedateTo- upper boundary to filter by date-time rangeoffset- offset of the first result itemlimit- number of results to return- Returns:
- Throws:
SiteNotFoundException
-
getPublishingScheduledDetail
public List<SandboxItem> getPublishingScheduledDetail(String siteId, String publishingPackageId) throws UserNotFoundException, ServiceLayerException
Description copied from interface:DashboardServiceGet publishing package details- Specified by:
getPublishingScheduledDetailin interfaceDashboardService- Parameters:
siteId- site identifierpublishingPackageId- publishing package identifier- Returns:
- list of sandbox items included in given package
- Throws:
UserNotFoundExceptionServiceLayerException
-
getPublishingHistoryTotal
public int getPublishingHistoryTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet total number of result for publishing history with given filters- Specified by:
getPublishingHistoryTotalin interfaceDashboardService- Parameters:
siteId- site identifierpublishingTarget- publishing target to filter byapprover- approver user to filter bydateFrom- lower boundary to filter by date-time rangedateTo- upper boundary to filter by date-time range- Returns:
- number of results
- Throws:
SiteNotFoundException
-
getPublishingHistory
public List<DashboardPublishingPackage> getPublishingHistory(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet publishing history- Specified by:
getPublishingHistoryin interfaceDashboardService- Parameters:
siteId- site identifierpublishingTarget- publishing target to filter byapprover- approver user to filter bydateFrom- lower boundary to filter by date-time rangedateTo- upper boundary to filter by date-time rangeoffset- offset of the first result itemlimit- number of results to return- Returns:
- Throws:
SiteNotFoundException
-
getPublishingHistoryDetail
public List<SandboxItem> getPublishingHistoryDetail(String siteId, String publishingPackageId) throws UserNotFoundException, ServiceLayerException
Description copied from interface:DashboardServiceGet publishing package details- Specified by:
getPublishingHistoryDetailin interfaceDashboardService- Parameters:
siteId- site identifierpublishingPackageId- publishing package identifier- Returns:
- list of sandbox items included in given package
- Throws:
UserNotFoundExceptionServiceLayerException
-
getPublishingStats
public PublishingStats getPublishingStats(String siteId, int days) throws SiteNotFoundException
Description copied from interface:DashboardServiceGet publishing stats for site for given time period- Specified by:
getPublishingStatsin interfaceDashboardService- Parameters:
siteId- site identifierdays- number of days- Returns:
- publishing stats
- Throws:
SiteNotFoundException
-
-