Interface Contribution
-
- All Superinterfaces:
Instance<Contribution>
,Nameable
,Securable
,Serializable
,SilverpeasResource
- All Known Subinterfaces:
Attachment
,Folder
,I18nContribution
,LocalizedAttachment
,LocalizedContribution
,SilverContentInterface
,SilverpeasContent
,SilverpeasToolContent
,ValidableContribution
- All Known Implementing Classes:
AbstractSilverpeasContentManager.ContributionWrapper
,CalendarEvent
,CalendarEventOccurrence
,Comment
,Document
,HistorisedDocument
,HistorisedDocumentVersion
,NodeDetail
,PublicationDetail
,QuestionContainerDetail
,QuestionContainerHeader
,SilverContent
,SimpleDocument
,SimpleDocumentVersion
public interface Contribution extends SilverpeasResource, Serializable, Securable, Instance<Contribution>
A contribution in Silverpeas. A contribution is an identifiable resource that is pushed by a user onto Silverpeas and that is manageable by the users within Silverpeas. A contribution has always a content that can be of any type (simple text, WYSIWYG, form, image, ...).- Author:
- mmoquillon
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
canBeAccessedBy(User user)
Is the specified user can access this contribution?default String
getContributionType()
Gets the type of this contribution.default String
getDescription()
Gets a description about this contribution if any.ContributionIdentifier
getIdentifier()
Gets the unique identifier of this contribution.default ContributionModel
getModel()
Gets a model to this contribution.default String
getName()
Gets the name of this contribution.default <T extends Contribution>
Optional<ResourcePath<T>>getResourcePath()
default String
getTitle()
Gets the title of this contribution if any.default boolean
isIndexable()
Is this contribution indexable?-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeDeletedBy, canBeFiledInBy, canBeModifiedBy
-
Methods inherited from interface org.silverpeas.core.SilverpeasResource
getCreationDate, getCreator, getLastUpdateDate, getLastUpdater
-
-
-
-
Method Detail
-
getIdentifier
ContributionIdentifier getIdentifier()
Gets the unique identifier of this contribution.- Specified by:
getIdentifier
in interfaceSilverpeasResource
- Returns:
- the unique identifier of the contribution.
-
getTitle
default String getTitle()
Gets the title of this contribution if any. By default returns an empty String.- Returns:
- the contribution's title in the specified language. Can be empty if no title was set or no title is defined for a such contribution.
-
getName
default String getName()
Gets the name of this contribution. The name is in a contribution its title.
-
getDescription
default String getDescription()
Gets a description about this contribution if any. By default returns an empty String.- Specified by:
getDescription
in interfaceNameable
- Returns:
- the description on this contribution. Can be empty if no description was set or no description is defined for a such contribution.
-
getContributionType
default String getContributionType()
Gets the type of this contribution. The type is a label that identifies uniquely a kind of contribution handled by a Silverpeas application. By default, this method returns the simple name of the class implementing this interface.- Returns:
- the label of the type of this contribution.
-
isIndexable
default boolean isIndexable()
Is this contribution indexable? By default true.- Returns:
- a boolean indicating if this contribution can be taken in charge by the Indexation Engine. By default, any contribution in Silverpeas are indexable unless specified otherwise.
-
canBeAccessedBy
default boolean canBeAccessedBy(User user)
Is the specified user can access this contribution?By default
Securable.canBeAccessedBy(User)
is implemented so that a user can access a contribution if it has enough rights to access the application instance in which is managed this contribution.
Indeed, this behavior is mostly the common one.
But In the case the application instance distributes its contribution along of a categorization tree and the nodes of this tree support access rights, then the user must have also the rights to access the node to which belongs the content.
Of course it could exist other access rules...- Specified by:
canBeAccessedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can access this content, false otherwise.
-
getModel
default ContributionModel getModel()
Gets a model to this contribution. A model is a business abstract representation of the concrete type of this contribution. If not overridden, it returns by default aDefaultContributionModel
instance that access the business properties of the contribution by reflection.- Returns:
- a
ContributionModel
object. By default, if this method isn't overridden, aDefaultContributionModel
instance is returned.
-
getResourcePath
default <T extends Contribution> Optional<ResourcePath<T>> getResourcePath()
Gets the
of the contribution represented by the given identifier.Returns empty by default if not implemented.
- Type Parameters:
T
- the type the contribution.- Returns:
- the optional
ResourcePath
instance. - Throws:
IllegalStateException
- when the type of the contribution is not handled by the implementation.
-
-