Class DocumentFile

  • All Implemented Interfaces:
    Serializable, org.apache.chemistry.opencmis.commons.data.ExtensionsData, org.apache.chemistry.opencmis.commons.data.MutableObjectData, org.apache.chemistry.opencmis.commons.data.ObjectData, Fileable

    public class DocumentFile
    extends CmisFile
    implements Fileable
    A document in Silverpeas. A document is a user contribution whose content is stored into a single document file in the Silverpeas filesystem. The document, in the current context of the Silverpeas CMIS implementation, is always attached to another contribution that can be either a folder or a publication.
    Author:
    mmoquillon
    See Also:
    Serialized Form
    • Field Detail

      • CMIS_TYPE

        public static final TypeId CMIS_TYPE
        The identifier of its CMIS type.
    • Constructor Detail

      • DocumentFile

        public DocumentFile​(ContributionIdentifier id,
                            String fileName,
                            String language)
        Constructs a new document with the specified identifier, filename and language.
        Parameters:
        id - the ContributionIdentifier instance identifying the attachment in Silverpeas.
        fileName - the name of the file referred by this document.
        language - the language in which the content of the document is written.
    • Method Detail

      • getSymbol

        public String getSymbol()
        Description copied from class: CmisObject
        Gets the possible UTF-8 symbol representing the type of this CMIS object. It acts as an icon but instead of being a regular image the icon is encoded in UTF-8. Its goal is to mark the concrete type of the CMIS object upon its basic CMIS one (that is folder, document, ...)
        Specified by:
        getSymbol in class CmisObject
        Returns:
        the UTF-8 symbol representing the type of this object or an empty String if no symbol is defined.
      • getName

        public String getName()
        Gets the name of the document in the filesystem of Silverpeas. It is the name of the file in which is stored the document.
        Overrides:
        getName in class CmisObject
        Returns:
        the filename.
      • getTitle

        public String getTitle()
        Gets the title of this document. If no title is set, then it should returns the document name.
        Returns:
        the title of the document.
      • getApplicationId

        public String getApplicationId()
      • getBaseTypeId

        public org.apache.chemistry.opencmis.commons.enums.BaseTypeId getBaseTypeId()
        Description copied from class: CmisObject
        Gets the identifier of the base type from which the type of the CMIS object is derived.
        Specified by:
        getBaseTypeId in interface org.apache.chemistry.opencmis.commons.data.ObjectData
        Specified by:
        getBaseTypeId in class CmisObject
      • getTypeId

        public TypeId getTypeId()
        Description copied from class: CmisObject
        Gets the identifier of the type of this CMIS object.
        Specified by:
        getTypeId in class CmisObject
        Returns:
        a TypeId enumeration value.
      • getLastComment

        public String getLastComment()
        Gets the comment set at the last update of this document.
        Returns:
        the last comment set.
      • getSize

        public long getSize()
        Gets the size in bytes of this document.
        Returns:
        the document size.
      • getMimeType

        public String getMimeType()
        Gets the MIME type of the document. It defines how the document content is stored.
        Returns:
        the document MIME type.
      • isReadOnly

        public boolean isReadOnly()
        Is this document read-only? If read-only, its content cannot be modified. This case occurs for example when the document is locked by a user in Silverpeas other that the current requester.
        Returns:
        true if the content of this document cannot be modified. False otherwise.
      • setSize

        public DocumentFile setSize​(long size)
        Sets the size of this document.
        Parameters:
        size - the size in bytes.
        Returns:
        itself.
      • setMimeType

        public DocumentFile setMimeType​(String mimeType)
        Sets the MIME type of the document.
        Parameters:
        mimeType - a MIME type.
        Returns:
        itself.
      • setTitle

        public DocumentFile setTitle​(String title)
        Sets the title of the document.
        Parameters:
        title - the title of the document.
        Returns:
        itself.
      • setLastComment

        public DocumentFile setLastComment​(String comment)
        Sets the last comment that was written when saving lastly this document.
        Parameters:
        comment - a comment about the last change.
        Returns:
        itself.
      • setReadOnly

        public DocumentFile setReadOnly​(boolean readOnly)