Class WorkspaceThreadDAO
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.explorer.threads.actions.ThreadDAO
-
- org.ametys.plugins.workspaces.threads.WorkspaceThreadDAO
-
- All Implemented Interfaces:
PluginAware,Component,Contextualizable,LogEnabled,Serviceable
public class WorkspaceThreadDAO extends ThreadDAO implements PluginAware, Contextualizable
DAO for manipulating thread of a project
-
-
Field Summary
Fields Modifier and Type Field Description static StringROLEAvalon Role-
Fields inherited from class org.ametys.plugins.explorer.threads.actions.ThreadDAO
__RIGHTS_POST_ADD, __RIGHTS_POST_DELETE, __RIGHTS_POST_EDIT, __RIGHTS_THREAD_ADD, __RIGHTS_THREAD_DELETE, __RIGHTS_THREAD_EDIT, _currentUserProvider, _explorerResourcesDAO, _manager, _observationManager, _resolver, _rightManager, _userHelper, _userManager
-
-
Constructor Summary
Constructors Constructor Description WorkspaceThreadDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>addThread(String name, String description)Add a threadvoidcontextualize(Context context)protected StringgetPostContent(JCRPost post)Get the content of a post as a Stringprotected StringgetPostContentForEditing(JCRPost post)Get the content of a post to edit as a StringLonggetThreadsCount(Project project)Get the number of threads in the projectMap<String,Object>getThreadsList(boolean includeChildren)Get the list of threads of a projectvoidservice(ServiceManager manager)voidsetPluginInfo(String pluginName, String featureName, String id)Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.protected voidsetPostContent(JCRPost post, String content)Update the content of a post-
Methods inherited from class org.ametys.plugins.explorer.threads.actions.ThreadDAO
_formatAuthor, _getPostDataFullInfo, _getUserRights, addPost, addThread, canDelete, canEdit, convertPostToString, deletePost, deleteThread, editPost, editThread, getPostData, getPostDataById, getPostsData, getPostsDataByIds, getThreadData, getThreadData, markAsRead, renameThread
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
WorkspaceThreadDAO
public WorkspaceThreadDAO()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classThreadDAO- Throws:
ServiceException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAwareSets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfoin interfacePluginAware- Parameters:
pluginName- Unique identifier for the plugin hosting the extensionfeatureName- Unique feature identifier (unique for a given pluginName)id- Unique identifier of this component
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
getThreadsList
public Map<String,Object> getThreadsList(boolean includeChildren)
Get the list of threads of a project- Parameters:
includeChildren- True to also include threads messages- Returns:
- The list of threads
-
addThread
public Map<String,Object> addThread(String name, String description) throws IllegalAccessException, AmetysRepositoryException
Add a thread- Parameters:
name- The desired name for the threaddescription- The thread description- Returns:
- The result map with id, parentId and name keys
- Throws:
IllegalAccessException- If the user has no sufficient rightsAmetysRepositoryException- If a repository error occurred
-
setPostContent
protected void setPostContent(JCRPost post, String content)
Description copied from class:ThreadDAOUpdate the content of a post- Overrides:
setPostContentin classThreadDAO- Parameters:
post- The post to updatecontent- The content as string
-
getPostContent
protected String getPostContent(JCRPost post) throws AmetysRepositoryException
Description copied from class:ThreadDAOGet the content of a post as a String- Overrides:
getPostContentin classThreadDAO- Parameters:
post- the post- Returns:
- The content as String
- Throws:
AmetysRepositoryException- if failed to parse content
-
getPostContentForEditing
protected String getPostContentForEditing(JCRPost post) throws AmetysRepositoryException
Description copied from class:ThreadDAOGet the content of a post to edit as a String- Overrides:
getPostContentForEditingin classThreadDAO- Parameters:
post- the post- Returns:
- The content as String
- Throws:
AmetysRepositoryException- if failed to parse content
-
getThreadsCount
public Long getThreadsCount(Project project)
Get the number of threads in the project- Parameters:
project- The project- Returns:
- The number of threads, or null if the module is not activated
-
-