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 booleanequals(Object obj)List<AbstractResource>expand()Resolve to concrete resource and return all transitive references too.List<Document>getDocuments()ConversionStatusgetLexicalConversion()TextDataBlockgetTeaser()LonggetTeaserId()get the id of the teaser.StringgetTitle()inthashCode()booleanisDeprecated()booleanisPublished()booleanisRequestingForGlory()voidmergeToDuplicate(ColabEntity other)Update this object according to values provided by other.voidmergeToUpdate(ColabEntity other)Update this object according to values provided by other.Resourceresolve()Resolve to concrete ResourcevoidsetDeprecated(boolean deprecated)voidsetDocuments(List<Document> documents)voidsetLexicalConversion(ConversionStatus lexicalConversion)voidsetPublished(boolean published)voidsetRequestingForGlory(boolean requestingForGlory)voidsetTeaser(TextDataBlock teaser)voidsetTeaserId(Long teaserId)set the id of the teaser.voidsetTitle(String title)StringtoString()-
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:AbstractResourceResolve to concrete Resource- Specified by:
resolvein classAbstractResource- Returns:
- the effective resource
-
expand
public List<AbstractResource> expand()
Description copied from class:AbstractResourceResolve to concrete resource and return all transitive references too.- Specified by:
expandin classAbstractResource- Returns:
- concrete resource and transitive references
-
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- Overrides:
mergeToUpdatein 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:ColabEntityUpdate this object according to values provided by other.This is used when an object is prepared to be duplicated.
- Specified by:
mergeToDuplicatein interfaceColabEntity- Overrides:
mergeToDuplicatein classAbstractResource- Parameters:
other- object to take new values from- Throws:
ColabMergeException- if merging is not possible
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractResource
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classAbstractResource
-
-