Class BasketItem

  • All Implemented Interfaces:
    Serializable, Nameable, SilverpeasResource

    public class BasketItem
    extends Object
    implements SilverpeasResource, Serializable
    Item in the SelectionBasket. It is the web entity representing in the more generic way a Silverpeas resource, whatever it is. It requires the unique identifier of the resource to be set. The item is complete if and only if its name, its creation data and its last modification data are set, as any others properties are optional and depend on the represented resource.
    Author:
    mmoquillon
    See Also:
    Serialized Form
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Nameable
        Gets the name of the object in Silverpeas.
        Specified by:
        getName in interface Nameable
        Returns:
        the name or the title of the object.
      • getDescription

        public String getDescription()
        Description copied from interface: Nameable
        Gets the description about the object in Silverpeas.
        Specified by:
        getDescription in interface Nameable
        Returns:
        a short description about the object.
      • getLastUpdateDate

        public Date getLastUpdateDate()
        Description copied from interface: SilverpeasResource
        Gets the date at which the resource has been lastly updated. If the resource doesn't have such an information, then this method should return the date of the resource creation.
        Specified by:
        getLastUpdateDate in interface SilverpeasResource
        Returns:
        the date of the last update of the resource.
      • getLastUpdater

        public User getLastUpdater()
        Description copied from interface: SilverpeasResource
        Gets the user that has lastly updated the resource. If the resource doesn't have such an information, then this method should return the user that has created the resource.
        Specified by:
        getLastUpdater in interface SilverpeasResource
        Returns:
        a User in Silverpeas.
      • getThumbnailURI

        public String getThumbnailURI()
        Gets the URI of the thumbnail of this item.
        Returns:
        either the URI of a thumbnail or null if the item has no thumbnail or doesn't support thumbnails.
      • getPermalink

        public String getPermalink()
        Gets the URI at which the resource referred by this item can be always found in Silverpeas.
        Returns:
        the permalink of this item in Silverpeas or null if the item doesn't support permalinks.
      • getType

        public String getType()
        Gets the type of the item in Silverpeas.
        Returns:
        the item type.
      • isSpace

        public boolean isSpace()
        Is this item represent a collaborative space in Silverpeas?
        Returns:
        true if this object represents a space in Silverpeas. False otherwise.
      • isComponentInstance

        public boolean isComponentInstance()
        Is this item represent an instance of a Silverpeas application?
        Returns:
        true if this object represents a component instance. False otherwise.
      • isContribution

        public boolean isContribution()
        Is this BasketItem instance represent a contribution in Silverpeas?
        Returns:
        true if this object represents a contribution in Silverpeas. False if it represents an organisational resource in Silverpeas (application instance, space, ...)
      • isPlanned

        public boolean isPlanned()
        Is this BasketItem instance represents a bean in Silverpeas planned in a period of time?
        Returns:
        true if this object is planned in a period of time. False otherwise.
      • isComplete

        public boolean isComplete()
        Is the data of the Silverpeas resource represented by this BasketItem complete? The data are considered completed if and only if the name, the creation data and the last update data of the represented resource are set.
        Returns:
        true if this item represents completely the Silverpeas resource.
      • toContribution

        public <T extends Contribution> T toContribution()
        Finds the contribution that is mapped by this BasketItem instance. If no contributions exists with the identifier of this object or if this object doesn't represent a contribution, then a NotFoundException is thrown.
        Returns:
        the contribution in Silverpeas that is related by this BasketItem instance.
      • toResource

        public <T extends SilverpeasResource> T toResource()
        Finds the resource in Silverpeas that is mapped by this BasketItem instance. If there is no resources nor no contributions in Silverpeas mapped by this object, then a NotFoundException is thrown.
        Returns:
        the Silverpeas resource mapped by this object. It can be either a contribution or a collaborative space or an application instance.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object