Interface Versionable

    • Method Detail

      • createVersion

        VersionDef createVersion​(java.lang.String label,
                                 java.lang.String comment)
                          throws ContentFragmentException
        Creates a new version of the implementing element.

        Transactional behavior: All previous changes to the entire content fragment need to be committed before this method is called. The method will also commit all required changes, so the caller does not have to explicitly commit the respective ResourceResolver.

        Parameters:
        label - The label
        comment - A comment
        Returns:
        Definition of the newly created version
        Throws:
        ContentFragmentException - if the element could not be versioned
        java.lang.IllegalStateException - if the required transactional prerequisites are not met, for example if the respective ResourceResolver has pending/uncommitted changes
      • listVersions

        java.util.Iterator<VersionDef> listVersions()
                                             throws ContentFragmentException

        Creates an iterator on the versions that are available for the implementing element.

        The list does not contain the "current" version of the element itself, only archived versions.

        Returns:
        Iterator on available versions
        Throws:
        ContentFragmentException - if the version history could not be created