Class PurgeVersionsManager

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.workflow.purge.PurgeVersionsManager
All Implemented Interfaces:
Component, LogEnabled, Serviceable

Component which purges content old versions.
  • Field Details

    • ROLE

      public static final String ROLE
      The avalon component role.
  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • purgeContent

      public int purgeContent(WorkflowAwareContent content, long validationStepId, int firstVersionsToKeep)
      Purge a content.
      Parameters:
      content - the content to purge.
      validationStepId - the ID of the validation step for this content.
      firstVersionsToKeep - the count of first versions to keep.
      Returns:
      the count of removed versions.
    • purgeContent

      protected int purgeContent(WorkflowAwareContent content, javax.jcr.version.VersionHistory versionHistory, javax.jcr.version.Version baseVersion, long validationStepId, int firstVersionsToKeep) throws javax.jcr.RepositoryException
      Purge a content version history.
      Parameters:
      content - the content.
      versionHistory - the version history to purge.
      baseVersion - the content base version, must be kept.
      validationStepId - the ID of the validation step for this content.
      firstVersionsToKeep - the count of first versions to keep.
      Returns:
      the count of removed versions.
      Throws:
      javax.jcr.RepositoryException - if an error occurs.
    • getAllVersions

      protected List<PurgeVersionsManager.VersionInfo> getAllVersions(javax.jcr.version.VersionHistory versionHistory) throws javax.jcr.RepositoryException
      Get all versions of a version history.
      Parameters:
      versionHistory - the version history to purge.
      Returns:
      all the version infos.
      Throws:
      javax.jcr.RepositoryException - if an error occurs.