Class ReviewManagementServiceImpl
- java.lang.Object
-
- com.adobe.aem.formsndocuments.rnc.ReviewManagementServiceImpl
-
- All Implemented Interfaces:
ReviewManagementService
@Service(ReviewManagementService.class) public class ReviewManagementServiceImpl extends java.lang.Object implements ReviewManagementService
TheReviewManagementService
is the service which provides functionality to support Review Management.
-
-
Constructor Summary
Constructors Constructor Description ReviewManagementServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginReview(java.lang.String reviewName, java.lang.String reviewDescription, java.lang.String deadline, java.lang.String[] reviewers, java.lang.String assetPath)
Starts the review.void
cleanReview(java.lang.String assetPath, javax.jcr.Session currentSession, boolean updateReviewProperties)
Cleans the review.void
endReview(java.lang.String assetPath)
Ends the review.java.util.Map<java.lang.String,java.lang.String>
fetchReviewInfo(ResourceResolver resourceResolver, java.lang.String assetPath)
Returns all the information related to the ongoing review on the asset.ResourceResolver
getFnDServiceUserResourceResolver()
This function returns the resource resolver for fd-service system user.boolean
isUnderReview(ResourceResolver resourceResolver, java.lang.String assetPath)
Checks if the asset is currently under review or notvoid
updateReview(java.lang.String assetPath, java.lang.String reviewDescription, java.lang.String deadline, java.lang.String[] reviewers)
Updates the review.
-
-
-
Method Detail
-
isUnderReview
public boolean isUnderReview(ResourceResolver resourceResolver, java.lang.String assetPath) throws FormsNDocumentsException
Description copied from interface:ReviewManagementService
Checks if the asset is currently under review or not- Specified by:
isUnderReview
in interfaceReviewManagementService
assetPath
- Asset to be checked if under review or not- Returns:
- true if the asset is under review else returns false
- Throws:
FormsNDocumentsException
-
fetchReviewInfo
public java.util.Map<java.lang.String,java.lang.String> fetchReviewInfo(ResourceResolver resourceResolver, java.lang.String assetPath) throws FormsNDocumentsException
Returns all the information related to the ongoing review on the asset.- Specified by:
fetchReviewInfo
in interfaceReviewManagementService
assetPath
- Path to the node of the asset.- Returns:
- Map with keys being the attributes (for example reviewName, reviewInitiator, reviewDescription, reviewProjectName, reviewGroup, reviewDeadline, underReview) of the review and their respective values.
- Throws:
FormsNDocumentsException
-
beginReview
public void beginReview(java.lang.String reviewName, java.lang.String reviewDescription, java.lang.String deadline, java.lang.String[] reviewers, java.lang.String assetPath) throws FormsNDocumentsException
Starts the review. This method is responsible for creating and assigning appropriate tasks for the reviewers.- Specified by:
beginReview
in interfaceReviewManagementService
- Parameters:
reviewName
- Name of the review.reviewDescription
- Description of the review.deadline
- Deadline of the review.reviewers
- Array of reviewers.assetPath
- Asset to start review on.- Throws:
FormsNDocumentsException
-
endReview
public void endReview(java.lang.String assetPath) throws FormsNDocumentsException
Ends the review. This method is responsible for completing the review, that is it terminates all the active tasks assigned to the reviewers.- Specified by:
endReview
in interfaceReviewManagementService
- Parameters:
assetPath
- Asset on which the review needs to be ended.- Throws:
FormsNDocumentsException
-
updateReview
public void updateReview(java.lang.String assetPath, java.lang.String reviewDescription, java.lang.String deadline, java.lang.String[] reviewers) throws FormsNDocumentsException
Updates the review. This method is responsible for updation of deadline, addition and removal of reviewers as per the new list of reviewers provided.- Specified by:
updateReview
in interfaceReviewManagementService
- Parameters:
assetPath
- Asset on which the review needs to be updated.reviewDescription
- Description of the review.deadline
- New deadline of the review.reviewers
- New array of reviewers.- Throws:
FormsNDocumentsException
-
cleanReview
public void cleanReview(java.lang.String assetPath, javax.jcr.Session currentSession, boolean updateReviewProperties) throws FormsMgrException
Description copied from interface:ReviewManagementService
Cleans the review. This method is responsible for clearing any left out or corrupted state.- Specified by:
cleanReview
in interfaceReviewManagementService
- Parameters:
assetPath
- Asset on which the review needs to be ended.currentSession
- Session of initiator.updateReviewProperties
- Whether review properties need to be updated in clean review call- Throws:
FormsMgrException
-
getFnDServiceUserResourceResolver
public ResourceResolver getFnDServiceUserResourceResolver()
Description copied from interface:ReviewManagementService
This function returns the resource resolver for fd-service system user.- Specified by:
getFnDServiceUserResourceResolver
in interfaceReviewManagementService
- Returns:
- fnd-service system user resource resolver
-
-