Package org.silverpeas.core.admin.space
Class SpaceInst
- java.lang.Object
-
- org.silverpeas.core.i18n.AbstractI18NBean<SpaceI18N>
-
- org.silverpeas.core.admin.space.SpaceInst
-
- All Implemented Interfaces:
Serializable
,WithPermanentLink
,I18NBean<SpaceI18N>
,LocalizedResource
,Translatable
,Identifiable
,Nameable
,Securable
,SilverpeasResource
public class SpaceInst extends AbstractI18NBean<SpaceI18N> implements Serializable, Identifiable, Securable, LocalizedResource, WithPermanentLink
The class SpaceInst is the representation in memory of a space- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_SPACE_ID
static int
FP_TYPE_COMPONENT_INST
static int
FP_TYPE_HTML_PAGE
static int
FP_TYPE_PORTLET
static int
FP_TYPE_STANDARD
static String
PERSONAL_SPACE_ID
static String
QUOTA_COMPONENT_PREFIX_KEY
static String
QUOTA_COMPONENT_REACHED_PREFIX_KEY
static String
QUOTA_STORAGE_PREFIX_KEY
static String
QUOTA_STORAGE_REACHED_PREFIX_KEY
static String
SPACE_KEY_PREFIX
static String
STATUS_REMOVED
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComponentInst(ComponentInst componentInst)
Add a component in component list (WARNING : component will not be added in database, only in that spaceInst object !!!)void
addSpaceProfileInst(SpaceProfileInst spaceProfileInst)
Add a space profile in space profile list (WARNING : space profile will not be added in database, only in that spaceInst object !!!)boolean
canBeAccessedBy(User user)
Checks the given user can access this resource.boolean
canBeFiledInBy(User user)
Can the user add spaces or component instances into this space?boolean
canBeModifiedBy(User user)
Is the user can modify this collaboration space?void
clearComponentSpaceQuotaCache()
void
clearDataStorageQuotaCache()
void
copyDataFrom(SpaceInst other)
void
deleteComponentInst(ComponentInst componentInst)
Remove a component from component list (WARNING : component will not be removed from database, only in that spaceInst object !!!)void
deleteSpaceProfileInst(SpaceProfileInst spaceProfileInst)
Remove a space profile from space profile list (WARNING : space profile will not be removed from database, only from that spaceInst object !!!)boolean
equals(Object obj)
List<SilverpeasComponentInstance>
getAllComponentInstances()
Get allSilverpeasComponentInstance
of the given space.List<ComponentInst>
getAllComponentsInst()
Get all the components in that space.List<SpaceProfileInst>
getAllSpaceProfilesInst()
Get all the user profiles defined for this space instance.Quota
getComponentSpaceQuota()
String
getComponentSpaceQuotaReachedErrorMessage(String language)
Gets the error message about reached quota space of this component's father.Date
getCreationDate()
Gets the date at which the resource has been created.User
getCreator()
Gets the user that has created the resource.String
getCreatorUserId()
Get the space creator idQuota
getDataStorageQuota()
String
getDataStorageQuotaReachedErrorMessage(String language)
Gets the error message about data storage space quota reached.String
getDomainFatherId()
Get the domain father idString
getFirstPageExtraParam()
Get the space first page extra parameterint
getFirstPageType()
Get the space first page typeString
getId()
Get the absolute space idBasicIdentifier
getIdentifier()
Gets the unique identifier of this resource.List<SpaceProfileInst>
getInheritedProfiles()
SpaceProfileInst
getInheritedSpaceProfileInst(String sSpaceProfileName)
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
getLevel()
int
getLocalId()
String
getLook()
String
getName(String language)
Gets the name of the bean in the given language.int
getOrderNum()
Get the space relative order numString
getPermalink()
List<SpaceProfileInst>
getProfiles()
Gets the specific right profiles of this space instance (that is to say all the non-inherited profiles)Date
getRemovalDate()
User
getRemover()
String
getRemoverUserId()
SpaceProfileInst
getSpaceProfileInst(String sSpaceProfileName)
Get a space profile from space profiles list, given its name (WARNING : if more than one space profile match the given name, the first one will be returned)String
getStatus()
List<SpaceInst>
getSubSpaces()
protected Class<SpaceI18N>
getTranslationType()
String
getUpdaterUserId()
int
hashCode()
boolean
isComponentSpaceQuotaReached()
Indicates if the quota of the space or of a parent space is reached.boolean
isDataStorageQuotaReached()
Indicates if the quota of the space or of a parent space is reached.boolean
isDisplaySpaceFirst()
boolean
isInheritanceBlocked()
boolean
isPersonalSpace()
boolean
isRemoved()
boolean
isRoot()
void
resetData()
void
setComponentSpaceQuotaMaxCount(long componentSpaceQuotaMaxCount)
Sets the max count of component space of the spacevoid
setCreationDate(Date createDate)
void
setCreatorUserId(String sCreatorUserId)
Set the space creator idvoid
setData(List<SpaceProfileInst> profiles, List<String> subSpaceIds, List<String> componentIds)
void
setDataStorageQuotaMaxCount(long dataStorageQuotaMaxCount)
Sets the max count of data storage of the spacevoid
setDisplaySpaceFirst(boolean isDisplaySpaceFirst)
void
setDomainFatherId(String sDomainFatherId)
Set the space father idvoid
setFirstPageExtraParam(String sFirstPageExtraParam)
Set the space first page extra parametervoid
setFirstPageType(int iFirstPageType)
Set the space first page typevoid
setInheritanceBlocked(boolean isInheritanceBlocked)
void
setLastUpdate(Date updateDate)
void
setLevel(int level)
void
setLocalId(int id)
Set the space local idvoid
setLook(String look)
void
setOrderNum(int iOrderNum)
Set the space relative order numvoid
setPersonalSpace(boolean isPersonalSpace)
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, setName, 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.Nameable
getDescription, getName
-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeDeletedBy
-
-
-
-
Field Detail
-
SPACE_KEY_PREFIX
public static final String SPACE_KEY_PREFIX
- See Also:
- Constant Field Values
-
PERSONAL_SPACE_ID
public static final String PERSONAL_SPACE_ID
- See Also:
- Constant Field Values
-
DEFAULT_SPACE_ID
public static final String DEFAULT_SPACE_ID
- See Also:
- Constant Field Values
-
FP_TYPE_STANDARD
public static final int FP_TYPE_STANDARD
-
FP_TYPE_COMPONENT_INST
public static final int FP_TYPE_COMPONENT_INST
-
FP_TYPE_PORTLET
public static final int FP_TYPE_PORTLET
-
FP_TYPE_HTML_PAGE
public static final int FP_TYPE_HTML_PAGE
-
STATUS_REMOVED
public static final String STATUS_REMOVED
- See Also:
- Constant Field Values
-
QUOTA_STORAGE_PREFIX_KEY
public static final String QUOTA_STORAGE_PREFIX_KEY
-
QUOTA_STORAGE_REACHED_PREFIX_KEY
public static final String QUOTA_STORAGE_REACHED_PREFIX_KEY
-
QUOTA_COMPONENT_PREFIX_KEY
public static final String QUOTA_COMPONENT_PREFIX_KEY
-
QUOTA_COMPONENT_REACHED_PREFIX_KEY
public static final String QUOTA_COMPONENT_REACHED_PREFIX_KEY
-
-
Constructor Detail
-
SpaceInst
public SpaceInst()
Constructor
-
SpaceInst
public SpaceInst(SpaceInst si)
Constructs a new collaboration space by copying the specified one. Only the identifier isn't copied as it should be unique.- Parameters:
si
- the collaboration space to copy.
-
-
Method Detail
-
getTranslationType
protected Class<SpaceI18N> getTranslationType()
- Specified by:
getTranslationType
in classAbstractI18NBean<SpaceI18N>
-
getIdentifier
public BasicIdentifier getIdentifier()
Description copied from interface:SilverpeasResource
Gets the unique identifier of this resource.- Specified by:
getIdentifier
in interfaceSilverpeasResource
- Returns:
- the
ResourceIdentifier
object representing the unique identifier of the resource.
-
setLocalId
public void setLocalId(int id)
Set the space local id- Parameters:
id
- new space local id
-
getLocalId
public int getLocalId()
-
getId
public String getId()
Get the absolute space id- Specified by:
getId
in interfaceIdentifiable
- Returns:
- the requested space id
-
setDomainFatherId
public void setDomainFatherId(String sDomainFatherId)
Set the space father id- Parameters:
sDomainFatherId
- The space father id
-
getDomainFatherId
public String getDomainFatherId()
Get the domain father id- Returns:
- the space father id. If space has no father, returns an empty string.
-
getName
public String getName(String language)
Description copied from class:AbstractI18NBean
Gets the name of the bean in the given language. This method is a shortcut of the following code:myBean.getTranslation(language).getName();
- Overrides:
getName
in classAbstractI18NBean<SpaceI18N>
- Parameters:
language
- the ISO 631-1 code of the language- Returns:
- the name of the bean in the specified language.
-
setCreatorUserId
public void setCreatorUserId(String sCreatorUserId)
Set the space creator id- Parameters:
sCreatorUserId
- The user id of person who created the space
-
getCreatorUserId
public String getCreatorUserId()
Get the space creator id- Returns:
- The user id of person who created the space
-
setFirstPageType
public void setFirstPageType(int iFirstPageType)
Set the space first page type- Parameters:
iFirstPageType
- type of the home page of the space.
-
getFirstPageType
public int getFirstPageType()
Get the space first page type- Returns:
- The space first page type
-
setOrderNum
public void setOrderNum(int iOrderNum)
Set the space relative order num- Parameters:
iOrderNum
- the order of the space relative to others
-
getOrderNum
public int getOrderNum()
Get the space relative order num- Returns:
- the order of the space relative to the others spaces.
-
setFirstPageExtraParam
public void setFirstPageExtraParam(String sFirstPageExtraParam)
Set the space first page extra parameter- Parameters:
sFirstPageExtraParam
- parameters to pass to the home page of the space.
-
getFirstPageExtraParam
public String getFirstPageExtraParam()
Get the space first page extra parameter- Returns:
- The space first page extra parameter
-
copyDataFrom
public void copyDataFrom(SpaceInst other)
-
setData
public void setData(List<SpaceProfileInst> profiles, List<String> subSpaceIds, List<String> componentIds)
-
resetData
public void resetData()
-
addComponentInst
public void addComponentInst(ComponentInst componentInst)
Add a component in component list (WARNING : component will not be added in database, only in that spaceInst object !!!)- Parameters:
componentInst
- component instance to be added
-
deleteComponentInst
public void deleteComponentInst(ComponentInst componentInst)
Remove a component from component list (WARNING : component will not be removed from database, only in that spaceInst object !!!)- Parameters:
componentInst
- component instance to be removed
-
getAllComponentsInst
public List<ComponentInst> getAllComponentsInst()
Get all the components in that space.This method handles only
SilverpeasSharedComponentInstance
instances.To get also
SilverpeasPersonalComponentInstance
, please usegetAllComponentInstances()
- Returns:
- The components in that space
-
getAllComponentInstances
public List<SilverpeasComponentInstance> getAllComponentInstances()
Get allSilverpeasComponentInstance
of the given space.- Returns:
- a list of
SilverpeasComponentInstance
which could be empty but never null.
-
addSpaceProfileInst
public void addSpaceProfileInst(SpaceProfileInst spaceProfileInst)
Add a space profile in space profile list (WARNING : space profile will not be added in database, only in that spaceInst object !!!)- Parameters:
spaceProfileInst
- space profile to be added
-
deleteSpaceProfileInst
public void deleteSpaceProfileInst(SpaceProfileInst spaceProfileInst)
Remove a space profile from space profile list (WARNING : space profile will not be removed from database, only from that spaceInst object !!!)- Parameters:
spaceProfileInst
- space profile to be removed
-
getAllSpaceProfilesInst
public List<SpaceProfileInst> getAllSpaceProfilesInst()
Get all the user profiles defined for this space instance.- Returns:
- an unmodifiable list of user profiles for this space instance.
-
getSpaceProfileInst
public SpaceProfileInst getSpaceProfileInst(String sSpaceProfileName)
Get a space profile from space profiles list, given its name (WARNING : if more than one space profile match the given name, the first one will be returned)- Parameters:
sSpaceProfileName
- name of requested space profile
-
getInheritedSpaceProfileInst
public SpaceProfileInst getInheritedSpaceProfileInst(String sSpaceProfileName)
-
getInheritedProfiles
public List<SpaceProfileInst> getInheritedProfiles()
-
getProfiles
public List<SpaceProfileInst> getProfiles()
Gets the specific right profiles of this space instance (that is to say all the non-inherited profiles)- Returns:
- the specific right profiles of this space instance;
-
setLevel
public void setLevel(int level)
-
getLevel
public int getLevel()
-
isRoot
public boolean isRoot()
-
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.
-
setLastUpdate
public void setLastUpdate(Date updateDate)
-
getRemoverUserId
public String getRemoverUserId()
-
setRemoverUserId
public void setRemoverUserId(String removerUserId)
-
getUpdaterUserId
public String getUpdaterUserId()
-
setUpdaterUserId
public void setUpdaterUserId(String updaterUserId)
-
isInheritanceBlocked
public boolean isInheritanceBlocked()
-
setInheritanceBlocked
public void setInheritanceBlocked(boolean isInheritanceBlocked)
-
getLook
public String getLook()
-
setLook
public void setLook(String look)
-
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()
-
isDisplaySpaceFirst
public boolean isDisplaySpaceFirst()
-
setDisplaySpaceFirst
public void setDisplaySpaceFirst(boolean isDisplaySpaceFirst)
-
setPersonalSpace
public void setPersonalSpace(boolean isPersonalSpace)
-
isPersonalSpace
public boolean isPersonalSpace()
-
getComponentSpaceQuota
public Quota getComponentSpaceQuota()
- Returns:
- the componentSpaceQuota
-
clearComponentSpaceQuotaCache
public void clearComponentSpaceQuotaCache()
-
setComponentSpaceQuotaMaxCount
public void setComponentSpaceQuotaMaxCount(long componentSpaceQuotaMaxCount) throws QuotaException
Sets the max count of component space of the space- Throws:
QuotaException
-
isComponentSpaceQuotaReached
public boolean isComponentSpaceQuotaReached()
Indicates if the quota of the space or of a parent space is reached.- Returns:
- true if the quota in storage space of the parent of this component instance is reached. False otherwise.
-
getComponentSpaceQuotaReachedErrorMessage
public String getComponentSpaceQuotaReachedErrorMessage(String language)
Gets the error message about reached quota space of this component's father.- Parameters:
language
- an ISO 631-1 code of the language.- Returns:
- a localized error message to indicate a storage space quota is reached.
-
getDataStorageQuota
public Quota getDataStorageQuota()
- Returns:
- the dataStorageQuota
-
clearDataStorageQuotaCache
public void clearDataStorageQuotaCache()
-
setDataStorageQuotaMaxCount
public void setDataStorageQuotaMaxCount(long dataStorageQuotaMaxCount) throws QuotaException
Sets the max count of data storage of the space- Throws:
QuotaException
-
isDataStorageQuotaReached
public boolean isDataStorageQuotaReached()
Indicates if the quota of the space or of a parent space is reached.- Returns:
- true if the storage space is reached for this component instance. False otherwise.
-
getDataStorageQuotaReachedErrorMessage
public String getDataStorageQuotaReachedErrorMessage(String language)
Gets the error message about data storage space quota reached.- Parameters:
language
- the ISO 631-1 code of the language.- Returns:
- the localized error message for a reach storage quota space for a component instance.
-
getPermalink
public String getPermalink()
- Specified by:
getPermalink
in interfaceWithPermanentLink
-
isRemoved
public boolean isRemoved()
-
canBeAccessedBy
public boolean canBeAccessedBy(User user)
Description copied from interface:Securable
Checks the given user can access this resource.- Specified by:
canBeAccessedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can access the data managed by this instance, false otherwise.
-
canBeModifiedBy
public boolean canBeModifiedBy(User user)
Is the user can modify this collaboration space?- Specified by:
canBeModifiedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can both access this collaboration space and has management privilege on this space (by being either an administrator or a space manager)
-
canBeFiledInBy
public boolean canBeFiledInBy(User user)
Can the user add spaces or component instances into this space?- Specified by:
canBeFiledInBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if he can, false otherwise.
- See Also:
Securable.canBeFiledInBy(User)
-
-