Class ComponentInst
- java.lang.Object
-
- org.silverpeas.core.i18n.AbstractI18NBean<ComponentI18N>
-
- org.silverpeas.core.admin.component.model.ComponentInst
-
- All Implemented Interfaces:
Serializable
,SilverpeasComponentInstance
,SilverpeasSharedComponentInstance
,WithPermanentLink
,I18NBean<ComponentI18N>
,LocalizedResource
,Translatable
,Identifiable
,Nameable
,Securable
,SilverpeasResource
public class ComponentInst extends AbstractI18NBean<ComponentI18N> implements SilverpeasSharedComponentInstance, WithPermanentLink
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
STATUS_REMOVED
-
Constructor Summary
Constructors Constructor Description ComponentInst()
Creates new ComponentInstComponentInst(ComponentInst ci)
Creates a new Component instance as a copy of the specified one.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProfileInst(ProfileInst profileInst)
void
deleteProfileInst(ProfileInst profileInst)
boolean
equals(Object o)
List<ProfileInst>
getAllProfilesInst()
static int
getComponentLocalId(String componentInstanceId)
Gets the local identifier of the multi-user component from which the specified instance was spawn.static String
getComponentName(String componentInstanceId)
Gets the name of the multi-user component from which the specified instance was spawn.Date
getCreationDate()
Gets the date at which the resource has been created.User
getCreator()
Gets the user that has created the resource.String
getCreatorUserId()
String
getDomainFatherId()
String
getId()
Gets the unique identifier of the object in Silverpeas.BasicIdentifier
getIdentifier()
Gets the unique identifier of this resource.ProfileInst
getInheritedProfileInst(String profileName)
List<ProfileInst>
getInheritedProfiles()
String
getInternalLink()
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.Date
getLastUpdateDate()
Gets the date at which the resource has been lastly updated.User
getLastUpdater()
Gets the user that has lastly updated the resource.int
getLocalId()
String
getName()
This method is a hack (technical debt)int
getNumProfileInst()
int
getOrderNum()
int
getOrderPosition()
Gets the position index of the component against the others into a space.Parameter
getParameter(String parameterName)
List<Parameter>
getParameters()
String
getParameterValue(String parameterName)
Gets the value of component instance parameter.String
getPermalink()
ProfileInst
getProfileInst(int nIndex)
ProfileInst
getProfileInst(String profileName)
List<ProfileInst>
getProfiles()
Gets the specific right profiles of this component instance (that is to say all the non-inherited profiles)Date
getRemovalDate()
User
getRemover()
String
getRemoverUserId()
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.String
getStatus()
protected Class<ComponentI18N>
getTranslationType()
String
getUpdaterUserId()
int
hashCode()
boolean
isHidden()
Indicates if the component instance is hidden.boolean
isInheritanceBlocked()
boolean
isPublic()
Indicates if the component instance is public.boolean
isRemoved()
Indicates if the component instance is into a REMOVED state.boolean
isTopicTracker()
Indicates if the component instance is a topic tracker.boolean
isWorkflow()
Indicates if the component instance is a workflow one.void
removeAllProfilesInst()
void
removeInheritedProfiles()
void
setCreationDate(Date createDate)
void
setCreatorUserId(String creatorUserId)
void
setDomainFatherId(String sDomainFatherId)
void
setHidden(boolean isHidden)
void
setInheritanceBlocked(boolean isInheritanceBlocked)
void
setLabel(String sLabel)
void
setLastUpdateDate(Date updateDate)
void
setLocalId(int id)
void
setName(String sName)
This method is a hack (technical debt)void
setOrderNum(int iOrderNum)
void
setParameters(List<Parameter> parameters)
void
setPublic(boolean isPublic)
void
setRemovalDate(Date removeDate)
void
setRemoverUserId(String removerUserId)
void
setStatus(String status)
void
setUpdaterUserId(String updaterUserId)
-
Methods inherited from class org.silverpeas.core.i18n.AbstractI18NBean
addTranslation, getClonedTranslations, getDescription, getDescription, getLanguage, getLanguages, getLanguageToDisplay, getName, getNextTranslation, getTranslation, getTranslationId, getTranslations, isRemoveTranslation, setDescription, setLanguage, setRemoveTranslation, setTranslationId, setTranslations, setTranslations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.i18n.LocalizedResource
getTranslation
-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeDeletedBy
-
Methods inherited from interface org.silverpeas.core.admin.component.model.SilverpeasComponentInstance
getDescription, getDescription, getHighestSilverpeasRolesFor, isPersonal
-
Methods inherited from interface org.silverpeas.core.admin.component.model.SilverpeasSharedComponentInstance
canBeAccessedBy, canBeFiledInBy, canBeModifiedBy
-
-
-
-
Field Detail
-
STATUS_REMOVED
public static final String STATUS_REMOVED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ComponentInst
public ComponentInst()
Creates new ComponentInst
-
ComponentInst
public ComponentInst(ComponentInst ci)
Creates a new Component instance as a copy of the specified one. Only the identifier isn't copied as it should be unique.- Parameters:
ci
- a component instance to copy.
-
-
Method Detail
-
getTranslationType
protected Class<ComponentI18N> getTranslationType()
- Specified by:
getTranslationType
in classAbstractI18NBean<ComponentI18N>
-
getComponentName
public static String getComponentName(String componentInstanceId)
Gets the name of the multi-user 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. 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 multi-user component or null if the specified identifier doesn't match the rule of a shared component instance identifier.
-
getComponentLocalId
public static int getComponentLocalId(String componentInstanceId)
Gets the local identifier of the multi-user 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 local identifier. This method is a way to get directly the component local identifier from an instance identifier.- Parameters:
componentInstanceId
- the unique identifier of a component instance.- Returns:
- the local identifier of the multi-user component or -1 if the specified identifier doesn't match the rule of a shared component instance identifier.
-
getIdentifier
public BasicIdentifier getIdentifier()
Description copied from interface:SilverpeasResource
Gets the unique identifier of this resource.- Specified by:
getIdentifier
in interfaceSilverpeasResource
- Specified by:
getIdentifier
in interfaceSilverpeasSharedComponentInstance
- Returns:
- the
ResourceIdentifier
object representing the unique identifier of the resource.
-
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.
-
setLocalId
public void setLocalId(int id)
-
getLocalId
public int getLocalId()
-
setName
public void setName(String sName)
This method is a hack (technical debt)- Overrides:
setName
in classAbstractI18NBean<ComponentI18N>
- Parameters:
sName
- new name of the application.
-
getName
public String getName()
This method is a hack (technical debt)- Specified by:
getName
in interfaceNameable
- Specified by:
getName
in interfaceSilverpeasComponentInstance
- Overrides:
getName
in classAbstractI18NBean<ComponentI18N>
- Returns:
- the name of the application.
-
setLabel
public void setLabel(String sLabel)
-
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.
-
setDomainFatherId
public void setDomainFatherId(String sDomainFatherId)
-
getDomainFatherId
public String getDomainFatherId()
-
setOrderNum
public void setOrderNum(int iOrderNum)
-
getOrderNum
public int getOrderNum()
-
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.
-
getCreationDate
public Date getCreationDate()
Description copied from interface:SilverpeasResource
Gets the date at which the resource has been created.- Specified by:
getCreationDate
in interfaceSilverpeasResource
- Returns:
- the date of creation of the resource.
-
setCreationDate
public void setCreationDate(Date createDate)
-
getRemovalDate
public Date getRemovalDate()
-
setRemovalDate
public void setRemovalDate(Date removeDate)
-
getStatus
public String getStatus()
-
setStatus
public void setStatus(String status)
-
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 interfaceSilverpeasResource
- Returns:
- the date of the last update of the resource.
-
setLastUpdateDate
public void setLastUpdateDate(Date updateDate)
-
getRemoverUserId
public String getRemoverUserId()
-
setRemoverUserId
public void setRemoverUserId(String removerUserId)
-
getUpdaterUserId
public String getUpdaterUserId()
-
setUpdaterUserId
public void setUpdaterUserId(String updaterUserId)
-
getNumProfileInst
public int getNumProfileInst()
-
addProfileInst
public void addProfileInst(ProfileInst profileInst)
-
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.
-
deleteProfileInst
public void deleteProfileInst(ProfileInst profileInst)
-
getAllProfilesInst
public List<ProfileInst> getAllProfilesInst()
-
getInheritedProfiles
public List<ProfileInst> getInheritedProfiles()
-
getProfiles
public List<ProfileInst> getProfiles()
Gets the specific right profiles of this component instance (that is to say all the non-inherited profiles)- Returns:
- the specific right profiles of this component instance;
-
removeAllProfilesInst
public void removeAllProfilesInst()
-
getProfileInst
public ProfileInst getProfileInst(String profileName)
-
getInheritedProfileInst
public ProfileInst getInheritedProfileInst(String profileName)
-
getProfileInst
public ProfileInst getProfileInst(int nIndex)
-
getParameterValue
public String getParameterValue(String parameterName)
Description copied from interface:SilverpeasComponentInstance
Gets the value of component instance parameter.- Specified by:
getParameterValue
in interfaceSilverpeasComponentInstance
- Parameters:
parameterName
- the name of the parameter.- Returns:
- the value of the parameter, empty string when the parameter does not exist.
-
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.
-
isHidden
public boolean isHidden()
Description copied from interface:SilverpeasComponentInstance
Indicates if the component instance is hidden.- Specified by:
isHidden
in interfaceSilverpeasComponentInstance
- Returns:
- true if hidden, false otherwise.
-
setHidden
public void setHidden(boolean isHidden)
-
isPublic
public boolean isPublic()
Description copied from interface:SilverpeasComponentInstance
Indicates if the component instance is public.- Specified by:
isPublic
in interfaceSilverpeasComponentInstance
- Returns:
- true if public, false otherwise.
-
setPublic
public void setPublic(boolean isPublic)
-
isInheritanceBlocked
public boolean isInheritanceBlocked()
-
setInheritanceBlocked
public void setInheritanceBlocked(boolean isInheritanceBlocked)
-
getCreatorUserId
public String getCreatorUserId()
-
setCreatorUserId
public void setCreatorUserId(String creatorUserId)
-
getCreator
public User getCreator()
Description copied from interface:SilverpeasResource
Gets the user that has created the resource.- Specified by:
getCreator
in interfaceSilverpeasResource
- Returns:
- a
User
in Silverpeas.
-
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 interfaceSilverpeasResource
- Returns:
- a
User
in Silverpeas.
-
getRemover
public User getRemover()
-
removeInheritedProfiles
public void removeInheritedProfiles()
-
isWorkflow
public boolean isWorkflow()
Description copied from interface:SilverpeasComponentInstance
Indicates if the component instance is a workflow one.- Specified by:
isWorkflow
in interfaceSilverpeasComponentInstance
- Returns:
- true if it is a workflow, false otherwise.
-
isTopicTracker
public boolean isTopicTracker()
Description copied from interface:SilverpeasComponentInstance
Indicates if the component instance is a topic tracker.- Specified by:
isTopicTracker
in interfaceSilverpeasComponentInstance
- Returns:
- true if it is a topic tracker, false otherwise.
-
getPermalink
public String getPermalink()
- Specified by:
getPermalink
in interfaceWithPermanentLink
-
getInternalLink
public String getInternalLink()
-
getSilverpeasRolesFor
public Collection<SilverpeasRole> getSilverpeasRolesFor(User user)
Description copied from interface:SilverpeasComponentInstance
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.- Specified by:
getSilverpeasRolesFor
in interfaceSilverpeasComponentInstance
- Parameters:
user
- the user for which the roles are retrieved.- Returns:
- a list of
SilverpeasRole
, empty of no roles.
-
isRemoved
public boolean isRemoved()
Description copied from interface:SilverpeasComponentInstance
Indicates if the component instance is into a REMOVED state.- Specified by:
isRemoved
in interfaceSilverpeasComponentInstance
- Returns:
- true if into removed state, false otherwise.
-
-