Class DashboardServiceImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.dashboard.DashboardServiceImpl
- All Implemented Interfaces:
DashboardService
-
Constructor Summary
ConstructorsConstructorDescriptionDashboardServiceImpl(ActivityStreamServiceInternal activityStreamServiceInternal, PublishServiceInternal publishServiceInternal, ContentServiceInternal contentServiceInternal, SecurityService securityService, WorkflowServiceInternal workflowServiceInternal, ItemServiceInternal itemServiceInternal, SearchService searchService, StudioConfiguration studioConfiguration) -
Method Summary
Modifier and TypeMethodDescriptiongetActivitiesForUsers(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 usersgetContentExpired(String siteId, int offset, int limit) Get content that expiredgetContentExpiring(String siteId, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit) Get content that is expiringgetContentPendingApproval(String siteId, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) Get pending content for approvalgetContentPendingApprovalDetail(String siteId, String publishingPackageId, List<org.craftercms.commons.rest.parameters.SortField> sortFields) Get content pending approval package detailsintgetContentPendingApprovalTotal(String siteId, List<String> systemTypes) Get total number of content packages pending approvalgetContentUnpublished(String siteId, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) Get unpublished content itemsintgetContentUnpublishedTotal(String siteId, List<String> systemTypes) Get total number of unpublished contentgetMyActivities(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 activitiesgetPublishingHistory(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit) Get publishing historygetPublishingHistoryDetail(String siteId, String publishingPackageId, int offset, int limit) Get publishing package detailsintgetPublishingHistoryDetailTotalItems(String siteId, String publishingPackageId) Get publishing package detail total itemsintgetPublishingHistoryTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo) Get total number of result for publishing history with given filtersgetPublishingScheduled(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) Get publishing scheduledgetPublishingScheduledDetail(String siteId, String publishingPackageId) Get publishing package detailsintgetPublishingScheduledTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, List<String> systemTypes) Get total number of result for publishing scheduled with given filtersgetPublishingStats(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(String siteId, SearchResult results)
-
Constructor Details
-
DashboardServiceImpl
@ConstructorProperties({"activityStreamServiceInternal","publishServiceInternal","contentServiceInternal","securityService","workflowServiceInternal","itemServiceInternal","searchService","studioConfiguration"}) public DashboardServiceImpl(ActivityStreamServiceInternal activityStreamServiceInternal, PublishServiceInternal publishServiceInternal, ContentServiceInternal contentServiceInternal, SecurityService securityService, WorkflowServiceInternal workflowServiceInternal, ItemServiceInternal itemServiceInternal, SearchService searchService, StudioConfiguration studioConfiguration)
-
-
Method Details
-
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 usernames (or prefixes)actions- 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, List<String> systemTypes) throws SiteNotFoundException Description copied from interface:DashboardServiceGet total number of content packages pending approval- Specified by:
getContentPendingApprovalTotalin interfaceDashboardService- Parameters:
siteId- site identifiersystemTypes- list of system types to filter- Returns:
- number of results to return
- Throws:
SiteNotFoundException
-
getContentPendingApproval
public List<DetailedItem> getContentPendingApproval(String siteId, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) throws ServiceLayerException, UserNotFoundException Description copied from interface:DashboardServiceGet pending content for approval- Specified by:
getContentPendingApprovalin interfaceDashboardService- Parameters:
siteId- site identifiersystemTypes- list of system types to filtersortFields- list of sort fieldsoffset- offset of the first result itemlimit- number of results to return- Returns:
- list of DetailedItem waiting for approval
- Throws:
ServiceLayerExceptionUserNotFoundException
-
getContentPendingApprovalDetail
public List<SandboxItem> getContentPendingApprovalDetail(String siteId, String publishingPackageId, List<org.craftercms.commons.rest.parameters.SortField> sortFields) 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, List<String> systemTypes) throws SiteNotFoundException Description copied from interface:DashboardServiceGet total number of unpublished content- Specified by:
getContentUnpublishedTotalin interfaceDashboardService- Parameters:
siteId- site identifiersystemTypes- list of system types to filter- Returns:
- number of results to return
- Throws:
SiteNotFoundException
-
getContentUnpublished
public List<SandboxItem> getContentUnpublished(String siteId, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) throws UserNotFoundException, ServiceLayerException Description copied from interface:DashboardServiceGet unpublished content items- Specified by:
getContentUnpublishedin interfaceDashboardService- Parameters:
siteId- site identifiersystemTypes- list of system types to filtersortFields- list of sort fieldsoffset- offset of the first result itemlimit- number of results to return- Returns:
- list of unpublished content items
- 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, UserNotFoundException 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:
AuthenticationExceptionServiceLayerExceptionUserNotFoundException
-
getContentExpired
public ExpiringContentResult getContentExpired(String siteId, int offset, int limit) throws AuthenticationException, ServiceLayerException, UserNotFoundException 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:
AuthenticationExceptionServiceLayerExceptionUserNotFoundException
-
processResults
protected ExpiringContentResult processResults(String siteId, SearchResult results) throws ServiceLayerException, UserNotFoundException -
getPublishingScheduledTotal
public int getPublishingScheduledTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, List<String> systemTypes) 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 byapprover- approver user to filter bydateFrom- lower boundary to filter by date-time rangedateTo- upper boundary to filter by date-time rangesystemTypes- list of system types to filter- Returns:
- number of results
- Throws:
SiteNotFoundException
-
getPublishingScheduled
public List<DetailedItem> getPublishingScheduled(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) throws ServiceLayerException, UserNotFoundException Description copied from interface:DashboardServiceGet publishing scheduled- Specified by:
getPublishingScheduledin 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 rangesystemTypes- list of system types to filtersortFields- list of sort fieldsoffset- offset of the first result itemlimit- number of results to return- Returns:
- list of DetailedItem scheduled for publishing
- Throws:
ServiceLayerExceptionUserNotFoundException
-
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
-
getPublishingHistoryDetailTotalItems
public int getPublishingHistoryDetailTotalItems(String siteId, String publishingPackageId) throws SiteNotFoundException Description copied from interface:DashboardServiceGet publishing package detail total items- Specified by:
getPublishingHistoryDetailTotalItemsin interfaceDashboardService- Parameters:
siteId- site identifierpublishingPackageId- publishing package identifier- Returns:
- number of package items
- Throws:
SiteNotFoundException
-
getPublishingHistoryDetail
public List<SandboxItem> getPublishingHistoryDetail(String siteId, String publishingPackageId, int offset, int limit) throws UserNotFoundException, ServiceLayerException Description copied from interface:DashboardServiceGet publishing package details- Specified by:
getPublishingHistoryDetailin interfaceDashboardService- Parameters:
siteId- site identifierpublishingPackageId- publishing package identifieroffset- offset of the first result itemlimit- number of results to return- Returns:
- list of sandbox items included in given package
- Throws:
UserNotFoundExceptionServiceLayerException
-
getPublishingStats
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
-