Class ComponentInstLight
- java.lang.Object
-
- org.silverpeas.core.i18n.AbstractI18NBean<ComponentI18N>
-
- org.silverpeas.core.admin.component.model.ComponentInstLight
-
- All Implemented Interfaces:
Serializable
,SilverpeasComponentInstance
,SilverpeasSharedComponentInstance
,I18NBean<ComponentI18N>
,LocalizedResource
,Translatable
,Identifiable
,Nameable
,Securable
,SilverpeasResource
public class ComponentInstLight extends AbstractI18NBean<ComponentI18N> implements SilverpeasSharedComponentInstance
The class ComponentInstLight is the representation in memory of a component instance- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ComponentInstLight()
ConstructorComponentInstLight(ComponentInstanceRow compo)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getCreatedBy()
Date
getCreationDate()
Gets the date at which the resource has been created.User
getCreator()
Gets the user that has created the resource.String
getCreatorName()
String
getDomainFatherId()
Get the domain father idString
getIcon(boolean bigOne)
static String
getIcon(SilverpeasComponentInstance instance, boolean bigOne)
String
getId()
Gets the unique identifier of the object in Silverpeas.BasicIdentifier
getIdentifier()
Gets the unique identifier of this resource.String
getLabel()
Get the component typeString
getLabel(String language)
I18NDate
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()
Get the component name This method is a hack (technical debt)int
getOrderNum()
int
getOrderPosition()
Gets the position index of the component against the others into a space.String
getParameterValue(String parameterName)
Gets the value of component instance parameter.String
getPath(String separator)
Date
getRemovalDate()
int
getRemovedBy()
String
getRemoverName()
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()
int
getUpdatedBy()
String
getUpdaterName()
boolean
hasDomainFather()
Has this component instance a domain father?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
setCreatorName(String creatorName)
void
setDomainFatherId(String sDomainFatherId)
Set the domain father idvoid
setInheritanceBlocked(boolean isInheritanceBlocked)
void
setLabel(String label)
void
setLocalId(int id)
void
setName(String name)
This method is a hack (technical debt)void
setOrderNum(int orderNum)
void
setRemoverName(String removerName)
void
setStatus(String status)
void
setUpdaterName(String updaterName)
-
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
-
-
-
-
Constructor Detail
-
ComponentInstLight
public ComponentInstLight()
Constructor
-
ComponentInstLight
public ComponentInstLight(ComponentInstanceRow compo)
Constructor
-
-
Method Detail
-
getTranslationType
protected Class<ComponentI18N> getTranslationType()
- Specified by:
getTranslationType
in classAbstractI18NBean<ComponentI18N>
-
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.
-
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.
-
getLocalId
public int getLocalId()
-
setLocalId
public void setLocalId(int id)
-
setDomainFatherId
public void setDomainFatherId(String sDomainFatherId)
Set the domain father id
-
getDomainFatherId
public String getDomainFatherId()
Get the domain father id- Returns:
- the component instance father id. If the component instance has no father, returns an empty string.
-
hasDomainFather
public boolean hasDomainFather()
Has this component instance a domain father? In the case of a component instance, a domain father is a space. For example, a component instance has no domain father when it belongs to the user's personal space.- Returns:
- true if this component has a domain father, false otherwise.
-
getName
public String getName()
Get the component name This method is a hack (technical debt)- Specified by:
getName
in interfaceNameable
- Specified by:
getName
in interfaceSilverpeasComponentInstance
- Overrides:
getName
in classAbstractI18NBean<ComponentI18N>
- Returns:
- the component name
-
getLabel
public String getLabel()
Get the component type- Specified by:
getLabel
in interfaceSilverpeasComponentInstance
- Returns:
- the component type
-
setLabel
public void setLabel(String label)
-
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.
-
getRemovalDate
public Date getRemovalDate()
-
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.
-
getCreatorName
public String getCreatorName()
-
setCreatorName
public void setCreatorName(String creatorName)
-
getRemoverName
public String getRemoverName()
-
setRemoverName
public void setRemoverName(String removerName)
-
getUpdaterName
public String getUpdaterName()
-
setUpdaterName
public void setUpdaterName(String updaterName)
-
getCreatedBy
public int getCreatedBy()
-
getRemovedBy
public int getRemovedBy()
-
getUpdatedBy
public int getUpdatedBy()
-
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.
-
getLabel
public String getLabel(String language)
I18N- Specified by:
getLabel
in interfaceSilverpeasComponentInstance
- Returns:
- the translated name of the component.
-
setName
public void setName(String name)
This method is a hack (technical debt)- Overrides:
setName
in classAbstractI18NBean<ComponentI18N>
- Parameters:
name
- the name of the component.
-
setOrderNum
public void setOrderNum(int orderNum)
-
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.
-
isInheritanceBlocked
public boolean isInheritanceBlocked()
-
setInheritanceBlocked
public void setInheritanceBlocked(boolean isInheritanceBlocked)
-
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.
-
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.
-
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.
-
getIcon
public String getIcon(boolean bigOne)
-
getIcon
public static String getIcon(SilverpeasComponentInstance instance, boolean bigOne)
-
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.
-
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.
-
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.
-
-