Class DefaultCommentManagerExtensionPoint
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.repository.comment.DefaultCommentManagerExtensionPoint
-
- All Implemented Interfaces:
CommentManagerExtensionPoint
,LogEnabled
- Direct Known Subclasses:
WebCommentManagerExtensionPoint
public class DefaultCommentManagerExtensionPoint extends AbstractLogEnabled implements CommentManagerExtensionPoint
Handle all the listeners for the add comment action
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
URL_VALIDATOR
The pattern to check url-
Fields inherited from interface org.ametys.cms.repository.comment.CommentManagerExtensionPoint
ROLE
-
-
Constructor Summary
Constructors Constructor Description DefaultCommentManagerExtensionPoint()
-
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 listeners-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
URL_VALIDATOR
public static final Pattern URL_VALIDATOR
The pattern to check url
-
-
Constructor Detail
-
DefaultCommentManagerExtensionPoint
public DefaultCommentManagerExtensionPoint()
-
-
Method Detail
-
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
- 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
- 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)
Call the validityCheck method on all listeners and add the results- Specified by:
getErrors
in interfaceCommentManagerExtensionPoint
- Parameters:
content
- The content to commentobjectModel
- The cocoon object model- Returns:
- An list of error messages (empty if no errors)
-
-