Interface SilverpeasComponentInstance
-
- All Superinterfaces:
Identifiable
,Nameable
,Serializable
- All Known Subinterfaces:
SilverpeasPersonalComponentInstance
,SilverpeasSharedComponentInstance
- All Known Implementing Classes:
ComponentInst
,ComponentInstLight
,PersonalComponentInstance
,ToolInstance
public interface SilverpeasComponentInstance extends Identifiable, Nameable, Serializable
An instance of a component. It can be either an instance of a multi-user applications or an instance of a personal application.- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static Optional<SilverpeasComponentInstance>
getById(String componentInstanceId)
Gets a silverpeas component instance from the specified identifier.static String
getComponentName(String componentInstanceId)
Gets the name of the Silverpeas component from which the specified instance was spawn.String
getDescription()
Gets the description of the component (from a functional point of view).String
getDescription(String language)
Gets the translated description of the component according to given language (from a functional point of view).
If no translation exists for given language, then the one ofDisplayI18NHelper.defaultLanguage
is returned.default SilverpeasRole
getHighestSilverpeasRolesFor(User user)
Gets the highest silverpeas role the given user has on the component instance.
BE CAREFUL, the manager role is never returned as it corresponds to a space role.String
getLabel()
Gets the name of the component (from a functional point of view).String
getLabel(String language)
Gets the translated name of the component according to given language (from a functional point of view).
If no translation exists for given language, then the one ofDisplayI18NHelper.getDefaultLanguage()
is returned.String
getName()
Gets the component name of the component instance.int
getOrderPosition()
Gets the position index of the component against the others into a space.default String
getParameterValue(String parameterName)
Gets the value of component instance parameter.Collection<SilverpeasRole>
getSilverpeasRolesFor(User user)
Gets the silverpeas role the given user has on the component instance.
BE CAREFUL, the manager role is never returned as it corresponds to a space role.String
getSpaceId()
Gets the identifier of the space which the component instance belong to.default boolean
isHidden()
Indicates if the component instance is hidden.default boolean
isPersonal()
Indicates if the component instance is a personal one.
A personal component instance is linked to a user.default boolean
isPublic()
Indicates if the component instance is public.default boolean
isRemoved()
Indicates if the component instance is into a REMOVED state.default boolean
isTopicTracker()
Indicates if the component instance is a topic tracker.default boolean
isWorkflow()
Indicates if the component instance is a workflow one.-
Methods inherited from interface org.silverpeas.core.Identifiable
getId
-
-
-
-
Method Detail
-
getById
static Optional<SilverpeasComponentInstance> getById(String componentInstanceId)
Gets a silverpeas component instance from the specified identifier.- Parameters:
componentInstanceId
- a component instance identifier as string.- Returns:
- an optional silverpeas component instance of
SilverpeasComponentInstance
.
-
getComponentName
static String getComponentName(String componentInstanceId)
Gets the name of the Silverpeas component from which the specified instance was spawn.- Parameters:
componentInstanceId
- the unique identifier of a component instance.- Returns:
- the name of a component.
-
getSpaceId
String getSpaceId()
Gets the identifier of the space which the component instance belong to.- Returns:
- an identifier as string.
-
getName
String getName()
Gets the component name of the component instance.
-
getLabel
String getLabel()
Gets the name of the component (from a functional point of view).- Returns:
- the name of the component.
-
getLabel
String getLabel(String language)
Gets the translated name of the component according to given language (from a functional point of view).
If no translation exists for given language, then the one ofDisplayI18NHelper.getDefaultLanguage()
is returned.- Returns:
- the translated name of the component.
-
getDescription
String getDescription()
Gets the description of the component (from a functional point of view).- Specified by:
getDescription
in interfaceNameable
- Returns:
- the description of the component.
-
getDescription
String getDescription(String language)
Gets the translated description of the component according to given language (from a functional point of view).
If no translation exists for given language, then the one ofDisplayI18NHelper.defaultLanguage
is returned.- Returns:
- the translated description of the component.
-
isPersonal
default boolean isPersonal()
Indicates if the component instance is a personal one.
A personal component instance is linked to a user.- Returns:
- true if it is a personal one, false otherwise.
-
isPublic
default boolean isPublic()
Indicates if the component instance is public.- Returns:
- true if public, false otherwise.
-
isHidden
default boolean isHidden()
Indicates if the component instance is hidden.- Returns:
- true if hidden, false otherwise.
-
isWorkflow
default boolean isWorkflow()
Indicates if the component instance is a workflow one.- Returns:
- true if it is a workflow, false otherwise.
-
isTopicTracker
default boolean isTopicTracker()
Indicates if the component instance is a topic tracker.- Returns:
- true if it is a topic tracker, false otherwise.
-
isRemoved
default boolean isRemoved()
Indicates if the component instance is into a REMOVED state.- Returns:
- true if into removed state, false otherwise.
-
getOrderPosition
int getOrderPosition()
Gets the position index of the component against the others into a space.- Returns:
- a position as int.
-
getSilverpeasRolesFor
Collection<SilverpeasRole> getSilverpeasRolesFor(User user)
Gets the silverpeas role the given user has on the component instance.
BE CAREFUL, the manager role is never returned as it corresponds to a space role.- Parameters:
user
- the user for which the roles are retrieved.- Returns:
- a list of
SilverpeasRole
, empty of no roles.
-
getHighestSilverpeasRolesFor
default SilverpeasRole getHighestSilverpeasRolesFor(User user)
Gets the highest silverpeas role the given user has on the component instance.
BE CAREFUL, the manager role is never returned as it corresponds to a space role.- Parameters:
user
- the user for which the roles are retrieved.- Returns:
- a role if any, null otherwise.
-
-