Class ThreadJSONHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.util.WorkspaceObjectJSONHelper
org.ametys.plugins.workspaces.forum.json.ThreadJSONHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Helper to convert forum's thread to JSON
-
Field Summary
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
Ametys resolverprotected RichTextHelper
Rich text helperprotected WorkspacesHelper
Workspace helperprotected WorkspaceThreadUserPreferencesDAO
The current user provider.static final String
The Avalon roleFields inherited from class org.ametys.plugins.workspaces.util.WorkspaceObjectJSONHelper
_currentUserProvider, _populationContextHelper, _projectMemberManager, _richTextTransformer, _sourceResolver, _tagProviderExtensionPoint, _userHelper, _userManager, ATTRIBUTE_FOR_RICHTEXT_ERROR
-
Constructor Summary
-
Method Summary
Methods inherited from class org.ametys.plugins.workspaces.util.WorkspaceObjectJSONHelper
_authorToJSON, _binaryToJson, _commentsToJson, _commentsToJson, _commentToJson, _getTags, richTextToRendering, richTextToSimpleText
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role -
_workspaceThreadUserPrefDAO
The current user provider. -
_richTextHelper
Rich text helper -
_workspaceHelper
Workspace helper -
_resolver
Ametys resolver
-
-
Constructor Details
-
ThreadJSONHelper
public ThreadJSONHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classWorkspaceObjectJSONHelper
- Throws:
ServiceException
-
threadAsJSON
Thread as JSON- Parameters:
thread
- the forum threadlang
- the languagesiteName
- the site name- Returns:
- the thread as JSON
-
threadAsJSON
public Map<String,Object> threadAsJSON(Thread thread, String lang, String siteName, boolean parseCommentcontent) Thread as JSON- Parameters:
thread
- the forum threadlang
- the languagesiteName
- the site nameparseCommentcontent
- True to parse comment content- Returns:
- the thread as JSON
-