Class PublishServiceInternalImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.publish.internal.PublishServiceInternalImpl
- All Implemented Interfaces:
PublishServiceInternal,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class PublishServiceInternalImpl
extends Object
implements PublishServiceInternal, org.springframework.context.ApplicationContextAware
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected ItemServiceInternal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelPublishingPackages(String siteId, List<String> packageIds) Cancel publishing packagesvoidcancelScheduledQueueItems(String siteId, List<String> paths) Cancel scheduled items from publishing queuegetDeploymentHistory(String siteId, List<String> environments, ZonedDateTime fromDate, ZonedDateTime toDate, String filterType, int numberOfItems) Get deployment history from databaseintgetNumberOfPublishedItemsByState(String siteId, int days, String activityAction, String publishState, String publishAction) Get number of published items for site in given number of days filtered by their previous stateintgetNumberOfPublishes(String siteId, int days) Get number of publishes for site in given number of daysgetPublishingHistory(String siteId, String environment, String path, String publisher, ZonedDateTime dateFrom, ZonedDateTime dateTo, String contentType, long state, String sortBy, String order, int offset, int limit) Get deployment history items for given search parametersgetPublishingHistoryDetail(String siteId, String packageId, int offset, int limit) Get publishing history package detail itemsintgetPublishingHistoryDetailTotalItems(String siteId, String packageId) Get publishing history package detail total itemsintgetPublishingHistoryTotal(String siteId, String environment, String path, String publisher, ZonedDateTime dateFrom, ZonedDateTime dateTo, String contentType, long state) Get total number of publishing history items for given search parametersgetPublishingItemsScheduled(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 scheduled publishing itemsintgetPublishingItemsScheduledTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, List<String> systemTypes) Get total number of scheduled publishing items for given filtersgetPublishingPackageDetails(String siteId, String packageId) Get publishing package detailsgetPublishingPackages(String siteId, String environment, String path, List<String> states, int offset, int limit) Get publishing packages for given search parametersgetPublishingPackagesHistory(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit) Get publishing packages historyintgetPublishingPackagesHistoryTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo) Get total number of publishing packages for given filtersintGet total number of publishing packages for given search parametersvoidinitialPublish(String siteId) Execute initial publish for given site.booleanisSitePublished(String siteId) Check if site has ever been published.publishAll(String siteId, String publishingTarget, String comment) Publishes all changes for the given site & targetvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetContentRepository(ContentRepository contentRepository) voidsetItemServiceInternal(ItemServiceInternal itemServiceInternal) voidsetPublishRequestDao(PublishRequestDAO publishRequestDao) voidsetRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade)
-
Field Details
-
itemServiceInternal
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
PublishServiceInternalImpl
public PublishServiceInternalImpl()
-
-
Method Details
-
getPublishingPackagesTotal
public int getPublishingPackagesTotal(String siteId, String environment, String path, List<String> states) Description copied from interface:PublishServiceInternalGet total number of publishing packages for given search parameters- Specified by:
getPublishingPackagesTotalin interfacePublishServiceInternal- Parameters:
siteId- site identifierenvironment- publishing environmentpath- regular expression for pathsstates- publishing package states- Returns:
- total number of publishing packages
-
getPublishingPackages
public List<PublishingPackage> getPublishingPackages(String siteId, String environment, String path, List<String> states, int offset, int limit) Description copied from interface:PublishServiceInternalGet publishing packages for given search parameters- Specified by:
getPublishingPackagesin interfacePublishServiceInternal- Parameters:
siteId- site identifierenvironment- publishing environmentpath- regular expression for pathsstates- publishing package stateoffset- offset for paginationlimit- limit for pagination- Returns:
- list of publishing packages
-
getPublishingPackageDetails
Description copied from interface:PublishServiceInternalGet publishing package details- Specified by:
getPublishingPackageDetailsin interfacePublishServiceInternal- Parameters:
siteId- site identifierpackageId- package identifier- Returns:
- publishing package details
-
cancelPublishingPackages
Description copied from interface:PublishServiceInternalCancel publishing packages- Specified by:
cancelPublishingPackagesin interfacePublishServiceInternal- Parameters:
siteId- site identifierpackageIds- list of package identifiers
-
getPublishingHistoryTotal
public int getPublishingHistoryTotal(String siteId, String environment, String path, String publisher, ZonedDateTime dateFrom, ZonedDateTime dateTo, String contentType, long state) Description copied from interface:PublishServiceInternalGet total number of publishing history items for given search parameters- Specified by:
getPublishingHistoryTotalin interfacePublishServiceInternal- Parameters:
siteId- site identifierenvironment- environment to get publishing historypath- regular expression to filter pathspublisher- filter publishing history for specified userdateFrom- lower boundary for date rangedateTo- upper boundary for date rangecontentType- publishing history for specified content typestate- filter items by their state- Returns:
- total number of deployment history items
-
getPublishingHistory
public List<PublishingHistoryItem> getPublishingHistory(String siteId, String environment, String path, String publisher, ZonedDateTime dateFrom, ZonedDateTime dateTo, String contentType, long state, String sortBy, String order, int offset, int limit) Description copied from interface:PublishServiceInternalGet deployment history items for given search parameters- Specified by:
getPublishingHistoryin interfacePublishServiceInternal- Parameters:
siteId- site identifierenvironment- environment to get publishing historypath- regular expression to filter pathspublisher- filter publishing history for specified userdateFrom- lower boundary for date rangedateTo- upper boundary for date rangecontentType- publishing history for specified content typestate- filter items by their statesortBy- sort publishing historyorder- apply order to publishing historyoffset- offset of the first item in the result setlimit- number of items to return- Returns:
- total number of publishing packages
-
getPublishingHistoryDetailTotalItems
Description copied from interface:PublishServiceInternalGet publishing history package detail total items- Specified by:
getPublishingHistoryDetailTotalItemsin interfacePublishServiceInternal- Parameters:
siteId- site identifierpackageId- package identifier- Returns:
- number of package items
-
getPublishingHistoryDetail
public List<PublishRequest> getPublishingHistoryDetail(String siteId, String packageId, int offset, int limit) Description copied from interface:PublishServiceInternalGet publishing history package detail items- Specified by:
getPublishingHistoryDetailin interfacePublishServiceInternal- Parameters:
siteId- site identifierpackageId- package identifieroffset- offset of the first resultlimit- limit number of results- Returns:
- publishing history package's items
-
getDeploymentHistory
public List<DeploymentHistoryItem> getDeploymentHistory(String siteId, List<String> environments, ZonedDateTime fromDate, ZonedDateTime toDate, String filterType, int numberOfItems) Description copied from interface:PublishServiceInternalGet deployment history from database- Specified by:
getDeploymentHistoryin interfacePublishServiceInternal- Parameters:
siteId- site identifierenvironments- list of environmentsfromDate- starting date for filtering resultstoDate- end date for filtering resultsfilterType- filter typenumberOfItems- number of items to get- Returns:
-
cancelScheduledQueueItems
Description copied from interface:PublishServiceInternalCancel scheduled items from publishing queue- Specified by:
cancelScheduledQueueItemsin interfacePublishServiceInternal- Parameters:
siteId- site identifierpaths- list of paths of content items to be cancelled
-
isSitePublished
Description copied from interface:PublishServiceInternalCheck if site has ever been published.- Specified by:
isSitePublishedin interfacePublishServiceInternal- Parameters:
siteId- site identifier- Returns:
- true if site has been published at least once, otherwise false
-
initialPublish
Description copied from interface:PublishServiceInternalExecute initial publish for given site.- Specified by:
initialPublishin interfacePublishServiceInternal- Parameters:
siteId- site identifier- Throws:
SiteNotFoundException
-
getPublishingItemsScheduledTotal
public int getPublishingItemsScheduledTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, List<String> systemTypes) Description copied from interface:PublishServiceInternalGet total number of scheduled publishing items for given filters- Specified by:
getPublishingItemsScheduledTotalin interfacePublishServiceInternal- Parameters:
siteId- site identifierpublishingTarget- publishing targetapprover- approverdateFrom- lower boundary for scheduledateTo- upper boundary for schedulesystemTypes- system types- Returns:
- total number of results
-
getPublishingItemsScheduled
public List<PublishRequest> getPublishingItemsScheduled(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) Description copied from interface:PublishServiceInternalGet scheduled publishing items- Specified by:
getPublishingItemsScheduledin interfacePublishServiceInternal- Parameters:
siteId- site identifierpublishingTarget- publishing targetapprover- approverdateFrom- lower boundary for scheduledateTo- upper boundary for schedulesystemTypes- system typessortFields- sort fieldsoffset- offset of the first resultlimit- limit number of results- Returns:
- list of publishing request items
-
getPublishingPackagesHistoryTotal
public int getPublishingPackagesHistoryTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo) Description copied from interface:PublishServiceInternalGet total number of publishing packages for given filters- Specified by:
getPublishingPackagesHistoryTotalin interfacePublishServiceInternal- Parameters:
siteId- site identifierpublishingTarget- publishing targetapprover- approverdateFrom- lower boundary for historydateTo- upper boundary for history- Returns:
- total number of results
-
getPublishingPackagesHistory
public List<DashboardPublishingPackage> getPublishingPackagesHistory(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit) Description copied from interface:PublishServiceInternalGet publishing packages history- Specified by:
getPublishingPackagesHistoryin interfacePublishServiceInternal- Parameters:
siteId- site identifierpublishingTarget- publishing targetapprover- approverdateFrom- lower boundary for historydateTo- upper boundary for historyoffset- offset of the first resultlimit- limit number of results- Returns:
- list of dashboard publishing packages
-
getNumberOfPublishes
Description copied from interface:PublishServiceInternalGet number of publishes for site in given number of days- Specified by:
getNumberOfPublishesin interfacePublishServiceInternal- Parameters:
siteId- site identifiersdays- number of days- Returns:
- number of publishes
-
getNumberOfPublishedItemsByState
public int getNumberOfPublishedItemsByState(String siteId, int days, String activityAction, String publishState, String publishAction) Description copied from interface:PublishServiceInternalGet number of published items for site in given number of days filtered by their previous state- Specified by:
getNumberOfPublishedItemsByStatein interfacePublishServiceInternal- Parameters:
siteId- site identifierdays- number of daysactivityAction- the activity action to filterpublishState- the publishing state to filterpublishAction- the publishing action to filter- Returns:
- number of newly created and published items
-
publishAll
public RepositoryChanges publishAll(String siteId, String publishingTarget, String comment) throws ServiceLayerException Description copied from interface:PublishServiceInternalPublishes all changes for the given site & target- Specified by:
publishAllin interfacePublishServiceInternal- Parameters:
siteId- the id of the sitepublishingTarget- the publishing target- Throws:
ServiceLayerException- if there is any error during publishing
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
setPublishRequestDao
-
setContentRepository
-
setRetryingDatabaseOperationFacade
public void setRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade) -
setItemServiceInternal
-