Class PersonalComponentInstance
- java.lang.Object
-
- org.silverpeas.core.admin.component.model.PersonalComponentInstance
-
- All Implemented Interfaces:
Serializable
,SilverpeasComponentInstance
,SilverpeasPersonalComponentInstance
,Identifiable
,Nameable
public class PersonalComponentInstance extends Object implements SilverpeasPersonalComponentInstance
- Author:
- Yohann Chastagnier
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<PersonalComponentInstance>
from(String personalComponentInstanceId)
Gets the personal component instance from an instance identifier.static PersonalComponentInstance
from(User user, PersonalComponent personalComponent)
Gets the personal component instance from a user and the definition of a personal component.static String
getComponentName(String componentInstanceId)
Gets the name of the personal 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.String
getId()
Gets the unique identifier of the object in Silverpeas.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.String
getSpaceId()
Gets the identifier of the space which the component instance belong to.User
getUser()
Gets the user associated to the personal component instance.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.admin.component.model.SilverpeasComponentInstance
getHighestSilverpeasRolesFor, getParameterValue, isHidden, isPublic, isRemoved, isTopicTracker, isWorkflow
-
Methods inherited from interface org.silverpeas.core.admin.component.model.SilverpeasPersonalComponentInstance
getSilverpeasRolesFor, isPersonal
-
-
-
-
Method Detail
-
getComponentName
public static String getComponentName(String componentInstanceId)
Gets the name of the personal component from which the specified instance was spawn. By convention, the identifiers of the component instances are made up of the name of the component followed by a number (the user identifier) plus additional stuff. This method is a way to get directly the component name from an instance identifier.- Parameters:
componentInstanceId
- the unique identifier of a component instance.- Returns:
- the name of the personal component or null if the specified identifier doesn't match the rule of a personal component instance identifier.
-
from
public static Optional<PersonalComponentInstance> from(String personalComponentInstanceId)
Gets the personal component instance from an instance identifier.- Parameters:
personalComponentInstanceId
- identifier of a personal component instance.- Returns:
- optionally an instance of
PersonalComponentInstance
.
-
from
public static PersonalComponentInstance from(User user, PersonalComponent personalComponent)
Gets the personal component instance from a user and the definition of a personal component.- Parameters:
user
- a getUser().personalComponent
- the definition of a personal component.- Returns:
- an instance of
PersonalComponentInstance
.
-
getUser
public User getUser()
Description copied from interface:SilverpeasPersonalComponentInstance
Gets the user associated to the personal component instance.- Specified by:
getUser
in interfaceSilverpeasPersonalComponentInstance
- Returns:
- a
User
instance.
-
getId
public String getId()
Description copied from interface:Identifiable
Gets the unique identifier of the object in Silverpeas. If he's also identified by a local identifier, then this method should return the one global to Silverpeas.- Specified by:
getId
in interfaceIdentifiable
- Returns:
- the identifier encoded as a String. If the identifier is a complex one, that is made up of several identification parts, then the returned representation should take care of such a structure.
-
getSpaceId
public String getSpaceId()
Description copied from interface:SilverpeasComponentInstance
Gets the identifier of the space which the component instance belong to.- Specified by:
getSpaceId
in interfaceSilverpeasComponentInstance
- Returns:
- an identifier as string.
-
getName
public String getName()
Description copied from interface:SilverpeasComponentInstance
Gets the component name of the component instance.- Specified by:
getName
in interfaceNameable
- Specified by:
getName
in interfaceSilverpeasComponentInstance
- Returns:
- the name of the component instance.
-
getLabel
public String getLabel()
Description copied from interface:SilverpeasComponentInstance
Gets the name of the component (from a functional point of view).- Specified by:
getLabel
in interfaceSilverpeasComponentInstance
- Returns:
- the name of the component.
-
getLabel
public String getLabel(String language)
Description copied from interface:SilverpeasComponentInstance
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.- Specified by:
getLabel
in interfaceSilverpeasComponentInstance
- Returns:
- the translated name of the component.
-
getDescription
public String getDescription()
Description copied from interface:SilverpeasComponentInstance
Gets the description of the component (from a functional point of view).- Specified by:
getDescription
in interfaceNameable
- Specified by:
getDescription
in interfaceSilverpeasComponentInstance
- Returns:
- the description of the component.
-
getDescription
public String getDescription(String language)
Description copied from interface:SilverpeasComponentInstance
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.- Specified by:
getDescription
in interfaceSilverpeasComponentInstance
- Returns:
- the translated description of the component.
-
getOrderPosition
public int getOrderPosition()
Description copied from interface:SilverpeasComponentInstance
Gets the position index of the component against the others into a space.- Specified by:
getOrderPosition
in interfaceSilverpeasComponentInstance
- Returns:
- a position as int.
-
-