Package com.axelor.studio.service
Class StudioVersionService
java.lang.Object
com.axelor.studio.service.StudioVersionService
Service for managing Studio resource versions.
Handles version queries (find latest revision, active, published) and version creation (major, minor, patch).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateMajor(StudioResource resource) Creates a new major version from the given revision.createMinor(StudioResource resource) Creates a new minor version from the given revision.createPatch(StudioResource resource) Creates a new patch version from the given revision.voiddeactivateRevision(StudioResource resource) Deactivates an activated or published revision.voiddeleteRevision(StudioResource resource) Deletes a revision and all its child resources recursively.findLatestActive(StudioResource resource) Finds the currently activated revision for a given project.findLatestPublished(StudioResource resource) Finds the latest published revision for a given project.findLatestRevision(StudioResource resource) Finds the latest revision (by patch version) for a given project or revision.findProject(String name, Integer major, Integer minor) Finds a project by name and version.voidpublishRevision(StudioResource resource) Publishes an activated revision, locking it from further modifications.
-
Constructor Details
-
StudioVersionService
public StudioVersionService()
-
-
Method Details
-
findLatestRevision
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
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
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
Finds a project by name and version.- Parameters:
name- the project namemajor- the major version numberminor- the minor version number- Returns:
- the project, or null if not found
-
createMajor
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
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
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
Deletes a revision and all its child resources recursively.- Parameters:
resource- the revision to delete- See Also:
-
deactivateRevision
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
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
-