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:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SuggestionBox()
SuggestionBox(String componentInstanceId)
Creates a new suggestion box with the specified title and with the specified short description.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SuggestionBox
getByComponentInstanceId(String suggestionBoxId)
Gets the suggestion box represented by the specified identifier.String
getComponentInstanceId()
Gets the component instance identifier which is the identifier of a suggestion box.String
getDescription(String language)
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.SuggestionCollection
getSuggestions()
String
getTitle(String language)
Gets the title of the suggestion box according to requested language.protected List<Suggestion>
persistedSuggestions()
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
-
-
-
-
Constructor Detail
-
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 Detail
-
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.
-
-