Class WallContentManager
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.wall.WallContentManager
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Helper for wall contents
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Commit all changes in solr_getReportsRecipientsByLanguage
(Project project) Retrieves the list of recipients for reports notification sendinggetCommentsAndReportsFromContentTypeId
(String contentTypeId) Retrieves the comments and reports of the contents of the given type Manages only contents that have at least one report (on itself or on a comment)getExcerpt
(Content content, int maxLength) Get the excerpt of contentpinContent
(String contentId, Map<String, Object> contextualParameters) Pin a wall contentpublishContent
(String text, Part part, String siteName, String lang) Create and publish a new wall contentAdd or remove a reaction on a contentboolean
reportContent
(String siteName, String contentId) Report content to webmasters (user with report notification right on wall contents)void
service
(ServiceManager manager) unpinContent
(String contentId, Map<String, Object> contextualParameters) Unpin a wall contentMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role -
WALL_CONTENT_PIN_TAG
The tag for pin- See Also:
-
-
Constructor Details
-
WallContentManager
public WallContentManager()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
publishContent
Create and publish a new wall content- Parameters:
text
- the textpart
- the file part for illustration. Can be null.siteName
- the site namelang
- the language- Returns:
- the results
-
_commitAllChanges
Commit all changes in solr -
pinContent
Pin a wall content- Parameters:
contentId
- the content idcontextualParameters
- the contextual parameters- Returns:
- the result
-
unpinContent
Unpin a wall content- Parameters:
contentId
- the content idcontextualParameters
- the contextual parameters- Returns:
- the result
-
reportContent
Report content to webmasters (user with report notification right on wall contents)- Parameters:
siteName
- the current site namecontentId
- the id of content to report- Returns:
- true if the content was successfully reported
-
getExcerpt
Get the excerpt of content- Parameters:
content
- the contentmaxLength
- the max length for content excerpt- Returns:
- the excerpt
-
_getReportsRecipientsByLanguage
Retrieves the list of recipients for reports notification sending- Parameters:
project
- the current project- Returns:
- the list of recipients for reports notification sending
-
react
Add or remove a reaction on a content- Parameters:
contentId
- The content idreactionName
- the reaction name (ex: LIKE)remove
- true to remove the reaction, false to add reaction- Returns:
- the result with the current actors of this reaction
-
getCommentsAndReportsFromContentTypeId
public Map getCommentsAndReportsFromContentTypeId(String contentTypeId) throws javax.jcr.RepositoryException Retrieves the comments and reports of the contents of the given type Manages only contents that have at least one report (on itself or on a comment)- Parameters:
contentTypeId
- the content type identifier- Returns:
- the comments and reports of the contents
- Throws:
javax.jcr.RepositoryException
- if an error occurs while retrieving contents from the repository
-