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
Fields Modifier and Type Field Description protected org.springframework.context.ApplicationContext
applicationContext
protected ItemServiceInternal
itemServiceInternal
-
Constructor Summary
Constructors Constructor Description PublishServiceInternalImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelPublishingPackages(String siteId, List<String> packageIds)
Cancel publishing packagesvoid
cancelScheduledQueueItems(String siteId, List<String> paths)
Cancel scheduled items from publishing queueList<DeploymentHistoryItem>
getDeploymentHistory(String siteId, List<String> environments, ZonedDateTime fromDate, ZonedDateTime toDate, String filterType, int numberOfItems)
Get deployment history from databaseint
getNumberOfPublishedItemsByState(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 stateint
getNumberOfPublishes(String siteId, int days)
Get number of publishes for site in given number of daysList<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)
Get deployment history items for given search parametersint
getPublishingHistoryTotal(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 parametersPublishingPackageDetails
getPublishingPackageDetails(String siteId, String packageId)
Get publishing package detailsList<PublishingPackage>
getPublishingPackages(String siteId, String environment, String path, List<String> states, int offset, int limit)
Get publishing packages for given search parametersList<DashboardPublishingPackage>
getPublishingPackagesHistory(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit)
Get publishing packages historyint
getPublishingPackagesHistoryTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo)
Get total number of publishing packages for given filtersList<DashboardPublishingPackage>
getPublishingPackagesScheduled(String siteId, String publishingTarget, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit)
Get scheduled publishing packagesint
getPublishingPackagesScheduledTotal(String siteId, String publishingTarget, ZonedDateTime dateFrom, ZonedDateTime dateTo)
Get total number of scheduled publishing packages for given filtersint
getPublishingPackagesTotal(String siteId, String environment, String path, List<String> states)
Get total number of publishing packages for given search parametersvoid
initialPublish(String siteId)
Execute initial publish for given site.boolean
isSitePublished(String siteId)
Check if site has ever been published.RepositoryChanges
publishAll(String siteId, String publishingTarget, String comment)
Publishes all changes for the given site & targetvoid
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setContentRepository(ContentRepository contentRepository)
void
setItemServiceInternal(ItemServiceInternal itemServiceInternal)
void
setPublishRequestDao(PublishRequestDAO publishRequestDao)
void
setRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade)
-
-
-
Field Detail
-
itemServiceInternal
protected ItemServiceInternal itemServiceInternal
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Method Detail
-
getPublishingPackagesTotal
public int getPublishingPackagesTotal(String siteId, String environment, String path, List<String> states)
Description copied from interface:PublishServiceInternal
Get total number of publishing packages for given search parameters- Specified by:
getPublishingPackagesTotal
in 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:PublishServiceInternal
Get publishing packages for given search parameters- Specified by:
getPublishingPackages
in 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
public PublishingPackageDetails getPublishingPackageDetails(String siteId, String packageId)
Description copied from interface:PublishServiceInternal
Get publishing package details- Specified by:
getPublishingPackageDetails
in interfacePublishServiceInternal
- Parameters:
siteId
- site identifierpackageId
- package identifier- Returns:
- publishing package details
-
cancelPublishingPackages
public void cancelPublishingPackages(String siteId, List<String> packageIds)
Description copied from interface:PublishServiceInternal
Cancel publishing packages- Specified by:
cancelPublishingPackages
in 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:PublishServiceInternal
Get total number of publishing history items for given search parameters- Specified by:
getPublishingHistoryTotal
in 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:PublishServiceInternal
Get deployment history items for given search parameters- Specified by:
getPublishingHistory
in 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
-
getDeploymentHistory
public List<DeploymentHistoryItem> getDeploymentHistory(String siteId, List<String> environments, ZonedDateTime fromDate, ZonedDateTime toDate, String filterType, int numberOfItems)
Description copied from interface:PublishServiceInternal
Get deployment history from database- Specified by:
getDeploymentHistory
in 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
public void cancelScheduledQueueItems(String siteId, List<String> paths)
Description copied from interface:PublishServiceInternal
Cancel scheduled items from publishing queue- Specified by:
cancelScheduledQueueItems
in interfacePublishServiceInternal
- Parameters:
siteId
- site identifierpaths
- list of paths of content items to be cancelled
-
isSitePublished
public boolean isSitePublished(String siteId)
Description copied from interface:PublishServiceInternal
Check if site has ever been published.- Specified by:
isSitePublished
in interfacePublishServiceInternal
- Parameters:
siteId
- site identifier- Returns:
- true if site has been published at least once, otherwise false
-
initialPublish
public void initialPublish(String siteId) throws SiteNotFoundException
Description copied from interface:PublishServiceInternal
Execute initial publish for given site.- Specified by:
initialPublish
in interfacePublishServiceInternal
- Parameters:
siteId
- site identifier- Throws:
SiteNotFoundException
-
getPublishingPackagesScheduledTotal
public int getPublishingPackagesScheduledTotal(String siteId, String publishingTarget, ZonedDateTime dateFrom, ZonedDateTime dateTo)
Description copied from interface:PublishServiceInternal
Get total number of scheduled publishing packages for given filters- Specified by:
getPublishingPackagesScheduledTotal
in interfacePublishServiceInternal
- Parameters:
siteId
- site identifierpublishingTarget
- publishing targetdateFrom
- lower boundary for scheduledateTo
- upper boundary for schedule- Returns:
- total number of results
-
getPublishingPackagesScheduled
public List<DashboardPublishingPackage> getPublishingPackagesScheduled(String siteId, String publishingTarget, ZonedDateTime dateFrom, ZonedDateTime dateTo, int offset, int limit)
Description copied from interface:PublishServiceInternal
Get scheduled publishing packages- Specified by:
getPublishingPackagesScheduled
in interfacePublishServiceInternal
- Parameters:
siteId
- site identifierpublishingTarget
- publishing targetdateFrom
- lower boundary for scheduledateTo
- upper boundary for scheduleoffset
- offset of the first resultlimit
- limit number of results- Returns:
- list of dashboard publishing packages
-
getPublishingPackagesHistoryTotal
public int getPublishingPackagesHistoryTotal(String siteId, String publishingTarget, String approver, ZonedDateTime dateFrom, ZonedDateTime dateTo)
Description copied from interface:PublishServiceInternal
Get total number of publishing packages for given filters- Specified by:
getPublishingPackagesHistoryTotal
in 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:PublishServiceInternal
Get publishing packages history- Specified by:
getPublishingPackagesHistory
in 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
public int getNumberOfPublishes(String siteId, int days)
Description copied from interface:PublishServiceInternal
Get number of publishes for site in given number of days- Specified by:
getNumberOfPublishes
in 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:PublishServiceInternal
Get number of published items for site in given number of days filtered by their previous state- Specified by:
getNumberOfPublishedItemsByState
in 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
-
publishAll
public RepositoryChanges publishAll(String siteId, String publishingTarget, String comment) throws ServiceLayerException
Description copied from interface:PublishServiceInternal
Publishes all changes for the given site & target- Specified by:
publishAll
in 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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
setPublishRequestDao
public void setPublishRequestDao(PublishRequestDAO publishRequestDao)
-
setContentRepository
public void setContentRepository(ContentRepository contentRepository)
-
setRetryingDatabaseOperationFacade
public void setRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade)
-
setItemServiceInternal
public void setItemServiceInternal(ItemServiceInternal itemServiceInternal)
-
-