Class SuggestionBox

java.lang.Object
org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity<E,I>
org.silverpeas.core.persistence.datasource.model.jpa.SilverpeasJpaEntity<SuggestionBox,org.silverpeas.core.persistence.datasource.model.identifier.UuidIdentifier>
org.silverpeas.components.suggestionbox.model.SuggestionBox
All Implemented Interfaces:
Serializable, org.silverpeas.core.persistence.datasource.model.Entity<SuggestionBox,org.silverpeas.core.persistence.datasource.model.identifier.UuidIdentifier>, org.silverpeas.core.persistence.datasource.model.IdentifiableEntity

@Entity public class SuggestionBox extends org.silverpeas.core.persistence.datasource.model.jpa.SilverpeasJpaEntity<SuggestionBox,org.silverpeas.core.persistence.datasource.model.identifier.UuidIdentifier>
This entity represents a suggestion box.
Author:
Yohann Chastagnier
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
     
    SuggestionBox(String componentInstanceId)
    Creates a new suggestion box with the specified title and with the specified short description.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the suggestion box represented by the specified identifier.
    Gets the component instance identifier which is the identifier of a suggestion box.
    Gets the description of the suggestion box according to requested language.
    org.silverpeas.core.admin.user.model.SilverpeasRole
    getHighestUserRole(org.silverpeas.core.admin.user.model.User user)
    Gets the highest role of the specified user on the suggestion box.
     
    getTitle(String language)
    Gets the title of the suggestion box according to requested language.
    protected List<Suggestion>
    Gets the actual persisted suggestions in this suggestion box.

    Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.SilverpeasJpaEntity

    createdBy, createdBy, createdBy, equals, getCreationDate, getCreator, getCreatorId, getLastUpdateDate, getLastUpdater, getLastUpdaterId, getVersion, hasBeenModified, hashCode, lastUpdatedBy, markAsModified, performBeforePersist, performBeforeRemove, performBeforeUpdate, setCreationDate, setCreator, setLastUpdateDate, setLastUpdater, setVersion, updatedBy, updatedBy

    Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity

    getId, getNativeId, isPersisted, setId

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.silverpeas.core.persistence.datasource.model.IdentifiableEntity

    getId, isPersisted
  • Constructor Details

    • SuggestionBox

      public SuggestionBox(String componentInstanceId)
      Creates a new suggestion box with the specified title and with the specified short description.
      Parameters:
      componentInstanceId - the unique identifier of the application to which the suggestion box belongs.
    • SuggestionBox

      protected SuggestionBox()
  • Method Details

    • getByComponentInstanceId

      public static SuggestionBox getByComponentInstanceId(String suggestionBoxId)
      Gets the suggestion box represented by the specified identifier.
      Parameters:
      suggestionBoxId - the identifier of the required suggestion box.
      Returns:
      the suggestion box instance if exists, null otherwise.
    • getComponentInstanceId

      public String getComponentInstanceId()
      Gets the component instance identifier which is the identifier of a suggestion box.
      Returns:
      the suggestion box component identifier.
    • getTitle

      public String getTitle(String language)
      Gets the title of the suggestion box according to requested language.
      Parameters:
      language - the language at which the title has to be returned.
      Returns:
      the suggestion box title according to requested language.
    • getDescription

      public String getDescription(String language)
      Gets the description of the suggestion box according to requested language.
      Parameters:
      language - the language at which the title has to be returned.
      Returns:
      the description box description according to requested language.
    • getSuggestions

      public SuggestionCollection getSuggestions()
    • persistedSuggestions

      protected List<Suggestion> persistedSuggestions()
      Gets the actual persisted suggestions in this suggestion box. This operation is a side effect one as it performs some accesses to the underlying data source.
      Returns:
      the list of actual suggestions in this suggestion box.
    • getHighestUserRole

      public org.silverpeas.core.admin.user.model.SilverpeasRole getHighestUserRole(org.silverpeas.core.admin.user.model.User user)
      Gets the highest role of the specified user on the suggestion box.
      Parameters:
      user - the aimed user.
      Returns:
      a SilverpeasRole instance.