Interface PublishRequestDAO


public interface PublishRequestDAO
  • Field Details

  • Method Details

    • getPublishingPackagesTotal

      int getPublishingPackagesTotal(@Param("siteId") String siteId, @Param("environment") String environment, @Param("path") String path, @Param("states") List<String> states)
      Get total number of publishing package for given search filters
      Parameters:
      siteId - site identifier
      environment - publishing environment
      path - regular expression for paths
      states - publishing package state
      Returns:
      number of publishing packages
    • getPublishingPackages

      List<PublishingPackage> getPublishingPackages(@Param("siteId") String siteId, @Param("environment") String environment, @Param("path") String path, @Param("states") List<String> states, @Param("offset") int offset, @Param("limit") int limit)
      Get publishing packages for given search filters
      Parameters:
      siteId - site identifier
      environment - environment
      path - regular expression for paths
      states - publishing states package
      offset - offset for pagination
      limit - limit for pagination
      Returns:
      list of publishing packages
    • getPublishingPackageDetails

      List<PublishRequest> getPublishingPackageDetails(@Param("siteId") String siteId, @Param("packageId") String packageId)
      Get publishing package details
      Parameters:
      siteId - site identifier
      packageId - package id
      Returns:
      list of publishing requests belonging to the package
    • getPublishingHistoryDetailTotalItems

      int getPublishingHistoryDetailTotalItems(@Param("siteId") String siteId, @Param("packageId") String packageId)
      Get total number of items for a publishing package
      Parameters:
      siteId - site identifier
      packageId - package id
      Returns:
      number of package items
    • getPublishingHistoryDetail

      List<PublishRequest> getPublishingHistoryDetail(@Param("siteId") String siteId, @Param("packageId") String packageId, @Param("offset") int offset, @Param("limit") int limit)
      Get publishing package details
      Parameters:
      siteId - site identifier
      packageId - package id
      offset - offset for pagination
      limit - limit for pagination
      Returns:
      list of publishing requests belonging to the package
    • cancelPackages

      void cancelPackages(@Param("siteId") String siteId, @Param("packageIds") Collection<String> packageIds, @Param("cancelledState") String cancelledState)
      Cancel publishing packages
      Parameters:
      siteId - site identifier
      packageIds - list of package identifiers
      cancelledState - cancelled state
    • getScheduledDateForEnvironment

      ZonedDateTime getScheduledDateForEnvironment(@Param("siteId") String siteId, @Param("path") String path, @Param("environment") String environment, @Param("state") String state, @Param("now") ZonedDateTime now)
      Get scheduled date for environment item
      Parameters:
      siteId - site identifier
      path - path of the item
      environment - environment
      state - publishing queue ready state
      now - now
      Returns:
      Scheduled date
    • getDeploymentHistory

      List<PublishRequest> getDeploymentHistory(@Param("siteId") String siteId, @Param("environments") List<String> environments, @Param("completedState") String completedState, @Param("contentTypeClass") String contentTypeClass, @Param("fromDate") ZonedDateTime fromDate, @Param("toDate") ZonedDateTime toDate, @Param("offset") int offset, @Param("limit") int limit)
      Get deployment history
      Parameters:
      siteId - site identifier
      environments - environments
      completedState - completed state
      fromDate - get history from date
      toDate - get history to date
      offset - offset for pagination
      limit - number of records to return
      Returns:
    • cancelScheduledQueueItems

      void cancelScheduledQueueItems(@Param("siteId") String siteId, @Param("paths") List<String> paths, @Param("now") ZonedDateTime now, @Param("cancelledState") String cancelledState, @Param("readyState") String readyState)
      Cancel scheduled items from publishing queue
      Parameters:
      siteId - site identifier
      paths - list of paths of content items to be cancelled
      now - timestamp now
      cancelledState - cancelled state value
      readyState - ready for live state value
    • getPublishingItemsScheduledTotal

      Optional<Integer> getPublishingItemsScheduledTotal(@Param("siteId") String siteId, @Param("publishingTarget") String publishingTarget, @Param("approver") String approver, @Param("scheduledState") String scheduledState, @Param("fromDate") ZonedDateTime fromDate, @Param("toDate") ZonedDateTime toDate, @Param("systemTypes") List<String> systemTypes)
      Get number of scheduled publishing items results for given filters
      Parameters:
      siteId - site identifier
      publishingTarget - publishing target
      approver - approver
      scheduledState - scheduled state
      fromDate - get history from date
      toDate - get history to date
      systemTypes - system types to filter
      Returns:
      total number of results
    • getPublishingItemsScheduled

      List<PublishRequest> getPublishingItemsScheduled(@Param("siteId") String siteId, @Param("publishingTarget") String publishingTarget, @Param("approver") String approver, @Param("scheduledState") String scheduledState, @Param("fromDate") ZonedDateTime fromDate, @Param("toDate") ZonedDateTime toDate, @Param("systemTypes") List<String> systemTypes, @Param("sortFields") List<org.craftercms.commons.rest.parameters.SortField> sortFields, @Param("offset") int offset, @Param("limit") int limit)
      Get scheduled publishing items
      Parameters:
      siteId - site identifier
      publishingTarget - publishing target
      approver - approver
      scheduledState - scheduled state
      fromDate - get history from date
      toDate - get history to date
      systemTypes - system types to filter
      sortFields - sort fields
      offset - offset for pagination
      limit - number of records to return
      Returns:
    • getPublishingPackagesHistoryTotal

      Optional<Integer> getPublishingPackagesHistoryTotal(@Param("siteId") String siteId, @Param("publishingTarget") String publishingTarget, @Param("approver") String approver, @Param("completedState") String completedState, @Param("fromDate") ZonedDateTime fromDate, @Param("toDate") ZonedDateTime toDate)
      Get number of publishing packages history results for given filters
      Parameters:
      siteId - site identifier
      publishingTarget - publishing target
      approver - approver
      completedState - completed state
      fromDate - get history from date
      toDate - get history to date
      Returns:
      total number of results
    • getPublishingPackagesHistory

      List<DashboardPublishingPackage> getPublishingPackagesHistory(@Param("siteId") String siteId, @Param("publishingTarget") String publishingTarget, @Param("approver") String approver, @Param("completedState") String completedState, @Param("fromDate") ZonedDateTime fromDate, @Param("toDate") ZonedDateTime toDate, @Param("offset") int offset, @Param("limit") int limit)
      Get deployment history
      Parameters:
      siteId - site identifier
      publishingTarget - publishing target
      approver - approver
      completedState - completed state
      fromDate - get history from date
      toDate - get history to date
      offset - offset for pagination
      limit - number of records to return
      Returns:
    • getNumberOfPublishes

      int getNumberOfPublishes(@Param("siteId") String siteId, @Param("days") int days)
      Get number of publishes for site in given number of days
      Parameters:
      siteId - site identifiers
      days - number of days
      Returns:
      number of publishes
    • getNumberOfPublishedItemsByState

      int getNumberOfPublishedItemsByState(@Param("siteId") String siteId, @Param("days") int days, @Param("activityAction") String activityAction, @Param("publishState") String publishState, @Param("publishAction") String publishAction)
      Get number of published items for site in given number of days filtered by their previous state
      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
    • getPackagesForPath

      default Collection<String> getPackagesForPath(@Param("siteId") String siteId, @Param("path") String path)
      Get the READY_FOR_LIVE packages containing the given path
      Parameters:
      siteId - the site id
      path - the path to test
      Returns:
      a list of packages containing the path
    • getPackagesForPath

      Collection<String> getPackagesForPath(@Param("siteId") String siteId, @Param("path") String path, @Param("state") String state)
      Get the paths packages containing the given path and matching the state
      Parameters:
      siteId - the site id
      path - the path to test
      state - the state to match
      Returns:
      a list of packages containing the path
    • getPackagePaths

      Collection<String> getPackagePaths(@Param("siteId") String site, @Param("packageIds") Collection<String> packages)
      Get a list of the paths contained in the given packages
      Parameters:
      site - the site id
      packages - the packages to retrieve items for
      Returns:
      a list of the paths contained in the packages