Class Resource
- java.lang.Object
-
- ch.colabproject.colab.api.model.document.AbstractResource
-
- ch.colabproject.colab.api.model.document.Resource
-
- All Implemented Interfaces:
ColabEntity
,StickyNoteSourceable
,WithDeletionStatus
,WithPermission
,WithTrackingData
,WithWebsocketChannels
,ch.colabproject.colab.generator.model.interfaces.WithId
,ch.colabproject.colab.generator.model.interfaces.WithJsonDiscriminator
,Serializable
@Entity public class Resource extends AbstractResource
A resource is a document provided to help the users to fulfill their goals.- Author:
- sandra
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class ch.colabproject.colab.api.model.document.AbstractResource
id
-
-
Constructor Summary
Constructors Constructor Description Resource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
List<AbstractResource>
expand()
Resolve to concrete resource and return all transitive references too.List<Document>
getDocuments()
ConversionStatus
getLexicalConversion()
TextDataBlock
getTeaser()
Long
getTeaserId()
get the id of the teaser.String
getTitle()
int
hashCode()
boolean
isDeprecated()
boolean
isPublished()
boolean
isRequestingForGlory()
void
mergeToDuplicate(ColabEntity other)
Update this object according to values provided by other.void
mergeToUpdate(ColabEntity other)
Update this object according to values provided by other.Resource
resolve()
Resolve to concrete Resourcevoid
setDeprecated(boolean deprecated)
void
setDocuments(List<Document> documents)
void
setLexicalConversion(ConversionStatus lexicalConversion)
void
setPublished(boolean published)
void
setRequestingForGlory(boolean requestingForGlory)
void
setTeaser(TextDataBlock teaser)
void
setTeaserId(Long teaserId)
set the id of the teaser.void
setTitle(String title)
String
toString()
-
Methods inherited from class ch.colabproject.colab.api.model.document.AbstractResource
getAbstractCardType, getAbstractCardTypeId, getCard, getCardContent, getCardContentId, getCardId, getCategory, getChannelsBuilder, getDeletionStatus, getId, getOwner, getProject, getReadCondition, getStickyNoteLinksAsSrc, getTrackingData, getUpdateCondition, hasAbstractCardType, hasCard, hasCardContent, setAbstractCardType, setAbstractCardTypeId, setCard, setCardContent, setCardContentId, setCardId, setCategory, setDeletionStatus, setId, setOwner, setStickyNoteLinksAsSrc, setTrackingData, toPartialString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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
-
-
-
-
Method Detail
-
getTitle
public String getTitle()
- Returns:
- The title
-
setTitle
public void setTitle(String title)
- Parameters:
title
- The title
-
isPublished
public boolean isPublished()
- Returns:
- if it is at the disposal of the inheritors
-
setPublished
public void setPublished(boolean published)
- Parameters:
published
- if it is at the disposal of the inheritors
-
isRequestingForGlory
public boolean isRequestingForGlory()
- Returns:
- if it asks upper level(s) to integrate the resource
-
setRequestingForGlory
public void setRequestingForGlory(boolean requestingForGlory)
- Parameters:
requestingForGlory
- if it asks upper level(s) to integrate the resource
-
isDeprecated
public boolean isDeprecated()
- Returns:
- if it should not be used anymore
-
setDeprecated
public void setDeprecated(boolean deprecated)
- Parameters:
deprecated
- if it should not be used anymore
-
getLexicalConversion
public ConversionStatus getLexicalConversion()
- Returns:
- the conversion status : conversion status of documents for lexical
-
setLexicalConversion
public void setLexicalConversion(ConversionStatus lexicalConversion)
- Parameters:
lexicalConversion
- the new conversion status : conversion status of documents for lexical
-
getTeaser
public TextDataBlock getTeaser()
- Returns:
- the teaser / abstract
-
setTeaser
public void setTeaser(TextDataBlock teaser)
- Parameters:
teaser
- the teaser / abstract
-
getTeaserId
public Long getTeaserId()
get the id of the teaser. To be sent to client.- Returns:
- the id of the teaser
-
setTeaserId
public void setTeaserId(Long teaserId)
set the id of the teaser. For serialization only.- Parameters:
teaserId
- the id of the teaser
-
setDocuments
public void setDocuments(List<Document> documents)
- Parameters:
documents
- the content of the resource
-
resolve
public Resource resolve()
Description copied from class:AbstractResource
Resolve to concrete Resource- Specified by:
resolve
in classAbstractResource
- Returns:
- the effective resource
-
expand
public List<AbstractResource> expand()
Description copied from class:AbstractResource
Resolve to concrete resource and return all transitive references too.- Specified by:
expand
in classAbstractResource
- Returns:
- concrete resource and transitive references
-
mergeToUpdate
public void mergeToUpdate(ColabEntity other) throws ColabMergeException
Description copied from interface:ColabEntity
Update this object according to values provided by other.This is used when an object is prepared to be updated in database.
- Specified by:
mergeToUpdate
in interfaceColabEntity
- Overrides:
mergeToUpdate
in classAbstractResource
- Parameters:
other
- object to take new values from- Throws:
ColabMergeException
- if merging is not possible
-
mergeToDuplicate
public void mergeToDuplicate(ColabEntity other) throws ColabMergeException
Description copied from interface:ColabEntity
Update this object according to values provided by other.This is used when an object is prepared to be duplicated.
- Specified by:
mergeToDuplicate
in interfaceColabEntity
- Overrides:
mergeToDuplicate
in classAbstractResource
- Parameters:
other
- object to take new values from- Throws:
ColabMergeException
- if merging is not possible
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractResource
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractResource
-
-