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 StringAPPLICATION_IDapplication id for resources collections.private static StringMETADATA_AUTHORprivate static StringMETADATA_CREATIONDATEprivate static StringMETADATA_DESCRIPTIONprivate static StringMETADATA_TITLE
-
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 StringgetApplicationId()Returns the application id corresponding to this Node.UserIdentitygetAuthor()Get the author of the threadDategetCreationDate()Get the thread's creation date.StringgetDescription()Get the description of the applicationStringgetExplorerPath()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.StringgetIconCls()Returns the icon css class for this Node.StringgetTitle()Get the title of the threadlonggetUnreadPosts(UserIdentity user)Get the number of unread post in this thread for a userbooleanhasChildExplorerNodes()Returns true if this explorer node contains child explorer nodes.voidmarkAsRead(UserIdentity user)Mark the thread as read by a uservoidsetAuthor(UserIdentity author)Set the author of this thread.voidsetCreationDate(Date creationDate)Set the thread's creation date.voidsetDescription(String description)Set the description of the applicationvoidsetTitle(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
-
METADATA_TITLE
private static final String METADATA_TITLE
- See Also:
- Constant Field Values
-
METADATA_DESCRIPTION
private static final String METADATA_DESCRIPTION
- See Also:
- Constant Field Values
-
METADATA_AUTHOR
private static final String METADATA_AUTHOR
- See Also:
- Constant Field Values
-
METADATA_CREATIONDATE
private static final String METADATA_CREATIONDATE
- 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:ExplorerNodeReturns the application id corresponding to this Node.- Specified by:
getApplicationIdin interfaceExplorerNode- Returns:
- the application id corresponding to this Node.
-
getTitle
public String getTitle()
Description copied from interface:ThreadGet the title of the thread
-
setTitle
public void setTitle(String title)
Description copied from interface:ModifiableThreadSet the title of this thread.- Specified by:
setTitlein interfaceModifiableThread- Parameters:
title- the thread's title
-
getDescription
public String getDescription()
Description copied from interface:ExplorerNodeGet the description of the application- Specified by:
getDescriptionin interfaceExplorerNode- Returns:
- the description
-
setDescription
public void setDescription(String description)
Description copied from interface:ModifiableExplorerNodeSet the description of the application- Specified by:
setDescriptionin interfaceModifiableExplorerNode- Parameters:
description- the description
-
getAuthor
public UserIdentity getAuthor()
Description copied from interface:ThreadGet the author of the thread
-
setAuthor
public void setAuthor(UserIdentity author)
Description copied from interface:ModifiableThreadSet the author of this thread.- Specified by:
setAuthorin interfaceModifiableThread- Parameters:
author- the author
-
getCreationDate
public Date getCreationDate()
Description copied from interface:ThreadGet the thread's creation date.- Specified by:
getCreationDatein interfaceThread- Returns:
- the thread's creation date.
-
setCreationDate
public void setCreationDate(Date creationDate)
Description copied from interface:ModifiableThreadSet the thread's creation date.- Specified by:
setCreationDatein interfaceModifiableThread- Parameters:
creationDate- the thread's creation date.
-
getIconCls
public String getIconCls()
Description copied from interface:ExplorerNodeReturns the icon css class for this Node.- Specified by:
getIconClsin interfaceExplorerNode- Returns:
- the icon css class for this Node for rendering in the tree.
-
getExplorerPath
public String getExplorerPath()
Description copied from interface:ExplorerNodeReturns 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:
getExplorerPathin interfaceExplorerNode- Returns:
- the path of this node in its hierarchy.
-
hasChildExplorerNodes
public boolean hasChildExplorerNodes() throws AmetysRepositoryException
Description copied from interface:ExplorerNodeReturns true if this explorer node contains child explorer nodes.- Specified by:
hasChildExplorerNodesin 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:ThreadGet the number of unread post in this thread for a user- Specified by:
getUnreadPostsin interfaceThread- Parameters:
user- The user- Returns:
- The number of unread post
-
markAsRead
public void markAsRead(UserIdentity user)
Description copied from interface:ModifiableThreadMark the thread as read by a user- Specified by:
markAsReadin interfaceModifiableThread- Parameters:
user- The user
-
-