Class StudioVersionService

java.lang.Object
com.axelor.studio.service.StudioVersionService

public class StudioVersionService extends Object
Service for managing Studio resource versions.

Handles version queries (find latest revision, active, published) and version creation (major, minor, patch).

  • Constructor Details

    • StudioVersionService

      public StudioVersionService()
  • Method Details

    • findLatestRevision

      public StudioResource findLatestRevision(StudioResource resource)
      Finds the latest revision (by patch version) for a given project or revision.
      Parameters:
      resource - the project or revision to search from
      Returns:
      the latest revision, or null if none found
    • findLatestActive

      public StudioResource findLatestActive(StudioResource resource)
      Finds the currently activated revision for a given project.
      Parameters:
      resource - the project or revision to search from
      Returns:
      the active revision, or null if none activated
    • findLatestPublished

      public StudioResource findLatestPublished(StudioResource resource)
      Finds the latest published revision for a given project.
      Parameters:
      resource - the project or revision to search from
      Returns:
      the latest published revision, or null if none published
    • findProject

      public StudioResource findProject(String name, Integer major, Integer minor)
      Finds a project by name and version.
      Parameters:
      name - the project name
      major - the major version number
      minor - the minor version number
      Returns:
      the project, or null if not found
    • createMajor

      public StudioResource createMajor(StudioResource resource)
      Creates a new major version from the given revision.
      Parameters:
      resource - the revision to create major version from
      Returns:
      the new revision with incremented major version
    • createMinor

      public StudioResource createMinor(StudioResource resource)
      Creates a new minor version from the given revision.
      Parameters:
      resource - the revision to create minor version from
      Returns:
      the new revision with incremented minor version
    • createPatch

      public StudioResource createPatch(StudioResource resource)
      Creates a new patch version from the given revision.
      Parameters:
      resource - the revision to create patch version from
      Returns:
      the new revision with incremented patch version
      Throws:
      IllegalStateException - if the last revision is not published
    • deleteRevision

      public void deleteRevision(StudioResource resource)
      Deletes a revision and all its child resources recursively.
      Parameters:
      resource - the revision to delete
      See Also:
    • deactivateRevision

      public void deactivateRevision(StudioResource resource)
      Deactivates an activated or published revision.
      Parameters:
      resource - the revision to deactivate
      Throws:
      IllegalArgumentException - if the resource is not an app or not in correct status
    • publishRevision

      public void publishRevision(StudioResource resource)
      Publishes an activated revision, locking it from further modifications.
      Parameters:
      resource - the revision to publish
      Throws:
      IllegalArgumentException - if the resource is not an activated app revision