Class DocumentVersion

  • All Implemented Interfaces:
    org.xcmis.spi.DocumentData, org.xcmis.spi.ObjectData

    public class DocumentVersion
    extends Object
    Version:
    $Id$
    Author:
    Andrey Parfonov
    • Field Detail

      • CHECKOUT_SKIP

        protected static final Set<String> CHECKOUT_SKIP
      • entry

        protected org.exoplatform.ecms.xcmis.sp.JcrNodeEntry entry
    • Constructor Detail

      • DocumentVersion

        public DocumentVersion​(org.exoplatform.ecms.xcmis.sp.JcrNodeEntry jcrEntry)
    • Method Detail

      • applyPolicy

        public void applyPolicy​(org.xcmis.spi.PolicyData policy)
        Specified by:
        applyPolicy in interface org.xcmis.spi.ObjectData
      • cancelCheckout

        public void cancelCheckout()
                            throws org.xcmis.spi.VersioningException,
                                   org.xcmis.spi.StorageException
        Specified by:
        cancelCheckout in interface org.xcmis.spi.DocumentData
        Throws:
        org.xcmis.spi.VersioningException
        org.xcmis.spi.StorageException
      • checkin

        public org.xcmis.spi.DocumentData checkin​(boolean major,
                                                  String checkinComment,
                                                  Map<String,​org.xcmis.spi.model.Property<?>> properties,
                                                  org.xcmis.spi.ContentStream content,
                                                  List<org.xcmis.spi.model.AccessControlEntry> acl,
                                                  Collection<org.xcmis.spi.PolicyData> policies)
                                           throws org.xcmis.spi.StorageException
        Specified by:
        checkin in interface org.xcmis.spi.DocumentData
        Throws:
        org.xcmis.spi.StorageException
      • checkout

        public org.xcmis.spi.DocumentData checkout()
                                            throws org.xcmis.spi.VersioningException,
                                                   org.xcmis.spi.StorageException
        Specified by:
        checkout in interface org.xcmis.spi.DocumentData
        Throws:
        org.xcmis.spi.VersioningException
        org.xcmis.spi.StorageException
      • getACL

        public List<org.xcmis.spi.model.AccessControlEntry> getACL​(boolean onlyBasicPermissions)
        Specified by:
        getACL in interface org.xcmis.spi.ObjectData
      • getName

        public String getName()
        Specified by:
        getName in interface org.xcmis.spi.ObjectData
      • getParent

        public org.xcmis.spi.FolderData getParent()
                                           throws org.xcmis.spi.ConstraintException
        Specified by:
        getParent in interface org.xcmis.spi.ObjectData
        Throws:
        org.xcmis.spi.ConstraintException
      • getParents

        public Collection<org.xcmis.spi.FolderData> getParents()
        Specified by:
        getParents in interface org.xcmis.spi.ObjectData
      • getPolicies

        public Collection<org.xcmis.spi.PolicyData> getPolicies()
        Specified by:
        getPolicies in interface org.xcmis.spi.ObjectData
      • getRelationships

        public org.xcmis.spi.ItemsIterator<org.xcmis.spi.RelationshipData> getRelationships​(org.xcmis.spi.model.RelationshipDirection direction,
                                                                                            org.xcmis.spi.model.TypeDefinition type,
                                                                                            boolean includeSubRelationshipTypes)
        Specified by:
        getRelationships in interface org.xcmis.spi.ObjectData
      • getVersionLabel

        public String getVersionLabel()
        Specified by:
        getVersionLabel in interface org.xcmis.spi.DocumentData
      • getVersionSeriesCheckedOutBy

        public String getVersionSeriesCheckedOutBy()
        Specified by:
        getVersionSeriesCheckedOutBy in interface org.xcmis.spi.DocumentData
      • getVersionSeriesCheckedOutId

        public String getVersionSeriesCheckedOutId()
        Specified by:
        getVersionSeriesCheckedOutId in interface org.xcmis.spi.DocumentData
      • isLatestVersion

        public boolean isLatestVersion()
        Specified by:
        isLatestVersion in interface org.xcmis.spi.DocumentData
      • removePolicy

        public void removePolicy​(org.xcmis.spi.PolicyData policy)
        Specified by:
        removePolicy in interface org.xcmis.spi.ObjectData
      • setACL

        public void setACL​(List<org.xcmis.spi.model.AccessControlEntry> aces)
        Specified by:
        setACL in interface org.xcmis.spi.ObjectData
      • setContentStream

        public void setContentStream​(org.xcmis.spi.ContentStream contentStream)
                              throws IOException,
                                     org.xcmis.spi.VersioningException,
                                     org.xcmis.spi.StorageException
        Specified by:
        setContentStream in interface org.xcmis.spi.DocumentData
        Throws:
        IOException
        org.xcmis.spi.VersioningException
        org.xcmis.spi.StorageException
      • setProperties

        public void setProperties​(Map<String,​org.xcmis.spi.model.Property<?>> properties)
                           throws org.xcmis.spi.NameConstraintViolationException,
                                  org.xcmis.spi.VersioningException
        Specified by:
        setProperties in interface org.xcmis.spi.ObjectData
        Throws:
        org.xcmis.spi.NameConstraintViolationException
        org.xcmis.spi.VersioningException
      • setProperty

        public void setProperty​(org.xcmis.spi.model.Property<?> property)
                         throws org.xcmis.spi.VersioningException
        Specified by:
        setProperty in interface org.xcmis.spi.ObjectData
        Throws:
        org.xcmis.spi.VersioningException
      • delete

        public void delete()
                    throws org.xcmis.spi.StorageException
        Delete current object.
        Throws:
        org.xcmis.spi.StorageException - if operation can't be persisted in back-end
      • save

        protected void save()
      • getContentStream

        public org.xcmis.spi.ContentStream getContentStream()
                                                     throws IOException
        Specified by:
        getContentStream in interface org.xcmis.spi.DocumentData
        Throws:
        IOException
      • getContentStream

        public org.xcmis.spi.ContentStream getContentStream​(String streamId)
                                                     throws IOException
        Specified by:
        getContentStream in interface org.xcmis.spi.ObjectData
        Throws:
        IOException
      • getContentStreamMimeType

        public String getContentStreamMimeType()
        Specified by:
        getContentStreamMimeType in interface org.xcmis.spi.DocumentData
      • getCreationDate

        public Calendar getCreationDate()
        Specified by:
        getCreationDate in interface org.xcmis.spi.ObjectData
      • getLastModificationDate

        public Calendar getLastModificationDate()
        Specified by:
        getLastModificationDate in interface org.xcmis.spi.ObjectData
      • getVersionSeriesId

        public String getVersionSeriesId()
        Specified by:
        getVersionSeriesId in interface org.xcmis.spi.DocumentData
      • hasContent

        public boolean hasContent()
        Specified by:
        hasContent in interface org.xcmis.spi.DocumentData
      • isLatestMajorVersion

        public boolean isLatestMajorVersion()
        Specified by:
        isLatestMajorVersion in interface org.xcmis.spi.DocumentData
      • isMajorVersion

        public boolean isMajorVersion()
        Specified by:
        isMajorVersion in interface org.xcmis.spi.DocumentData
      • isPWC

        public boolean isPWC()
        Specified by:
        isPWC in interface org.xcmis.spi.DocumentData
      • isVersionSeriesCheckedOut

        public boolean isVersionSeriesCheckedOut()
        Specified by:
        isVersionSeriesCheckedOut in interface org.xcmis.spi.DocumentData
      • getContentStreamLength

        protected long getContentStreamLength()
        Returns:
        length of content in bytes
      • getContentStreamId

        protected String getContentStreamId()
        Returns:
        id of content stream if document has content and null otherwise
      • getContentStreamFileName

        public String getContentStreamFileName()
        Returns:
        content stream file name if document has content and null otherwise
      • getObjectId

        public String getObjectId()
        Specified by:
        getObjectId in interface org.xcmis.spi.ObjectData
      • accept

        public void accept​(org.xcmis.spi.ObjectDataVisitor visitor)
        Specified by:
        accept in interface org.xcmis.spi.ObjectData
      • getBaseType

        public org.xcmis.spi.model.BaseType getBaseType()
        Specified by:
        getBaseType in interface org.xcmis.spi.ObjectData
      • getChangeToken

        public String getChangeToken()
        Specified by:
        getChangeToken in interface org.xcmis.spi.ObjectData
      • getCreatedBy

        public String getCreatedBy()
        Specified by:
        getCreatedBy in interface org.xcmis.spi.ObjectData
      • getLastModifiedBy

        public String getLastModifiedBy()
        Specified by:
        getLastModifiedBy in interface org.xcmis.spi.ObjectData
      • getProperties

        public Map<String,​org.xcmis.spi.model.Property<?>> getProperties()
        Specified by:
        getProperties in interface org.xcmis.spi.ObjectData
      • getProperties

        public Map<String,​org.xcmis.spi.model.Property<?>> getProperties​(org.xcmis.spi.PropertyFilter filter)
        Specified by:
        getProperties in interface org.xcmis.spi.ObjectData
      • getProperty

        public org.xcmis.spi.model.Property<?> getProperty​(String id)
        Specified by:
        getProperty in interface org.xcmis.spi.ObjectData
      • getTypeDefinition

        public org.xcmis.spi.model.TypeDefinition getTypeDefinition()
        Specified by:
        getTypeDefinition in interface org.xcmis.spi.ObjectData
      • getTypeId

        public String getTypeId()
        Specified by:
        getTypeId in interface org.xcmis.spi.ObjectData
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • doGetProperty

        protected org.xcmis.spi.model.Property<?> doGetProperty​(org.xcmis.spi.model.PropertyDefinition<?> definition)
      • doSetProperty

        protected void doSetProperty​(org.xcmis.spi.model.Property<?> property)
                              throws org.xcmis.spi.NameConstraintViolationException
        Update properties, skip on-create and read-only properties
        Parameters:
        property - property to be updated
        Throws:
        org.xcmis.spi.NameConstraintViolationException