Interface Contribution

    • Method Detail

      • 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.
        Specified by:
        getName in interface Nameable
        Returns:
        the contribution title.
      • getDescription

        default String getDescription()
        Gets a description about this contribution if any. By default returns an empty String.
        Specified by:
        getDescription in interface Nameable
        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 interface Securable
        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 a DefaultContributionModel instance that access the business properties of the contribution by reflection.
        Returns:
        a ContributionModel object. By default, if this method isn't overridden, a DefaultContributionModel instance is returned.
      • getResourcePath

        default <T extends ContributionOptional<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.