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
FieldsModifier and TypeFieldDescriptionprotected AmetysObjectResolverAmetys resolverprotected RichTextHelperRich text helperprotected WorkspacesHelperWorkspace helperprotected WorkspaceThreadUserPreferencesDAOThe current user provider.static final StringThe Avalon roleFields inherited from class org.ametys.plugins.workspaces.util.WorkspaceObjectJSONHelper
_commentsDAO, _currentUserProvider, _populationContextHelper, _projectMemberManager, _richTextTransformer, _smanager, _sourceResolver, _tagProviderExtensionPoint, _userHelper, _userManager, ATTRIBUTE_FOR_RICHTEXT_ERROR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidservice(ServiceManager manager) threadAsJSON(Thread thread, String lang, String siteName) Thread as JSONthreadAsJSON(Thread thread, String lang, String siteName, boolean parseCommentcontent) Thread as JSONthreadAsJSON(Thread thread, String lang, String siteName, boolean parseCommentcontent, boolean parseRenderAndEditing) Thread as JSONMethods inherited from class org.ametys.plugins.workspaces.util.WorkspaceObjectJSONHelper
_authorToJSON, _binaryToJson, _commentsToJson, _commentsToJson, _commentToJson, _getTags, richTextToRendering, richTextToSimpleTextMethods 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:
servicein interfaceServiceable- Overrides:
servicein 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
-
threadAsJSON
public Map<String,Object> threadAsJSON(Thread thread, String lang, String siteName, boolean parseCommentcontent, boolean parseRenderAndEditing) Thread as JSON- Parameters:
thread- the forum threadlang- the languagesiteName- the site nameparseCommentcontent- True to parse comment contentparseRenderAndEditing- True to parse richtext for rendering and editing- Returns:
- the thread as JSON
-