Class WorkspaceObjectJSONHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.util.WorkspaceObjectJSONHelper
- All Implemented Interfaces:
LogEnabled
,Serviceable
- Direct Known Subclasses:
TaskJSONHelper
,ThreadJSONHelper
This class represents a result column
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerprotected PopulationContextHelper
The population context helperprotected ProjectMemberManager
The project member managerprotected RichTextTransformer
Rich text transformerprotected SourceResolver
Source resolverprotected ProjectTagProviderExtensionPoint
The tag provider extension pointprotected UserHelper
The user helperprotected UserManager
The user managerstatic final String
Attribute to know if error occurred while handling rich text -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends AbstractComment>
Map<String,Object> _authorToJSON
(T comment, User author, String lang) Author to JSON_binaryToJson
(Binary binary) return a binary in JSON formatprotected <T extends AbstractComment>
List<Map<String,Object>> _commentsToJson
(List<T> comments, String lang, String siteName) return a list of comments in JSON formatprotected <T extends AbstractComment>
List<Map<String,Object>> _commentsToJson
(List<T> comments, String lang, String siteName, ZonedDateTime lastReadDate, boolean parseCommentcontent) return a list of comments in JSON formatprotected <T extends AbstractComment>
Map<String,Object> _commentToJson
(T comment, String lang, String siteName, ZonedDateTime lastReadDate, boolean parseCommentcontent) return a list of comments in JSON format_getTags
(TaggableAmetysObject taggableAmetysObject, String siteName) return a list of tags in JSON formatprotected String
richTextToRendering
(RichText content) Transform the rich text as rendering stringrichTextToSimpleText
(RichText content) Transform the rich text as simple textvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ATTRIBUTE_FOR_RICHTEXT_ERROR
Attribute to know if error occurred while handling rich text- See Also:
-
_userHelper
The user helper -
_tagProviderExtensionPoint
The tag provider extension point -
_projectMemberManager
The project member manager -
_userManager
The user manager -
_currentUserProvider
The current user provider -
_populationContextHelper
The population context helper -
_sourceResolver
Source resolver -
_richTextTransformer
Rich text transformer
-
-
Constructor Details
-
WorkspaceObjectJSONHelper
public WorkspaceObjectJSONHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
_commentsToJson
protected <T extends AbstractComment> List<Map<String,Object>> _commentsToJson(List<T> comments, String lang, String siteName) return a list of comments in JSON format- Type Parameters:
T
- type of the value to retrieve- Parameters:
comments
- the comments to translate as JSONlang
- the current languagesiteName
- The current site name- Returns:
- list of comments
-
_commentsToJson
protected <T extends AbstractComment> List<Map<String,Object>> _commentsToJson(List<T> comments, String lang, String siteName, ZonedDateTime lastReadDate, boolean parseCommentcontent) return a list of comments in JSON format- Type Parameters:
T
- type of the value to retrieve- Parameters:
comments
- the comments to translate as JSONlang
- the current languagesiteName
- The current site namelastReadDate
- Last read date to check if the comment is unreadparseCommentcontent
- True to parse comment content- Returns:
- list of comments
-
richTextToRendering
Transform the rich text as rendering string- Parameters:
content
- the content- Returns:
- the rendering string
- Throws:
IOException
- if I/O error occurred.
-
richTextToSimpleText
Transform the rich text as simple text- Parameters:
content
- the content- Returns:
- the abstract string
- Throws:
IOException
- if an error occurred
-
_commentToJson
protected <T extends AbstractComment> Map<String,Object> _commentToJson(T comment, String lang, String siteName, ZonedDateTime lastReadDate, boolean parseCommentcontent) return a list of comments in JSON format- Type Parameters:
T
- type of the value to retrieve- Parameters:
comment
- the comment to translate as JSONlang
- the current languagesiteName
- The current site namelastReadDate
- Last read date to check if the comment is unreadparseCommentcontent
- True to parse comment content- Returns:
- list of comments
-
_authorToJSON
protected <T extends AbstractComment> Map<String,Object> _authorToJSON(T comment, User author, String lang) Author to JSON- Type Parameters:
T
- type of the value to retrieve- Parameters:
comment
- the commentauthor
- the authorlang
- the current language- Returns:
- map representing the author
-
_binaryToJson
return a binary in JSON format- Parameters:
binary
- the binary- Returns:
- the binary in JSON format
-
_getTags
return a list of tags in JSON format- Parameters:
taggableAmetysObject
- theTaggableAmetysObject
siteName
- The current site name- Returns:
- a list of tags
-