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 Details

    • itemServiceInternal

      protected ItemServiceInternal 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: PublishServiceInternal
      Get total number of publishing packages for given search parameters
      Specified by:
      getPublishingPackagesTotal in interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      environment - publishing environment
      path - regular expression for paths
      states - 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 interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      environment - publishing environment
      path - regular expression for paths
      states - publishing package state
      offset - offset for pagination
      limit - 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 interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      packageId - 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 interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      packageIds - 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 interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      environment - environment to get publishing history
      path - regular expression to filter paths
      publisher - filter publishing history for specified user
      dateFrom - lower boundary for date range
      dateTo - upper boundary for date range
      contentType - publishing history for specified content type
      state - 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 interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      environment - environment to get publishing history
      path - regular expression to filter paths
      publisher - filter publishing history for specified user
      dateFrom - lower boundary for date range
      dateTo - upper boundary for date range
      contentType - publishing history for specified content type
      state - filter items by their state
      sortBy - sort publishing history
      order - apply order to publishing history
      offset - offset of the first item in the result set
      limit - number of items to return
      Returns:
      total number of publishing packages
    • getPublishingHistoryDetailTotalItems

      public int getPublishingHistoryDetailTotalItems(String siteId, String packageId)
      Description copied from interface: PublishServiceInternal
      Get publishing history package detail total items
      Specified by:
      getPublishingHistoryDetailTotalItems in interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      packageId - package identifier
      Returns:
      number of package items
    • getPublishingHistoryDetail

      public List<PublishRequest> getPublishingHistoryDetail(String siteId, String packageId, int offset, int limit)
      Description copied from interface: PublishServiceInternal
      Get publishing history package detail items
      Specified by:
      getPublishingHistoryDetail in interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      packageId - package identifier
      offset - offset of the first result
      limit - 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: PublishServiceInternal
      Get deployment history from database
      Specified by:
      getDeploymentHistory in interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      environments - list of environments
      fromDate - starting date for filtering results
      toDate - end date for filtering results
      filterType - filter type
      numberOfItems - 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 interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      paths - 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 interface PublishServiceInternal
      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 interface PublishServiceInternal
      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: PublishServiceInternal
      Get total number of scheduled publishing items for given filters
      Specified by:
      getPublishingItemsScheduledTotal in interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      publishingTarget - publishing target
      approver - approver
      dateFrom - lower boundary for schedule
      dateTo - upper boundary for schedule
      systemTypes - 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: PublishServiceInternal
      Get scheduled publishing items
      Specified by:
      getPublishingItemsScheduled in interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      publishingTarget - publishing target
      approver - approver
      dateFrom - lower boundary for schedule
      dateTo - upper boundary for schedule
      systemTypes - system types
      sortFields - sort fields
      offset - offset of the first result
      limit - 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: PublishServiceInternal
      Get total number of publishing packages for given filters
      Specified by:
      getPublishingPackagesHistoryTotal in interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      publishingTarget - publishing target
      approver - approver
      dateFrom - lower boundary for history
      dateTo - 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 interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      publishingTarget - publishing target
      approver - approver
      dateFrom - lower boundary for history
      dateTo - upper boundary for history
      offset - offset of the first result
      limit - 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 interface PublishServiceInternal
      Parameters:
      siteId - site identifiers
      days - 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 interface PublishServiceInternal
      Parameters:
      siteId - site identifier
      days - number of days
      activityAction - the activity action to filter
      publishState - the publishing state to filter
      publishAction - 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: PublishServiceInternal
      Publishes all changes for the given site & target
      Specified by:
      publishAll in interface PublishServiceInternal
      Parameters:
      siteId - the id of the site
      publishingTarget - 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 interface org.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)