Class SimpleDocument
- java.lang.Object
-
- org.silverpeas.core.contribution.attachment.model.SimpleDocument
-
- All Implemented Interfaces:
Serializable
,Attachment
,Contribution
,LocalizedAttachment
,LocalizedContribution
,LocalizedResource
,ResourceTranslation
,Translatable
,Translation
,Identifiable
,Instance<Contribution>
,Nameable
,Securable
,SilverpeasResource
- Direct Known Subclasses:
HistorisedDocument
,SimpleDocumentVersion
public class SimpleDocument extends Object implements LocalizedAttachment, LocalizedResource, ResourceTranslation, Serializable, Securable
A document file attached to a given user contribution. A document file is itself a user contribution whose content is written in a given language. As such it is then both a localized contribution and its own translation. A localized contribution because it can exist in different languages (rare enough) and a translation by itself because the content of the file is always written in a given language; it is then not a container of several contents, each of them written in a different language. The choice has been made here, in the current context, to not represent such a document as a virtual localized contribution and resource of one or more translation(s) (each of them being a document file) but to merge these different concepts into a single one in this peculiar case of attached document files.- Author:
- ehugonnet, mmoquillon
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTACHMENT_PREFIX
static String
DOCUMENT_PREFIX
static String
FILE_PREFIX
static String
VERSION_PREFIX
static String
WEBDAV_FOLDER
-
Constructor Summary
Constructors Constructor Description SimpleDocument()
SimpleDocument(SimpleDocument simpleDocument)
SimpleDocument(SimpleDocumentPK pk, String foreignId, int order, boolean versioned, String editedBy, SimpleAttachment attachment)
SimpleDocument(SimpleDocumentPK pk, String foreignId, int order, boolean versioned, SimpleAttachment attachment)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addRolesForWhichDownloadIsAllowed(Collection<SilverpeasRole> allowedRoles)
Allows the download for the given roles.void
addRolesForWhichDownloadIsAllowed(SilverpeasRole... allowedRoles)
Allows the download for the given roles.boolean
addRolesForWhichDownloadIsForbidden(Collection<SilverpeasRole> forbiddenRoles)
Forbids the download for the given roles.boolean
addRolesForWhichDownloadIsForbidden(SilverpeasRole... forbiddenRoles)
Forbids the download for the given roles.boolean
canBeAccessedBy(User user)
Is the specified user can access this document?boolean
canBeModifiedBy(User user)
Is the specified user can access this document on persist context?String
computeNodeName()
void
edit(String currentEditor)
Optional<Boolean>
editableSimultaneously()
Indicates if the attachment can be edited simultaneously into web browser by several users.boolean
equals(Object obj)
Date
getAlert()
SimpleAttachment
getAttachment()
String
getAttachmentPath()
Path to the file stored on the filesystem.String
getAttachmentURL()
Returns the attachment URL.String
getCloneId()
Get the value of cloneIdString
getComment()
String
getContentType()
Gets the content type of this attached document file as a predefined MIME type.String
getCreatedBy()
Date
getCreationDate()
Gets the date at which the resource has been created.User
getCreator()
Gets the user that has created the resource.String
getDescription()
Gets a description about this contribution if any.String
getDirectoryPath(String language)
Path to the directory where the file is to be stored.String
getDisplayIcon()
Gets the path of the icon representing either the attachment itself or its content type.DocumentType
getDocumentType()
String
getEditedBy()
Date
getExpiry()
String
getFilename()
Gets the name of the document file as stored in the filesystem.String
getFolder()
Set<SilverpeasRole>
getForbiddenDownloadForRoles()
Gets roles for which download is not allowed.String
getForeignId()
String
getFullJcrContentPath()
Full JCR path to the file node.String
getFullJcrPath()
Full JCR path to the document node.String
getId()
Gets the unique identifier of the object in Silverpeas.ContributionIdentifier
getIdentifier()
Gets the unique identifier of this contribution.String
getInstanceId()
String
getLanguage()
Gets the language in which this contribution was authored.SimpleDocument
getLastPublicVersion()
Returns the more recent public version of this document - null if none exists.Date
getLastUpdateDate()
Gets the date at which the resource has been lastly updated.User
getLastUpdater()
Gets the user that has lastly updated the resource.int
getMajorVersion()
Gets the major part of the document version.int
getMinorVersion()
Gets the minor part of the document version.String
getName()
Gets the name of this contribution.String
getNodeName()
long
getOldSilverpeasId()
String
getOnlineURL()
int
getOrder()
SimpleDocumentPK
getPk()
String
getRepositoryPath()
Returns the path into the repository.Date
getReservation()
long
getSize()
Gets the size of the document file in the filesystem.String
getStatus()
String
getTitle()
Gets the title of the document.SimpleDocument
getTranslation(String language)
Gets a translation in the specified language about some textual properties of the object.String
getUniversalURL()
String
getUpdatedBy()
String
getVersion()
Gets the version of the document.int
getVersionIndex()
Returns the index of document into the history if any and if the document is a versioned one.SimpleDocument
getVersionMaster()
Returns the master of versioned document.String
getWebdavContentEditionLanguage()
Gets the content language handled into webdav for the document.long
getWebdavContentEditionSize()
Gets the content size handled into webdav for the document.String
getWebdavJcrPath()
String
getWebdavUrl()
String
getXmlFormId()
int
hashCode()
static boolean
isASimpleDocument(ContributionIdentifier id)
boolean
isContentArchive()
Indicates if the file described by currentSimpleAttachment
is type of archive.boolean
isContentImage()
Indicates if the file described by currentSimpleAttachment
is type of image.boolean
isContentMail()
Indicates if the file described by currentSimpleAttachment
is type of mail.boolean
isContentPdf()
Indicates if the file described by currentSimpleAttachment
is type of pdf.boolean
isContentSpinfire()
Indicates if the file described by currentSimpleAttachment
is type of 3D.boolean
isDisplayableAsContent()
Indicates if the attachment content can be displayed as a contribution content.boolean
isDownloadAllowedForReaders()
Indicates if the download is allowed for readers.boolean
isDownloadAllowedForRoles(Set<SilverpeasRole> roles)
Indicates if the download of the document is allowed for the given roles.boolean
isDownloadAllowedForRolesFrom(User user)
Indicates if the download of the document is allowed for the given user in relation to its roles.boolean
isEdited()
Is this document currently being edited?boolean
isEditedBy(User user)
Is this document currently being edited by the specified user?boolean
isOpenOfficeCompatible()
Check if the document is compatible with OpenOffice using the mime type .boolean
isPublic()
boolean
isReadOnly()
Is this document in read-only?boolean
isSharingAllowedForRolesFrom(User user)
boolean
isVersioned()
Is this attachment versioned?boolean
isVersionMaster()
Indicates if the current instance is a master one.void
release()
protected void
resetWebdavContentEditionContext()
void
setAlert(Date alert)
void
setAttachment(SimpleAttachment attachment)
void
setCloneId(String cloneId)
Set the value of cloneIdvoid
setComment(String comment)
void
setContentType(String contentType)
void
setCreationDate(Date created)
void
setDescription(String description)
void
setDisplayableAsContent(boolean displayableAsContent)
void
setDocumentType(DocumentType documentType)
void
setEditableSimultaneously(boolean editableSimultaneously)
void
setExpiry(Date expiry)
void
setFilename(String filename)
void
setForeignId(String foreignId)
void
setId(String id)
void
setLanguage(String language)
void
setLastUpdateDate(Date updated)
void
setMajorVersion(int majorVersion)
void
setMinorVersion(int minorVersion)
void
setNodeName(String nodeName)
void
setOldSilverpeasId(long oldSilverpeasId)
void
setOrder(int order)
void
setPK(SimpleDocumentPK pk)
void
setPublicDocument(boolean publicDocument)
void
setRepositoryPath(String repositoryPath)
void
setReservation(Date reservationDate)
void
setSize(long size)
void
setStatus(String status)
void
setTitle(String title)
void
setUpdatedBy(String updatedBy)
void
setVersionIndex(int versionIndex)
void
setVersionMaster(SimpleDocument versionMaster)
void
setXmlFormId(String xmlFormId)
String
toString()
void
unlock()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.contribution.model.Contribution
getContributionType, getModel, getResourcePath, isIndexable
-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeDeletedBy, canBeFiledInBy
-
-
-
-
Field Detail
-
WEBDAV_FOLDER
public static final String WEBDAV_FOLDER
- See Also:
- Constant Field Values
-
ATTACHMENT_PREFIX
public static final String ATTACHMENT_PREFIX
- See Also:
- Constant Field Values
-
VERSION_PREFIX
public static final String VERSION_PREFIX
- See Also:
- Constant Field Values
-
FILE_PREFIX
public static final String FILE_PREFIX
- See Also:
- Constant Field Values
-
DOCUMENT_PREFIX
public static final String DOCUMENT_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SimpleDocument
public SimpleDocument(SimpleDocumentPK pk, String foreignId, int order, boolean versioned, SimpleAttachment attachment)
-
SimpleDocument
public SimpleDocument(SimpleDocumentPK pk, String foreignId, int order, boolean versioned, String editedBy, SimpleAttachment attachment)
-
SimpleDocument
public SimpleDocument()
-
SimpleDocument
public SimpleDocument(SimpleDocument simpleDocument)
-
-
Method Detail
-
isASimpleDocument
public static boolean isASimpleDocument(ContributionIdentifier id)
-
getIdentifier
public ContributionIdentifier getIdentifier()
Description copied from interface:Contribution
Gets the unique identifier of this contribution.- Specified by:
getIdentifier
in interfaceContribution
- Specified by:
getIdentifier
in interfaceSilverpeasResource
- Returns:
- the unique identifier of the contribution.
-
getCreator
public User getCreator()
Description copied from interface:SilverpeasResource
Gets the user that has created the resource.- Specified by:
getCreator
in interfaceSilverpeasResource
- Returns:
- a
User
in Silverpeas.
-
getLastUpdater
public User getLastUpdater()
Description copied from interface:SilverpeasResource
Gets the user that has lastly updated the resource. If the resource doesn't have such an information, then this method should return the user that has created the resource.- Specified by:
getLastUpdater
in interfaceSilverpeasResource
- Returns:
- a
User
in Silverpeas.
-
setDocumentType
public void setDocumentType(DocumentType documentType)
-
getDocumentType
public DocumentType getDocumentType()
-
getCloneId
public String getCloneId()
Get the value of cloneId- Returns:
- the value of cloneId
-
setCloneId
public void setCloneId(String cloneId)
Set the value of cloneId- Parameters:
cloneId
- new value of cloneId
-
getFilename
public String getFilename()
Description copied from interface:Attachment
Gets the name of the document file as stored in the filesystem. The filename can differ from the contribution name that is the title of the document.- Specified by:
getFilename
in interfaceAttachment
- Returns:
- the name of the document file in the filesystem.
-
setFilename
public void setFilename(String filename)
-
getLanguage
public String getLanguage()
Description copied from interface:LocalizedContribution
Gets the language in which this contribution was authored. By default, returns the default language in Silverpeas.- Specified by:
getLanguage
in interfaceLocalizedContribution
- Specified by:
getLanguage
in interfaceTranslation
- Returns:
- the language at which this contribution was authored.
-
setLanguage
public void setLanguage(String language)
-
getTitle
public String getTitle()
Description copied from interface:Attachment
Gets the title of the document. The title is either the name set explicitly by the user to the attachment or the title fetched from the document metadata itself or the filename whether the previous data weren't provided.- Specified by:
getTitle
in interfaceAttachment
- Specified by:
getTitle
in interfaceContribution
- Returns:
- the title of the document.
-
getName
public String getName()
Description copied from interface:Contribution
Gets the name of this contribution. The name is in a contribution its title.- Specified by:
getName
in interfaceContribution
- Specified by:
getName
in interfaceNameable
- Specified by:
getName
in interfaceResourceTranslation
- Returns:
- the contribution title.
-
setTitle
public void setTitle(String title)
-
getDescription
public String getDescription()
Description copied from interface:Contribution
Gets a description about this contribution if any. By default returns an empty String.- Specified by:
getDescription
in interfaceContribution
- Specified by:
getDescription
in interfaceNameable
- Specified by:
getDescription
in interfaceResourceTranslation
- Returns:
- the description on this contribution. Can be empty if no description was set or no description is defined for a such contribution.
-
setDescription
public void setDescription(String description)
-
getSize
public long getSize()
Description copied from interface:Attachment
Gets the size of the document file in the filesystem.- Specified by:
getSize
in interfaceAttachment
- Returns:
- the size in bytes.
-
setSize
public void setSize(long size)
-
getContentType
public String getContentType()
Description copied from interface:Attachment
Gets the content type of this attached document file as a predefined MIME type.- Specified by:
getContentType
in interfaceAttachment
- Returns:
- the MIME type of the document.
-
setContentType
public void setContentType(String contentType)
-
getCreatedBy
public String getCreatedBy()
-
getCreationDate
public Date getCreationDate()
Description copied from interface:SilverpeasResource
Gets the date at which the resource has been created.- Specified by:
getCreationDate
in interfaceSilverpeasResource
- Returns:
- the date of creation of the resource.
-
setCreationDate
public void setCreationDate(Date created)
-
getUpdatedBy
public String getUpdatedBy()
-
setUpdatedBy
public void setUpdatedBy(String updatedBy)
-
getLastUpdateDate
public Date getLastUpdateDate()
Description copied from interface:SilverpeasResource
Gets the date at which the resource has been lastly updated. If the resource doesn't have such an information, then this method should return the date of the resource creation.- Specified by:
getLastUpdateDate
in interfaceSilverpeasResource
- Returns:
- the date of the last update of the resource.
-
setLastUpdateDate
public void setLastUpdateDate(Date updated)
-
getReservation
public Date getReservation()
-
setReservation
public final void setReservation(Date reservationDate)
-
getAlert
public Date getAlert()
-
setAlert
public void setAlert(Date alert)
-
getExpiry
public Date getExpiry()
-
setExpiry
public void setExpiry(Date expiry)
-
getStatus
public String getStatus()
-
setStatus
public void setStatus(String status)
-
getMinorVersion
public int getMinorVersion()
Description copied from interface:Attachment
Gets the minor part of the document version. If the attachment isn't versioned, then zero value is returned.- Specified by:
getMinorVersion
in interfaceAttachment
- Returns:
- the minor version part of the document.
-
setMinorVersion
public void setMinorVersion(int minorVersion)
-
getMajorVersion
public int getMajorVersion()
Description copied from interface:Attachment
Gets the major part of the document version. If the attachment isn't versioned, then zero value is returned.- Specified by:
getMajorVersion
in interfaceAttachment
- Returns:
- the major version part of the document.
-
setMajorVersion
public void setMajorVersion(int majorVersion)
-
getVersion
public String getVersion()
Description copied from interface:Attachment
Gets the version of the document. It is a concatenation of the major and of the minor version with a dot as separator.- Specified by:
getVersion
in interfaceAttachment
- Returns:
- the version of the attachment or "0.0" if the document isn't versioned.
-
getComment
public String getComment()
-
setComment
public void setComment(String comment)
-
resetWebdavContentEditionContext
protected void resetWebdavContentEditionContext()
-
getWebdavContentEditionLanguage
public String getWebdavContentEditionLanguage()
Gets the content language handled into webdav for the document.- Returns:
- the content language if the document is currently handled into the webdav repository, empty string otherwise.
-
getWebdavContentEditionSize
public long getWebdavContentEditionSize()
Gets the content size handled into webdav for the document.- Returns:
- the content size if the document is currently handled into the webdav repository, a value less than zero otherwise.
-
getEditedBy
public String getEditedBy()
-
edit
public void edit(String currentEditor)
-
release
public void release()
-
getXmlFormId
public String getXmlFormId()
-
setXmlFormId
public void setXmlFormId(String xmlFormId)
-
getId
public String getId()
Description copied from interface:Identifiable
Gets the unique identifier of the object in Silverpeas. If he's also identified by a local identifier, then this method should return the one global to Silverpeas.- Specified by:
getId
in interfaceIdentifiable
- Returns:
- the identifier encoded as a String. If the identifier is a complex one, that is made up of several identification parts, then the returned representation should take care of such a structure.
-
setId
public void setId(String id)
-
setPK
public void setPK(SimpleDocumentPK pk)
-
getInstanceId
public String getInstanceId()
-
getOldSilverpeasId
public long getOldSilverpeasId()
-
setOldSilverpeasId
public void setOldSilverpeasId(long oldSilverpeasId)
-
getForeignId
public String getForeignId()
-
setForeignId
public void setForeignId(String foreignId)
-
getOrder
public int getOrder()
-
setOrder
public void setOrder(int order)
-
isVersioned
public boolean isVersioned()
Description copied from interface:Attachment
Is this attachment versioned? A document is versioned if each change is historized and comes to a new minor or major version.- Specified by:
isVersioned
in interfaceAttachment
- Returns:
- true if this attachment is versioned, false otherwise.
-
getAttachment
public SimpleAttachment getAttachment()
-
getPk
public SimpleDocumentPK getPk()
-
setAttachment
public void setAttachment(SimpleAttachment attachment)
-
isPublic
public boolean isPublic()
-
setPublicDocument
public void setPublicDocument(boolean publicDocument)
-
unlock
public void unlock()
-
getNodeName
public String getNodeName()
-
setNodeName
public void setNodeName(String nodeName)
-
computeNodeName
public String computeNodeName()
-
getFullJcrContentPath
public String getFullJcrContentPath()
Full JCR path to the file node.- Returns:
- the full JCR path to the file node (starting with /).
-
getFullJcrPath
public String getFullJcrPath()
Full JCR path to the document node.- Returns:
- the full JCR path to the document node (starting with /).
-
getDisplayIcon
public String getDisplayIcon()
Description copied from interface:Attachment
Gets the path of the icon representing either the attachment itself or its content type.- Specified by:
getDisplayIcon
in interfaceAttachment
- Returns:
- the path of the icon representing this attachment.
-
isOpenOfficeCompatible
public boolean isOpenOfficeCompatible()
Check if the document is compatible with OpenOffice using the mime type .- Returns:
- true if the document is compatible with OpenOffice false otherwise.
-
isReadOnly
public boolean isReadOnly()
Is this document in read-only? A document is read-only if either it is currently being editing by another user than the current one, or it isn't edited, and it cannot be modified by the current user, or it is currently being editing by another user than the current one. If there is no user behind the scene, then the method behave like theisEdited()
method.- Returns:
- true if this document cannot be modified, false otherwise.
-
isEdited
public boolean isEdited()
Is this document currently being edited?- Returns:
- true if this document is being edited by a user in Silverpeas. False otherwise.
-
isEditedBy
public boolean isEditedBy(User user)
Is this document currently being edited by the specified user? If the document isn't being currently edited by any user, false is returned.- Parameters:
user
- a user in Silverpeas- Returns:
- true if the specified user is editing this document. False either no users are editing it or another user is editing it.
-
getAttachmentPath
public String getAttachmentPath()
Path to the file stored on the filesystem.- Specified by:
getAttachmentPath
in interfaceAttachment
- Returns:
- the path to the file stored on the filesystem.
-
getDirectoryPath
public String getDirectoryPath(String language)
Path to the directory where the file is to be stored.- Parameters:
language
- the language of the document.- Returns:
- the path to the directory where the file is to be stored.
-
getAttachmentURL
public String getAttachmentURL()
Returns the attachment URL.- Returns:
- the attachment URL.
-
getUniversalURL
public String getUniversalURL()
-
getOnlineURL
public String getOnlineURL()
-
getWebdavUrl
public String getWebdavUrl()
-
getWebdavJcrPath
public String getWebdavJcrPath()
-
getVersionMaster
public SimpleDocument getVersionMaster()
Returns the master of versioned document. If not versioned, it returns itself. If versioned, it returns the master of versioned document (the last created or updated in other words).- Returns:
- the master version of this document.
-
setVersionMaster
public void setVersionMaster(SimpleDocument versionMaster)
-
isVersionMaster
public boolean isVersionMaster()
Indicates if the current instance is a master one.- Returns:
- true if current instance is master, false otherwise.
-
getRepositoryPath
public String getRepositoryPath()
Returns the path into the repository.- Returns:
- the repository path.
-
setRepositoryPath
public void setRepositoryPath(String repositoryPath)
-
getVersionIndex
public int getVersionIndex()
Returns the index of document into the history if any and if the document is a versioned one. In other cases, it returns 0 (the start index).- Returns:
- the index of the document version in the document change history.
-
setVersionIndex
public void setVersionIndex(int versionIndex)
-
getLastPublicVersion
public SimpleDocument getLastPublicVersion()
Returns the more recent public version of this document - null if none exists.- Returns:
- the more recent public version of this document - null if none exists.
-
getFolder
public String getFolder()
-
isSharingAllowedForRolesFrom
public boolean isSharingAllowedForRolesFrom(User user)
-
canBeAccessedBy
public boolean canBeAccessedBy(User user)
Is the specified user can access this document?- Specified by:
canBeAccessedBy
in interfaceContribution
- Specified by:
canBeAccessedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can access this document, false otherwise.
-
canBeModifiedBy
public boolean canBeModifiedBy(User user)
Is the specified user can access this document on persist context?- Specified by:
canBeModifiedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can access this document, false otherwise.
-
isDownloadAllowedForRolesFrom
public boolean isDownloadAllowedForRolesFrom(User user)
Indicates if the download of the document is allowed for the given user in relation to its roles. DON'T USE THIS METHOD IN CASE OF LARGE NUMBER OF ATTACHMENT TO PERFORM.- Parameters:
user
- a user in Silverpeas.- Returns:
- true if download is allowed.
-
isDownloadAllowedForRoles
public boolean isDownloadAllowedForRoles(Set<SilverpeasRole> roles)
Indicates if the download of the document is allowed for the given roles.- Parameters:
roles
- a set of silverpeas roles- Returns:
- true if download is allowed.
-
isDownloadAllowedForReaders
public boolean isDownloadAllowedForReaders()
Indicates if the download is allowed for readers.
-
addRolesForWhichDownloadIsForbidden
public boolean addRolesForWhichDownloadIsForbidden(SilverpeasRole... forbiddenRoles)
Forbids the download for the given roles. PLEASE BE CAREFUL : this method doesn't persist the information. It is used by attachment services during the conversion from JCR data to SimpleDocument data.- Parameters:
forbiddenRoles
- one or more silverpeas roles- Returns:
- true if roles were not forbidden before the call of this method.
-
addRolesForWhichDownloadIsForbidden
public boolean addRolesForWhichDownloadIsForbidden(Collection<SilverpeasRole> forbiddenRoles)
Forbids the download for the given roles. PLEASE BE CAREFUL : this method doesn't persist the information. It is used by attachment services during the conversion from JCR data to SimpleDocument data.- Parameters:
forbiddenRoles
- a collection of silverpeas roles- Returns:
- true if roles were not forbidden before the call of this method.
-
addRolesForWhichDownloadIsAllowed
public void addRolesForWhichDownloadIsAllowed(SilverpeasRole... allowedRoles)
Allows the download for the given roles. PLEASE BE CAREFUL : this method doesn't persist the information. It is used by attachment services during the conversion from JCR data to SimpleDocument data.- Parameters:
allowedRoles
- one or more silverpeas roles
-
addRolesForWhichDownloadIsAllowed
public boolean addRolesForWhichDownloadIsAllowed(Collection<SilverpeasRole> allowedRoles)
Allows the download for the given roles. PLEASE BE CAREFUL : this method doesn't persist the information. It is used by attachment services during the conversion from JCR data to SimpleDocument data.- Parameters:
allowedRoles
- a collection of silverpeas roles- Returns:
- true if roles were not allowed before the call of this method.
-
getForbiddenDownloadForRoles
public Set<SilverpeasRole> getForbiddenDownloadForRoles()
Gets roles for which download is not allowed.- Returns:
- a set of silverpeas roles
-
isContentImage
public boolean isContentImage()
Indicates if the file described by currentSimpleAttachment
is type of image.
-
isContentSpinfire
public boolean isContentSpinfire()
Indicates if the file described by currentSimpleAttachment
is type of 3D.
-
isContentArchive
public boolean isContentArchive()
Indicates if the file described by currentSimpleAttachment
is type of archive.
-
isContentMail
public boolean isContentMail()
Indicates if the file described by currentSimpleAttachment
is type of mail.
-
isContentPdf
public boolean isContentPdf()
Indicates if the file described by currentSimpleAttachment
is type of pdf.
-
isDisplayableAsContent
public boolean isDisplayableAsContent()
Indicates if the attachment content can be displayed as a contribution content.- Returns:
- true to display as content, false otherwise.
-
setDisplayableAsContent
public void setDisplayableAsContent(boolean displayableAsContent)
-
getTranslation
public SimpleDocument getTranslation(String language)
Description copied from interface:Translatable
Gets a translation in the specified language about some textual properties of the object. If no such translation exists, then returns the default translation of the object.- Specified by:
getTranslation
in interfaceLocalizedResource
- Specified by:
getTranslation
in interfaceTranslatable
- Parameters:
language
- the ISO 631-1 code of a language.- Returns:
- a translation of the object in the given language. Can be never null.
-
editableSimultaneously
public Optional<Boolean> editableSimultaneously()
Indicates if the attachment can be edited simultaneously into web browser by several users.- Returns:
- An optional true if editable, false otherwise. If Optional is empty, it means that the indicator is not handled.
-
setEditableSimultaneously
public void setEditableSimultaneously(boolean editableSimultaneously)
-
-