Package org.silverpeas.core.node.model
Class NodeDetail
- java.lang.Object
-
- org.silverpeas.core.i18n.AbstractI18NBean<NodeI18NDetail>
-
- org.silverpeas.core.node.model.NodeDetail
-
- All Implemented Interfaces:
Serializable
,Contribution
,Folder
,I18nContribution
,WithPermanentLink
,I18NBean<NodeI18NDetail>
,LocalizedResource
,Translatable
,Identifiable
,Instance<Contribution>
,Nameable
,Securable
,SilverpeasResource
public class NodeDetail extends AbstractI18NBean<NodeI18NDetail> implements Identifiable, I18nContribution, Folder, Serializable, Securable, WithPermanentLink
This object contains the description of a node (own attributes and children attributes)- Version:
- 1.0
- Author:
- Nicolas Eysseric
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_NODE_TYPE
static String
FILE_LINK_TYPE
static String
NO_RIGHTS_DEPENDENCY
static String
STATUS_INVISIBLE
static String
STATUS_VISIBLE
static String
TYPE
-
Constructor Summary
Constructors Constructor Description NodeDetail()
Construct an empty NodeDetailNodeDetail(String id, String name, String description, int level, String fatherId)
Create a new NodeDetailNodeDetail(NodeDetail other)
Copy constructor of persisted entity, all data are deeply copied and id is set to "unknown" value.NodeDetail(NodePK pk, String name, String description, int level, String fatherId)
Create a new NodeDetail
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeAccessedBy(User user)
Is the specified user can access this node?boolean
canBeFiledInBy(User user)
Is the specified user can file into this node a contribution (either another node or a different kind of contributions supported by the underlying application)?boolean
canBeModifiedBy(User user)
Checks the given user can modify this resource.boolean
canBeSharedBy(User user)
boolean
equals(Object other)
Collection<NodeDetail>
getChildrenDetails()
Get the details of each childint
getChildrenNumber()
Get the number of children of the nodeString
getContributionType()
Gets the type of this contribution.Date
getCreationDate()
Get the creation dateUser
getCreator()
Gets the user that has created the resource.String
getCreatorId()
Get the creator idNodePK
getFatherPK()
Get the NodePK of the fatherString
getFullPath()
String
getId()
Gets the unique identifier of the object in Silverpeas.ContributionIdentifier
getIdentifier()
Gets the unique identifier of this contribution.Date
getLastUpdateDate()
No modification is traced for nodes.User
getLastUpdater()
No modification is traced for nodes.int
getLevel()
Get the levelString
getLink()
int
getLocalId()
String
getModelId()
Get the modelIdint
getNbObjects()
NodePK
getNodePK()
Get the NodePKString
getNodeType()
int
getOrder()
String
getPath()
Get the pathString
getPermalink()
String
getRightsDependsOn()
String
getStatus()
Get the statusprotected Class<NodeI18NDetail>
getTranslationType()
String
getURL()
String
getUserRole()
boolean
hasFather()
int
hashCode()
boolean
haveInheritedRights()
boolean
haveLocalRights()
boolean
haveRights()
boolean
isBin()
Is this node a bin of contributions?boolean
isChild()
Is this node a child of another node?boolean
isFatherOf(NodeDetail node)
boolean
isRoot()
Is this node the root of a tree of nodes?boolean
isUnclassified()
Is this node the one containing unclassified contributions?boolean
isUseId()
void
setChildrenDetails(Collection<NodeDetail> childrenDetails)
Set the details of childrenvoid
setCreationDate(Date date)
Set the creation datevoid
setCreatorId(String creatorId)
Set the creator idvoid
setFatherPK(NodePK fatherPK)
Set the father of the nodevoid
setId(int id)
Méthode nécéssaire au marshalling JAXBvoid
setLevel(int level)
Set the levelvoid
setModelId(String modelId)
Set the modelIdvoid
setNbObjects(int nbObjects)
void
setNodePK(NodePK nodePK)
void
setNodeType(String nodeType)
void
setOrder(int order)
void
setPath(String path)
Set the pathvoid
setRightsDependsOn(String rightsDependsOn)
void
setRightsDependsOnMe()
void
setStatus(String status)
Set the statusvoid
setUseId(boolean useId)
void
setUserRole(String userRole)
String
toString()
Converts the contents of the key into a readable String.-
Methods inherited from class org.silverpeas.core.i18n.AbstractI18NBean
addTranslation, getClonedTranslations, getDescription, getDescription, getLanguage, getLanguages, getLanguageToDisplay, getName, 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, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.contribution.model.Contribution
getDescription, getModel, getName, getResourcePath, getTitle, isIndexable
-
Methods inherited from interface org.silverpeas.core.contribution.model.I18nContribution
getLocalizationIn
-
Methods inherited from interface org.silverpeas.core.i18n.LocalizedResource
getTranslation
-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeDeletedBy
-
-
-
-
Field Detail
-
DEFAULT_NODE_TYPE
public static final String DEFAULT_NODE_TYPE
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
FILE_LINK_TYPE
public static final String FILE_LINK_TYPE
- See Also:
- Constant Field Values
-
STATUS_VISIBLE
public static final String STATUS_VISIBLE
- See Also:
- Constant Field Values
-
STATUS_INVISIBLE
public static final String STATUS_INVISIBLE
- See Also:
- Constant Field Values
-
NO_RIGHTS_DEPENDENCY
public static final String NO_RIGHTS_DEPENDENCY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NodeDetail
public NodeDetail(NodeDetail other)
Copy constructor of persisted entity, all data are deeply copied and id is set to "unknown" value.- Parameters:
other
- the instance to copy.
-
NodeDetail
public NodeDetail()
Construct an empty NodeDetail- Since:
- 1.0
-
NodeDetail
public NodeDetail(String id, String name, String description, int level, String fatherId)
Create a new NodeDetail- Parameters:
id
- id of the nodename
- The node namedescription
- The node descriptionlevel
- The node level (root level = 1)fatherId
- The id of the father
-
-
Method Detail
-
getTranslationType
protected Class<NodeI18NDetail> getTranslationType()
- Specified by:
getTranslationType
in classAbstractI18NBean<NodeI18NDetail>
-
getNodePK
public NodePK getNodePK()
Get the NodePK- Returns:
- The NodePK
- Since:
- 1.0
-
setNodePK
public void setNodePK(NodePK nodePK)
-
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.
-
getLocalId
public int getLocalId()
-
getContributionType
public String getContributionType()
Description copied from interface:Contribution
Gets the type of this contribution. The type is a label that identifies uniquely a kind of contribution handled by a Silverpeas application. By default, this method returns the simple name of the class implementing this interface.- Specified by:
getContributionType
in interfaceContribution
- Returns:
- the label of the type of this contribution.
-
isRoot
public boolean isRoot()
Is this node the root of a tree of nodes?
-
isBin
public boolean isBin()
Is this node a bin of contributions?
-
isUnclassified
public boolean isUnclassified()
Is this node the one containing unclassified contributions?- Specified by:
isUnclassified
in interfaceFolder
- Returns:
- true if the node isn't yet classified among other nodes. False otherwise.
-
isChild
public boolean isChild()
Is this node a child of another node? A node is a child of another node if the following conditions are satisfied:- the node isn't the root one,
- the node isn't a bin,
- the node isn't unclassified (orphaned).
-
getIdentifier
public ContributionIdentifier getIdentifier()
Description copied from interface:I18nContribution
Gets the unique identifier of this contribution.- Specified by:
getIdentifier
in interfaceContribution
- Specified by:
getIdentifier
in interfaceI18nContribution
- Specified by:
getIdentifier
in interfaceSilverpeasResource
- Returns:
- the unique identifier of the contribution.
-
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.
-
getCreationDate
public Date getCreationDate()
Get the creation date- Specified by:
getCreationDate
in interfaceSilverpeasResource
- Returns:
- the creation date
- Since:
- 1.0
-
getLastUpdater
public User getLastUpdater()
No modification is traced for nodes. Returns the creator.- Specified by:
getLastUpdater
in interfaceSilverpeasResource
- Returns:
- the creator of the node
-
getLastUpdateDate
public Date getLastUpdateDate()
No modification is traced for nodes. Returns the date of this node creation.- Specified by:
getLastUpdateDate
in interfaceSilverpeasResource
- Returns:
- the creation date.
-
getCreatorId
public String getCreatorId()
Get the creator id- Returns:
- the creator identifier
- Since:
- 1.0
-
getPath
public String getPath()
Get the path- Returns:
- the path
- Since:
- 1.0
-
getLevel
public int getLevel()
Get the level- Returns:
- the level
- Since:
- 1.0
-
getModelId
public String getModelId()
Get the modelId- Returns:
- the modelId
-
getStatus
public String getStatus()
Get the status- Returns:
- the status
-
getFatherPK
public NodePK getFatherPK()
Get the NodePK of the father- Returns:
- the NodePK of the father
- Since:
- 1.0
-
getChildrenDetails
public Collection<NodeDetail> getChildrenDetails()
Get the details of each child- Returns:
- A collection of NodeDetail
- Since:
- 1.0
- See Also:
NodeDetail
-
setCreationDate
public void setCreationDate(Date date)
Set the creation date- Parameters:
date
- A string representing a date- Since:
- 1.0
-
setCreatorId
public void setCreatorId(String creatorId)
Set the creator id- Parameters:
creatorId
- The creator id- Since:
- 1.0
-
setModelId
public void setModelId(String modelId)
Set the modelId- Parameters:
modelId
- the modelId of the node
-
setStatus
public void setStatus(String status)
Set the status- Parameters:
status
- the status of the node
-
setChildrenDetails
public void setChildrenDetails(Collection<NodeDetail> childrenDetails)
Set the details of children- Parameters:
childrenDetails
- a NodeDetail Collection- Since:
- 1.0
-
setFatherPK
public void setFatherPK(NodePK fatherPK)
Set the father of the node- Parameters:
fatherPK
- the nodePK of the father- Since:
- 1.0
-
setId
public void setId(int id)
Méthode nécéssaire au marshalling JAXB- Parameters:
id
-
-
setPath
public void setPath(String path)
Set the path- Parameters:
path
- the path of the node- Since:
- 1.0
-
setLevel
public void setLevel(int level)
Set the level- Parameters:
level
- the level of the node- Since:
- 1.0
-
getChildrenNumber
public int getChildrenNumber()
Get the number of children of the node- Returns:
- the number of children of the node
- Since:
- 1.0
-
getOrder
public int getOrder()
-
setOrder
public void setOrder(int order)
-
toString
public String toString()
Converts the contents of the key into a readable String.
-
getNodeType
public String getNodeType()
-
setNodeType
public void setNodeType(String nodeType)
-
getURL
public String getURL()
-
getLink
public String getLink()
-
getPermalink
public String getPermalink()
- Specified by:
getPermalink
in interfaceWithPermanentLink
-
getNbObjects
public int getNbObjects()
-
setNbObjects
public void setNbObjects(int nbObjects)
-
getRightsDependsOn
public String getRightsDependsOn()
-
setRightsDependsOn
public void setRightsDependsOn(String rightsDependsOn)
-
setRightsDependsOnMe
public void setRightsDependsOnMe()
-
haveLocalRights
public boolean haveLocalRights()
-
haveInheritedRights
public boolean haveInheritedRights()
-
haveRights
public boolean haveRights()
-
getUserRole
public String getUserRole()
-
setUserRole
public void setUserRole(String userRole)
-
isUseId
public boolean isUseId()
-
hasFather
public boolean hasFather()
-
setUseId
public void setUseId(boolean useId)
-
getFullPath
public String getFullPath()
-
isFatherOf
public boolean isFatherOf(NodeDetail node)
-
canBeAccessedBy
public boolean canBeAccessedBy(User user)
Is the specified user can access this node?- Specified by:
canBeAccessedBy
in interfaceContribution
- Specified by:
canBeAccessedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can access this node, false otherwise.
-
canBeModifiedBy
public boolean canBeModifiedBy(User user)
Description copied from interface:Securable
Checks the given user can modify this resource. By default, if the user can access this securable resource, then it can also modify it.- Specified by:
canBeModifiedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can modify the data managed by this instance, false otherwise.
-
canBeFiledInBy
public boolean canBeFiledInBy(User user)
Is the specified user can file into this node a contribution (either another node or a different kind of contributions supported by the underlying application)?- Specified by:
canBeFiledInBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user has at least the role of writer for this node.
-
canBeSharedBy
public boolean canBeSharedBy(User user)
-
-