Class JCRThread
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<JCRThreadFactory>
-
- org.ametys.plugins.explorer.threads.jcr.JCRThread
-
- All Implemented Interfaces:
ExplorerNode
,ModifiableExplorerNode
,ModifiableThread
,Thread
,ACLAmetysObject
,AmetysObject
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TraversableAmetysObject
public class JCRThread extends DefaultTraversableAmetysObject<JCRThreadFactory> implements ModifiableThread
Default implementation of anThread
, backed by a JCR node.
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_ID
application id for resources collections.
-
Constructor Summary
Constructors Constructor Description JCRThread(Node node, String parentPath, JCRThreadFactory factory)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getApplicationId()
Returns the application id corresponding to this Node.UserIdentity
getAuthor()
Get the author of the threadDate
getCreationDate()
Get the thread's creation date.String
getDescription()
Get the description of the applicationString
getExplorerPath()
Returns the path of this explorer node in the explorer hierarchy (which is a subset of the whole repository).
If this collection is the root explorer node, "" is returned.String
getIconCls()
Returns the icon css class for this Node.String
getTitle()
Get the title of the threadlong
getUnreadPosts(UserIdentity user)
Get the number of unread post in this thread for a userboolean
hasChildExplorerNodes()
Returns true if this explorer node contains child explorer nodes.void
markAsRead(UserIdentity user)
Mark the thread as read by a uservoid
setAuthor(UserIdentity author)
Set the author of this thread.void
setCreationDate(Date creationDate)
Set the thread's creation date.void
setDescription(String description)
Set the description of the applicationvoid
setTitle(String title)
Set the title of this thread.-
Methods inherited from class org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, disallowInheritance, getChild, getChildren, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, hasChild, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
-
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
-
Methods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Methods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolder
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableTraversableAmetysObject
createChild
-
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChild, getChildAt, getChildPosition, getChildren, hasChild
-
-
-
-
Field Detail
-
APPLICATION_ID
public static final String APPLICATION_ID
application id for resources collections.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JCRThread
public JCRThread(Node node, String parentPath, JCRThreadFactory factory)
Constructor- Parameters:
node
- The jcr nodeparentPath
- The parent pathfactory
- The factory
-
-
Method Detail
-
getApplicationId
public String getApplicationId()
Description copied from interface:ExplorerNode
Returns the application id corresponding to this Node.- Specified by:
getApplicationId
in interfaceExplorerNode
- Returns:
- the application id corresponding to this Node.
-
getTitle
public String getTitle()
Description copied from interface:Thread
Get the title of the thread
-
setTitle
public void setTitle(String title)
Description copied from interface:ModifiableThread
Set the title of this thread.- Specified by:
setTitle
in interfaceModifiableThread
- Parameters:
title
- the thread's title
-
getDescription
public String getDescription()
Description copied from interface:ExplorerNode
Get the description of the application- Specified by:
getDescription
in interfaceExplorerNode
- Returns:
- the description
-
setDescription
public void setDescription(String description)
Description copied from interface:ModifiableExplorerNode
Set the description of the application- Specified by:
setDescription
in interfaceModifiableExplorerNode
- Parameters:
description
- the description
-
getAuthor
public UserIdentity getAuthor()
Description copied from interface:Thread
Get the author of the thread
-
setAuthor
public void setAuthor(UserIdentity author)
Description copied from interface:ModifiableThread
Set the author of this thread.- Specified by:
setAuthor
in interfaceModifiableThread
- Parameters:
author
- the author
-
getCreationDate
public Date getCreationDate()
Description copied from interface:Thread
Get the thread's creation date.- Specified by:
getCreationDate
in interfaceThread
- Returns:
- the thread's creation date.
-
setCreationDate
public void setCreationDate(Date creationDate)
Description copied from interface:ModifiableThread
Set the thread's creation date.- Specified by:
setCreationDate
in interfaceModifiableThread
- Parameters:
creationDate
- the thread's creation date.
-
getIconCls
public String getIconCls()
Description copied from interface:ExplorerNode
Returns the icon css class for this Node.- Specified by:
getIconCls
in interfaceExplorerNode
- Returns:
- the icon css class for this Node for rendering in the tree.
-
getExplorerPath
public String getExplorerPath()
Description copied from interface:ExplorerNode
Returns the path of this explorer node in the explorer hierarchy (which is a subset of the whole repository).
If this collection is the root explorer node, "" is returned.- Specified by:
getExplorerPath
in interfaceExplorerNode
- Returns:
- the path of this node in its hierarchy.
-
hasChildExplorerNodes
public boolean hasChildExplorerNodes() throws AmetysRepositoryException
Description copied from interface:ExplorerNode
Returns true if this explorer node contains child explorer nodes.- Specified by:
hasChildExplorerNodes
in interfaceExplorerNode
- Returns:
- true if this explorer node contains child explorer nodes.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getUnreadPosts
public long getUnreadPosts(UserIdentity user)
Description copied from interface:Thread
Get the number of unread post in this thread for a user- Specified by:
getUnreadPosts
in interfaceThread
- Parameters:
user
- The user- Returns:
- The number of unread post
-
markAsRead
public void markAsRead(UserIdentity user)
Description copied from interface:ModifiableThread
Mark the thread as read by a user- Specified by:
markAsRead
in interfaceModifiableThread
- Parameters:
user
- The user
-
-