Class ContentVersionResource


  • @ExperimentalApi
    public class ContentVersionResource
    extends Object
    • Constructor Detail

    • Method Detail

      • getContentHistory

        public PageResponse<Version> getContentHistory​(ContentId contentId,
                                                       int start,
                                                       int limit,
                                                       String expand,
                                                       @Context
                                                       javax.ws.rs.core.UriInfo uriInfo)
        Get list of content versions in version descending order. ContentId must exist and current user must have view permission on this content. This is validated and exception will throw if they are not satisfied.
        Parameters:
        contentId - contentId of the CURRENT content entity, NOT the historical ones. As this is the only contentId visible to user.
        start -
        limit -
        expand -
        uriInfo -
        Returns:
        the versions for the given start and limit
      • getContentVersion

        public Version getContentVersion​(ContentId contentId,
                                         int versionNumber,
                                         String expand)
        Get a version of the content with option to expand on content and its sub fields, by default it expands content on version.
        Parameters:
        contentId -
        versionNumber -
        expand -
        Returns:
        the version
      • deleteContentHistory

        public void deleteContentHistory​(ContentId contentId,
                                         int versionNumber)
        Delete a historical version. Current user must have edit permission on content, or it will throw a permission exception.
        Parameters:
        contentId -
        versionNumber - version number starts from 1 up to current version.
      • restoreContentHistory

        public Version restoreContentHistory​(ContentId contentId,
                                             RestData restData,
                                             String expand)
        Restore a historical version to be a new current version. The result is a new version is created with the content of the historical version.
        Parameters:
        contentId -
        restData - wrapper object wrappers detailed parameters for this operation.
        expand - Expansion on newly create current version
        Returns:
        The newly created version.