Class Document
- java.lang.Object
-
- ch.colabproject.colab.api.model.document.Document
-
- All Implemented Interfaces:
ColabEntity,StickyNoteSourceable,WithDeletionStatus,WithIndex,WithPermission,WithTrackingData,WithWebsocketChannels,WithId,WithJsonDiscriminator,Serializable
- Direct Known Subclasses:
DocumentFile,ExternalLink,TextDataBlock
@Entity public abstract class Document extends Object implements ColabEntity, WithWebsocketChannels, WithIndex, StickyNoteSourceable
Any document.The subclass handles the content.
A document is owned by either a card content or a resource.
- Author:
- sandra
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDOCUMENT_SEQUENCE_NAMEName of the document/resource sequenceprotected LongidDocument IDprotected CardContentowningCardContentThe card content for which this document is a deliverableprotected ResourceowningResourceThe resource this document is part of
-
Constructor Summary
Constructors Constructor Description Document()
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ch.colabproject.colab.api.model.ColabEntity
mergeToDuplicate
-
Methods inherited from interface ch.colabproject.colab.generator.model.interfaces.WithJsonDiscriminator
getJsonDiscriminator
-
Methods inherited from interface ch.colabproject.colab.api.model.WithPermission
getCreateCondition, getDeleteCondition
-
Methods inherited from interface ch.colabproject.colab.api.model.WithTrackingData
initErasureTrackingData, resetErasureTrackingData, touch
-
Methods inherited from interface ch.colabproject.colab.api.model.WithWebsocketChannels
getIndexEntryPayload
-
-
-
-
Field Detail
-
DOCUMENT_SEQUENCE_NAME
public static final String DOCUMENT_SEQUENCE_NAME
Name of the document/resource sequence- See Also:
- Constant Field Values
-
id
protected Long id
Document ID
-
owningCardContent
protected CardContent owningCardContent
The card content for which this document is a deliverable
-
owningResource
protected Resource owningResource
The resource this document is part of
-
-
Method Detail
-
setId
public void setId(Long id)
- Parameters:
id- the document id
-
getTrackingData
public Tracking getTrackingData()
Get the tracking data- Specified by:
getTrackingDatain interfaceWithTrackingData- Returns:
- tracking data
-
setTrackingData
public void setTrackingData(Tracking trackingData)
Set tracking data- Specified by:
setTrackingDatain interfaceWithTrackingData- Parameters:
trackingData- new tracking data
-
getDeletionStatus
public DeletionStatus getDeletionStatus()
Description copied from interface:WithDeletionStatusGet the deletion status :Is it in a bin or ready to be definitely deleted.
Null means active.
- Specified by:
getDeletionStatusin interfaceWithDeletionStatus- Returns:
- null or a deletion status
-
setDeletionStatus
public void setDeletionStatus(DeletionStatus status)
Description copied from interface:WithDeletionStatusSet the deletion status :Is it in a bin or ready to be definitely deleted.
Null means active.
- Specified by:
setDeletionStatusin interfaceWithDeletionStatus- Parameters:
status- null or a deletion status
-
getIndex
public int getIndex()
-
setIndex
public void setIndex(int index)
-
getOwningCardContent
public CardContent getOwningCardContent()
- Returns:
- the card content for which this document is a deliverable
-
setOwningCardContent
public void setOwningCardContent(CardContent cardContent)
- Parameters:
cardContent- the card content for which this document is a deliverable
-
getOwningCardContentId
public Long getOwningCardContentId()
- Returns:
- the id of the card content for which this document is a deliverable
-
setOwningCardContentId
public void setOwningCardContentId(Long cardContentId)
- Parameters:
cardContentId- the id of the card content for which this document is a deliverable
-
hasOwningCardContent
public boolean hasOwningCardContent()
- Returns:
- True if there is an owning card content
-
getOwningResource
public Resource getOwningResource()
- Returns:
- the resource this document is part of
-
setOwningResource
public void setOwningResource(Resource resource)
- Parameters:
resource- the resource this document is part of
-
getOwningResourceId
public Long getOwningResourceId()
- Returns:
- the id of the resource this document is part of
-
setOwningResourceId
public void setOwningResourceId(Long resourceId)
- Parameters:
resourceId- the id of the resource this document is part of
-
hasOwningResource
public boolean hasOwningResource()
- Returns:
- True if there is an owning resource
-
getStickyNoteLinksAsSrc
public List<StickyNoteLink> getStickyNoteLinksAsSrc()
- Specified by:
getStickyNoteLinksAsSrcin interfaceStickyNoteSourceable- Returns:
- the list of sticky note links of which the document is the source
-
setStickyNoteLinksAsSrc
public void setStickyNoteLinksAsSrc(List<StickyNoteLink> stickyNoteLinksAsSrc)
- Parameters:
stickyNoteLinksAsSrc- the list of sticky note links of which the document is the source
-
mergeToUpdate
public void mergeToUpdate(ColabEntity other) throws ColabMergeException
Description copied from interface:ColabEntityUpdate this object according to values provided by other.This is used when an object is prepared to be updated in database.
- Specified by:
mergeToUpdatein interfaceColabEntity- Parameters:
other- object to take new values from- Throws:
ColabMergeException- if merging is not possible
-
getProject
public Project getProject()
Get the project this document belongs to- Returns:
- document owner
-
getChannelsBuilder
public ChannelsBuilders.ChannelsBuilder getChannelsBuilder()
Description copied from interface:WithWebsocketChannelsGet the channels this entity shall be sent through.- Specified by:
getChannelsBuilderin interfaceWithWebsocketChannels- Returns:
- list of channels
-
getReadCondition
public Conditions.Condition getReadCondition()
Description copied from interface:WithPermissionGet the condition required to read this entity- Specified by:
getReadConditionin interfaceWithPermission- Returns:
- the condition
-
getUpdateCondition
public Conditions.Condition getUpdateCondition()
Description copied from interface:WithPermissionGet the condition required to update this entity- Specified by:
getUpdateConditionin interfaceWithPermission- Returns:
- the condition
-
toPartialString
protected String toPartialString()
- Returns:
- This abstract class fields to mention in the toString implementations
-
-