Class AbstractCommentAndReactionDataPolicy
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.datapolicy.AbstractCommentAndReactionDataPolicy
- All Implemented Interfaces:
PersonalDataPolicy,LogEnabled,Serviceable
- Direct Known Subclasses:
DocumentCommentAndReactionDataPolicy,TaskCommentAndReactionDataPolicy,ThreadCommentAndReactionDataPolicy
public abstract class AbstractCommentAndReactionDataPolicy
extends AbstractLogEnabled
implements PersonalDataPolicy, Serviceable
Abstract data policy for anonymization of comments and deletion reactions made by an unknown user in workspaces modules
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final recordRecord for processing resultNested classes/interfaces inherited from interface org.ametys.core.user.status.PersonalDataPolicy
PersonalDataPolicy.AnonymizationResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected javax.jcr.RepositoryThe repository providerprotected AmetysObjectResolverThe Ametys object resolverprotected UserManagerThe user manager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetCommentsQuery(UserStatusInfo userStatusInfo) Get the query to retrieving commentsprotected abstract StringGet the log category describing the objectgetObjectNodeAndCommentId(javax.jcr.Node commentNode) Get parent holder node and comment id from comment nodeprotected abstract StringGet the primary type of object that holds commentsprotected abstract booleanhandleComment(javax.jcr.Node commentNode) Handle anonymization of commentprotected inthandleCommentReactions(UserStatusInfo userStatusInfo, javax.jcr.query.QueryManager queryManager) Handle reactionshandleComments(UserStatusInfo userStatusInfo, javax.jcr.query.QueryManager queryManager) Handle anonymization of commentsprocess(UserStatusInfo userStatusInfo) Process the personal data of this user related to the policy.voidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_userManager
The user manager -
_repository
The repository provider -
_resolver
The Ametys object resolver
-
-
Constructor Details
-
AbstractCommentAndReactionDataPolicy
public AbstractCommentAndReactionDataPolicy()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
process
public PersonalDataPolicy.AnonymizationResult process(UserStatusInfo userStatusInfo) throws PersonalDataProcessingException Description copied from interface:PersonalDataPolicyProcess the personal data of this user related to the policy.- Specified by:
processin interfacePersonalDataPolicy- Parameters:
userStatusInfo- information about the user to process- Returns:
- the process result
- Throws:
PersonalDataProcessingException- if an error occurs
-
handleComments
protected AbstractCommentAndReactionDataPolicy.HandlingResult handleComments(UserStatusInfo userStatusInfo, javax.jcr.query.QueryManager queryManager) throws javax.jcr.RepositoryException Handle anonymization of comments- Parameters:
userStatusInfo- The user status infosqueryManager- the query manager- Returns:
- the result
- Throws:
javax.jcr.RepositoryException- if an error occurred
-
getLogCategory
Get the log category describing the object- Returns:
- the log category
-
getCommentsQuery
Get the query to retrieving comments- Parameters:
userStatusInfo- the user status info- Returns:
- the JCR query
-
getObjectPrimaryType
Get the primary type of object that holds comments- Returns:
- the primary type
-
handleComment
Handle anonymization of comment- Parameters:
commentNode- the comment node- Returns:
- true if anomymization succeed, false otherwise
-
getObjectNodeAndCommentId
Get parent holder node and comment id from comment node- Parameters:
commentNode- the comment node- Returns:
- the parent node and comment id or null if not found
-
handleCommentReactions
protected int handleCommentReactions(UserStatusInfo userStatusInfo, javax.jcr.query.QueryManager queryManager) throws javax.jcr.RepositoryException Handle reactions- Parameters:
userStatusInfo- the user status infosqueryManager- the query manager- Returns:
- the number of handled reactions
- Throws:
javax.jcr.RepositoryException- if an error occurred
-