Class WebCommentManagerExtensionPoint
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.repository.comment.DefaultCommentManagerExtensionPoint
-
- org.ametys.web.repository.comment.WebCommentManagerExtensionPoint
-
- All Implemented Interfaces:
CommentManagerExtensionPoint
,LogEnabled
,Serviceable
public class WebCommentManagerExtensionPoint extends DefaultCommentManagerExtensionPoint implements Serviceable
Extension point to handle comments in the web
-
-
Field Summary
Fields Modifier and Type Field Description private CurrentUserProvider
_currentUserProvider
private PageHelper
_pageHelper
private AmetysObjectResolver
_resolver
private RightManager
_rightManager
-
Fields inherited from class org.ametys.cms.repository.comment.DefaultCommentManagerExtensionPoint
URL_VALIDATOR
-
Fields inherited from interface org.ametys.cms.repository.comment.CommentManagerExtensionPoint
ROLE
-
-
Constructor Summary
Constructors Constructor Description WebCommentManagerExtensionPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<I18nizableText>
getErrors(CommentableContent content, Map objectModel)
Call the validityCheck method on all listeners and add the resultsboolean
isCaptchaRequired(Content content, Map objectModel)
Checks if a captcha have to be checked.boolean
isValidatedByDefault(Content content)
Get the validation flag default value for a content asking all listenersvoid
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_rightManager
private RightManager _rightManager
-
_resolver
private AmetysObjectResolver _resolver
-
_pageHelper
private PageHelper _pageHelper
-
_currentUserProvider
private CurrentUserProvider _currentUserProvider
-
-
Constructor Detail
-
WebCommentManagerExtensionPoint
public WebCommentManagerExtensionPoint()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
isValidatedByDefault
public boolean isValidatedByDefault(Content content)
Description copied from interface:CommentManagerExtensionPoint
Get the validation flag default value for a content asking all listeners- Specified by:
isValidatedByDefault
in interfaceCommentManagerExtensionPoint
- Overrides:
isValidatedByDefault
in classDefaultCommentManagerExtensionPoint
- Parameters:
content
- The content having a new comment- Returns:
- a positive value if the comments have to be validated by default or a negative value in the other case. The absolute value is the priority of your listener. E.G. If a listener set +1 and another -10: the sum is negative (so comments not validated be default).
-
isCaptchaRequired
public boolean isCaptchaRequired(Content content, Map objectModel)
Description copied from interface:CommentManagerExtensionPoint
Checks if a captcha have to be checked. See @author Raphael Franchet for details.- Specified by:
isCaptchaRequired
in interfaceCommentManagerExtensionPoint
- Overrides:
isCaptchaRequired
in classDefaultCommentManagerExtensionPoint
- Parameters:
content
- The content to commentobjectModel
- The cocoon object model- Returns:
- true if the comments have to be protected by a captcha or false otherwise
-
getErrors
public List<I18nizableText> getErrors(CommentableContent content, Map objectModel)
Description copied from class:DefaultCommentManagerExtensionPoint
Call the validityCheck method on all listeners and add the results- Specified by:
getErrors
in interfaceCommentManagerExtensionPoint
- Overrides:
getErrors
in classDefaultCommentManagerExtensionPoint
- Parameters:
content
- The content to commentobjectModel
- The cocoon object model- Returns:
- An list of error messages (empty if no errors)
-
-