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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the document/resource sequenceprotected LongDocument IDprotected CardContentThe card content for which this document is a deliverableprotected ResourceThe resource this document is part of -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the channels this entity shall be sent through.Get the deletion status :getId()intgetIndex()Get the project this document belongs toGet the condition required to read this entityGet the tracking dataGet the condition required to update this entityinthashCode()booleanbooleanvoidmergeToUpdate(ColabEntity other) Update this object according to values provided by other.voidsetDeletionStatus(DeletionStatus status) Set the deletion status :voidvoidsetIndex(int index) voidsetOwningCardContent(CardContent cardContent) voidsetOwningCardContentId(Long cardContentId) voidsetOwningResource(Resource resource) voidsetOwningResourceId(Long resourceId) voidsetStickyNoteLinksAsSrc(List<StickyNoteLink> stickyNoteLinksAsSrc) voidsetTrackingData(Tracking trackingData) Set tracking dataprotected Stringabstract StringtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.colabproject.colab.api.model.ColabEntity
mergeToDuplicateMethods inherited from interface ch.colabproject.colab.generator.model.interfaces.WithJsonDiscriminator
getJsonDiscriminatorMethods inherited from interface ch.colabproject.colab.api.model.WithPermission
getCreateCondition, getDeleteConditionMethods inherited from interface ch.colabproject.colab.api.model.WithTrackingData
clearErasureTrackingData, setErasureTrackingData, touchMethods inherited from interface ch.colabproject.colab.api.model.WithWebsocketChannels
getIndexEntryPayload
-
Field Details
-
DOCUMENT_SEQUENCE_NAME
Name of the document/resource sequence- See Also:
-
id
Document ID -
owningCardContent
The card content for which this document is a deliverable -
owningResource
The resource this document is part of
-
-
Constructor Details
-
Document
public Document()
-
-
Method Details
-
getId
-
setId
- Parameters:
id- the document id
-
getTrackingData
Get the tracking data- Specified by:
getTrackingDatain interfaceWithTrackingData- Returns:
- tracking data
-
setTrackingData
Set tracking data- Specified by:
setTrackingDatain interfaceWithTrackingData- Parameters:
trackingData- new tracking data
-
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
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
- Returns:
- the card content for which this document is a deliverable
-
setOwningCardContent
- Parameters:
cardContent- the card content for which this document is a deliverable
-
getOwningCardContentId
- Returns:
- the id of the card content for which this document is a deliverable
-
setOwningCardContentId
- 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
- Returns:
- the resource this document is part of
-
setOwningResource
- Parameters:
resource- the resource this document is part of
-
getOwningResourceId
- Returns:
- the id of the resource this document is part of
-
setOwningResourceId
- 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
- Specified by:
getStickyNoteLinksAsSrcin interfaceStickyNoteSourceable- Returns:
- the list of sticky note links of which the document is the source
-
setStickyNoteLinksAsSrc
- Parameters:
stickyNoteLinksAsSrc- the list of sticky note links of which the document is the source
-
mergeToUpdate
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
Get the project this document belongs to- Returns:
- document owner
-
getChannelsBuilder
Description copied from interface:WithWebsocketChannelsGet the channels this entity shall be sent through.- Specified by:
getChannelsBuilderin interfaceWithWebsocketChannels- Returns:
- list of channels
-
getReadCondition
Description copied from interface:WithPermissionGet the condition required to read this entity- Specified by:
getReadConditionin interfaceWithPermission- Returns:
- the condition
-
getUpdateCondition
Description copied from interface:WithPermissionGet the condition required to update this entity- Specified by:
getUpdateConditionin interfaceWithPermission- Returns:
- the condition
-
hashCode
public int hashCode() -
equals
-
toString
-
toPartialString
- Returns:
- This abstract class fields to mention in the toString implementations
-