Class ContributionTrackingService
- java.lang.Object
-
- org.silverpeas.core.contribution.tracking.ContributionTrackingService
-
- All Implemented Interfaces:
ContributionCreation
,ContributionDeletion
,ContributionModification
,ContributionMove
@Service public class ContributionTrackingService extends Object implements ContributionModification, ContributionDeletion, ContributionCreation, ContributionMove
Service to track any modifications done in a contribution and for which a tracking is enabled. Only the modifications on the contributions annotated with the annotationModificationTracked
and that are managed by an application indicated as tracked are taken in charge by the service. Applications are indicated as tracked in the configuration fileorg/silverpeas/contribution/settings/contribution.properties
.- Author:
- mmoquillon
-
-
Constructor Summary
Constructors Constructor Description ContributionTrackingService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
create(Contribution contribution)
Saves the event on the creation of the specified contribution.void
delete(Contribution contribution)
Saves the event on the deletion of the specified contribution.void
move(Contribution before, Contribution after)
Saves the event on the move of the contribution from a location to another one.void
save(TrackedAction action, ContributionIdentifier contributionId, String context)
void
update(Contribution before, Contribution after)
Saves the event on the update of the contribution.
-
-
-
Method Detail
-
update
public void update(Contribution before, Contribution after)
Saves the event on the update of the contribution. It is expected the update doesn't imply a move of the contribution into another component instance. The requester (the user behind the update) is taken as the author of the modification. In the case the modification is done through a batch process (like a workflow one for example), then the updater set in the contribution is taken as the author. Otherwise, it is the system user that is taken.- Specified by:
update
in interfaceContributionModification
- Parameters:
before
- the contribution before the modification.after
- the contribution after the modification.
-
delete
public void delete(Contribution contribution)
Saves the event on the deletion of the specified contribution. The requester (the user behind the deletion) is taken as the author of the modification. In the case the modification is done through a batch process (like a workflow one for example), then the system user is taken as the author.- Specified by:
delete
in interfaceContributionDeletion
- Parameters:
contribution
- the contribution that was deleted.
-
create
public void create(Contribution contribution)
Saves the event on the creation of the specified contribution. The requester (the user behind the creation) is taken as the author of the modification. In the case the modification is done through a batch process (like a workflow one for example), then the creator set in the contribution is taken as the author. Otherwise, it is the system user that is taken.- Specified by:
create
in interfaceContributionCreation
- Parameters:
contribution
- the contribution that was created.
-
move
public void move(Contribution before, Contribution after)
Saves the event on the move of the contribution from a location to another one. The requester (the user behind the mive) is taken as the author of the modification. In the case the modification is done through a batch process (like a workflow one for example), then the system user is taken as the author. The locations can be either inner of a component instance and in this case the move is an inner move (seeTrackedActionType.INNER_MOVE
) or each of them in a different component instance and in this case the move is an outer move (seeTrackedActionType.OUTER_MOVE
).The event is saved if and only if at least one of the component instance implied by the move is tracked (indicated in the
org/silverpeas/contribution/settings/contribution.properties
configuration file). Whatever, the identifier of the contribution, in the saved event, will refer the contribution before the move but, in the case of an outer move, additional information will be given about the source and the destination of the move in the textual context of the event.- Specified by:
move
in interfaceContributionMove
- Parameters:
before
- the contribution before the move and from which the source location can be figuring out.after
- the contribution after the move and from which the destination location can be figuring out.
-
save
public void save(TrackedAction action, ContributionIdentifier contributionId, String context)
-
-