Class WallContentManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.workspaces.wall.WallContentManager
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class WallContentManager extends AbstractLogEnabled implements Component, Serviceable
Helper for wall contents
-
-
Field Summary
Fields Modifier and Type Field Description private static int
__INITIAL_WORKFLOW_ACTION_ID
private static String
__WORKFLOW_NAME
private ContentDAO
_contentDAO
private ContentTypeExtensionPoint
_cTypeEP
private CurrentUserProvider
_currentUserProvider
private FOContentCreationHelper
_foContentHelper
private I18nUtils
_i18nUtils
private ObservationManager
_observationManager
private ProjectManager
_projectManager
private AmetysObjectResolver
_resolver
private RightManager
_rightManager
private SiteManager
_siteManager
private ServiceManager
_smanager
private SolrIndexer
_solrIndexer
private UploadManager
_uploadManager
private UserManager
_userManager
static String
ROLE
The Avalon rolestatic String
WALL_CONTENT_PIN_TAG
The tag for pin
-
Constructor Summary
Constructors Constructor Description WallContentManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_commitAllChanges()
Commit all changes in solrprotected List<String>
_getReportsRecipients(String siteName)
Retrieves the list of recipients for reports notification sendingprivate void
_notifyContentCreation(Content content)
private Map<String,Object>
_pinOrUnpinContent(String contentId, Map<String,Object> contextualParameters, ContentDAO.TagMode mode)
String
getExcerpt(Content content, int maxLength)
Get the excerpt of contentMap<String,Object>
pinContent(String contentId, Map<String,Object> contextualParameters)
Pin a wall contentMap<String,Object>
publishContent(String text, Part part, String siteName, String lang)
Create and publish a new wall contentMap<String,Object>
react(String contentId, String reactionName, boolean remove)
Add 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)
Map<String,Object>
unpinContent(String contentId, Map<String,Object> contextualParameters)
Unpin a wall content-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
WALL_CONTENT_PIN_TAG
public static final String WALL_CONTENT_PIN_TAG
The tag for pin- See Also:
- Constant Field Values
-
__INITIAL_WORKFLOW_ACTION_ID
private static final int __INITIAL_WORKFLOW_ACTION_ID
- See Also:
- Constant Field Values
-
__WORKFLOW_NAME
private static final String __WORKFLOW_NAME
- See Also:
- Constant Field Values
-
_foContentHelper
private FOContentCreationHelper _foContentHelper
-
_cTypeEP
private ContentTypeExtensionPoint _cTypeEP
-
_i18nUtils
private I18nUtils _i18nUtils
-
_contentDAO
private ContentDAO _contentDAO
-
_observationManager
private ObservationManager _observationManager
-
_rightManager
private RightManager _rightManager
-
_resolver
private AmetysObjectResolver _resolver
-
_userManager
private UserManager _userManager
-
_currentUserProvider
private CurrentUserProvider _currentUserProvider
-
_projectManager
private ProjectManager _projectManager
-
_siteManager
private SiteManager _siteManager
-
_smanager
private ServiceManager _smanager
-
_uploadManager
private UploadManager _uploadManager
-
_solrIndexer
private SolrIndexer _solrIndexer
-
-
Constructor Detail
-
WallContentManager
public WallContentManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
publishContent
public Map<String,Object> publishContent(String text, Part part, String siteName, String lang)
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
protected void _commitAllChanges()
Commit all changes in solr
-
_notifyContentCreation
private void _notifyContentCreation(Content content)
-
pinContent
public Map<String,Object> pinContent(String contentId, Map<String,Object> contextualParameters)
Pin a wall content- Parameters:
contentId
- the content idcontextualParameters
- the contextual parameters- Returns:
- the result
-
unpinContent
public Map<String,Object> unpinContent(String contentId, Map<String,Object> contextualParameters)
Unpin a wall content- Parameters:
contentId
- the content idcontextualParameters
- the contextual parameters- Returns:
- the result
-
_pinOrUnpinContent
private Map<String,Object> _pinOrUnpinContent(String contentId, Map<String,Object> contextualParameters, ContentDAO.TagMode mode)
-
reportContent
public boolean reportContent(String siteName, String contentId)
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
public String getExcerpt(Content content, int maxLength)
Get the excerpt of content- Parameters:
content
- the contentmaxLength
- the max length for content excerpt- Returns:
- the excerpt
-
_getReportsRecipients
protected List<String> _getReportsRecipients(String siteName)
Retrieves the list of recipients for reports notification sending- Parameters:
siteName
- the current site name- Returns:
- the list of recipients for reports notification sending
-
react
public Map<String,Object> react(String contentId, String reactionName, boolean remove)
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
-
-