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 String
ROLE
Avalon 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 threadvoid
contextualize(Context context)
protected String
getPostContent(JCRPost post)
Get the content of a post as a Stringprotected String
getPostContentForEditing(JCRPost post)
Get the content of a post to edit as a StringLong
getThreadsCount(Project project)
Get the number of threads in the projectMap<String,Object>
getThreadsList(boolean includeChildren)
Get the list of threads of a projectvoid
service(ServiceManager manager)
void
setPluginInfo(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 void
setPostContent(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:
service
in interfaceServiceable
- Overrides:
service
in classThreadDAO
- Throws:
ServiceException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAware
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.- Specified by:
setPluginInfo
in 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:
contextualize
in 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:ThreadDAO
Update the content of a post- Overrides:
setPostContent
in classThreadDAO
- Parameters:
post
- The post to updatecontent
- The content as string
-
getPostContent
protected String getPostContent(JCRPost post) throws AmetysRepositoryException
Description copied from class:ThreadDAO
Get the content of a post as a String- Overrides:
getPostContent
in 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:ThreadDAO
Get the content of a post to edit as a String- Overrides:
getPostContentForEditing
in 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
-
-