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
DAO for manipulating thread of a project
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionAdd a threadvoid
contextualize
(Context context) protected String
getPostContent
(JCRPost post) Get the content of a post as a Stringprotected String
Get the content of a post to edit as a StringgetThreadsCount
(Project project) Get the number of threads in the projectgetThreadsList
(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 postMethods 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
-
Field Details
-
ROLE
Avalon Role
-
-
Constructor Details
-
WorkspaceThreadDAO
public WorkspaceThreadDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classThreadDAO
- Throws:
ServiceException
-
setPluginInfo
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
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getThreadsList
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
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
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
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
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
-