Package org.silverpeas.core.cmis.model
Class DocumentFile
- java.lang.Object
-
- org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractExtensionData
-
- org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectDataImpl
-
- org.silverpeas.core.cmis.model.CmisObject
-
- org.silverpeas.core.cmis.model.CmisFile
-
- org.silverpeas.core.cmis.model.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
-
-
Constructor Summary
Constructors Constructor Description DocumentFile(ContributionIdentifier id, String fileName, String language)
Constructs a new document with the specified identifier, filename and language.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Supplier<Set<org.apache.chemistry.opencmis.commons.enums.Action>>
getAllowableActionsSupplier()
Gets a supplier of the actions allowable on this CMIS object.String
getApplicationId()
org.apache.chemistry.opencmis.commons.enums.BaseTypeId
getBaseTypeId()
Gets the identifier of the base type from which the type of the CMIS object is derived.String
getLastComment()
Gets the comment set at the last update of this document.String
getMimeType()
Gets the MIME type of the document.String
getName()
Gets the name of the document in the filesystem of Silverpeas.long
getSize()
Gets the size in bytes of this document.String
getSymbol()
Gets the possible UTF-8 symbol representing the type of this CMIS object.String
getTitle()
Gets the title of this document.TypeId
getTypeId()
Gets the identifier of the type of this CMIS object.boolean
isReadOnly()
Is this document read-only?DocumentFile
setLastComment(String comment)
Sets the last comment that was written when saving lastly this document.DocumentFile
setMimeType(String mimeType)
Sets the MIME type of the document.DocumentFile
setReadOnly(boolean readOnly)
DocumentFile
setSize(long size)
Sets the size of this document.DocumentFile
setTitle(String title)
Sets the title of the document.-
Methods inherited from class org.silverpeas.core.cmis.model.CmisFile
completeWithFileActions, getParentId, getPath, isFileable, isFolding, setParentId
-
Methods inherited from class org.silverpeas.core.cmis.model.CmisObject
addACEs, getAcl, getAllowableActions, getCreationDate, getCreator, getDescription, getId, getLabel, getLanguage, getLastModificationDate, getLastModifier, isDocument, setAcesSupplier, setAcl, setAllowableActions, setCreationDate, setCreator, setDescription, setIsExactAcl, setLastModificationDate, setLastModifier, theCommonActions
-
Methods inherited from class org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectDataImpl
getChangeEventInfo, getPolicyIds, getProperties, getRelationships, getRenditions, isExactAcl, setAllowableActions, setChangeEventInfo, setPolicyIds, setProperties, setRelationships, setRenditions, toString
-
Methods inherited from class org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractExtensionData
getExtensions, setExtensions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.chemistry.opencmis.commons.data.ExtensionsData
getExtensions, setExtensions
-
Methods inherited from interface org.silverpeas.core.cmis.model.Fileable
getParentId, getPath, isOrphaned
-
-
-
-
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
- theContributionIdentifier
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 classCmisObject
- 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 classCmisObject
- 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 interfaceorg.apache.chemistry.opencmis.commons.data.ObjectData
- Specified by:
getBaseTypeId
in classCmisObject
-
getTypeId
public TypeId getTypeId()
Description copied from class:CmisObject
Gets the identifier of the type of this CMIS object.- Specified by:
getTypeId
in classCmisObject
- 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)
-
getAllowableActionsSupplier
protected Supplier<Set<org.apache.chemistry.opencmis.commons.enums.Action>> getAllowableActionsSupplier()
Description copied from class:CmisObject
Gets a supplier of the actions allowable on this CMIS object. The supplier is only invoked when theCmisObject.setAllowableActions()
is invoked.- Specified by:
getAllowableActionsSupplier
in classCmisObject
- Returns:
-
-