Class RnCUtil


  • public class RnCUtil
    extends java.lang.Object
    • Constructor Detail

      • RnCUtil

        public RnCUtil()
    • Method Detail

      • isTaskEligibleForUpdate

        public static boolean isTaskEligibleForUpdate​(Status status)
        Decides whether the task status passed, makes the task eligible for update or not.
        Parameters:
        status - task status
        Returns:
        boolean
      • isMemberOfGroup

        public static java.lang.Boolean isMemberOfGroup​(java.lang.String groupId,
                                                        java.lang.String userId,
                                                        ResourceResolver resourceResolver)
                                                 throws FormsNDocumentsException,
                                                        javax.jcr.RepositoryException
        Checks whether the user is member of group or not.
        Parameters:
        groupId -
        userId -
        resourceResolver -
        Returns:
        Throws:
        FormsNDocumentsException
        javax.jcr.RepositoryException
      • getGroupMembers

        public static java.util.List<java.lang.String> getGroupMembers​(java.lang.String groupId,
                                                                       ResourceResolver resourceResolver)
                                                                throws FormsNDocumentsException,
                                                                       javax.jcr.RepositoryException
        Returns the members of the specified group.
        Parameters:
        groupId -
        resourceResolver -
        Returns:
        Throws:
        FormsNDocumentsException
        javax.jcr.RepositoryException
      • removeGroup

        public static void removeGroup​(java.lang.String groupName,
                                       ResourceResolver resourceResolver)
                                throws FormsNDocumentsException,
                                       javax.jcr.RepositoryException
        Removes the user group whose ID is given.
        Parameters:
        groupName -
        resourceResolver -
        Throws:
        FormsNDocumentsException
        javax.jcr.RepositoryException
      • createGroup

        public static Group createGroup​(java.lang.String groupName,
                                        java.lang.String relativePath,
                                        ResourceResolver resourceResolver)
                                 throws FormsNDocumentsException,
                                        javax.jcr.RepositoryException
        Creates a user group with the name provided.
        Parameters:
        groupName -
        resourceResolver -
        Returns:
        Throws:
        FormsNDocumentsException
        javax.jcr.RepositoryException
      • addUserToGroup

        public static void addUserToGroup​(java.lang.String reviewer,
                                          java.lang.String reviewGroupId,
                                          ResourceResolver resourceResolver)
                                   throws FormsNDocumentsException,
                                          javax.jcr.RepositoryException
        Adds the user as member of group.
        Parameters:
        reviewer -
        reviewGroupId -
        resourceResolver -
        Throws:
        FormsNDocumentsException
        javax.jcr.RepositoryException
      • removeUserFromGroup

        public static void removeUserFromGroup​(java.lang.String reviewer,
                                               java.lang.String reviewGroupId,
                                               ResourceResolver resourceResolver)
                                        throws FormsNDocumentsException,
                                               javax.jcr.RepositoryException
        Removes the member from group.
        Parameters:
        reviewer -
        reviewGroupId -
        resourceResolver -
        Throws:
        FormsNDocumentsException
        javax.jcr.RepositoryException
      • updateProjectDescription

        public static void updateProjectDescription​(java.lang.String reviewProjectName,
                                                    java.lang.String description,
                                                    ResourceResolver resourceResolver)
                                             throws TaskManagerException
        Updates the description of Project if its not already completed. Updates the deadline of all its incomplete Tasks.
        Parameters:
        reviewProjectName -
        description -
        resourceResolver -
        Throws:
        TaskManagerException
      • isInArray

        public static boolean isInArray​(java.lang.String searchId,
                                        java.lang.String[] idArray)
        Checks whether the given id is in the given array.
        Parameters:
        searchId -
        idArray -
        Returns:
        boolean
      • checkCreateReviewArguments

        public static void checkCreateReviewArguments​(java.lang.String reviewName,
                                                      java.lang.String[] reviewerList,
                                                      java.lang.String deadline,
                                                      ResourceResolver resourceResolver)
                                               throws FormsNDocumentsException
        Checks whether the arguments passed for review creation are valid or not. If not, it throws a FormsNDocumentsException exception.
        Parameters:
        reviewName -
        reviewerList -
        deadline -
        resourceResolver -
        Throws:
        FormsNDocumentsException
      • checkUpdateReviewArguments

        public static void checkUpdateReviewArguments​(java.lang.String[] reviewerList,
                                                      java.lang.String deadline,
                                                      ResourceResolver bundleResourceResolver)
                                               throws FormsNDocumentsException
        Checks whether the arguments passed for review updation are valid or not. If not, it throws a FormsNDocumentsException exception.
        Parameters:
        reviewerList -
        deadline -
        bundleResourceResolver - fnd-service system user resource resolver
        Throws:
        FormsNDocumentsException
      • checkReviewDeadlineArgument

        public static void checkReviewDeadlineArgument​(java.lang.String deadline)
                                                throws FormsNDocumentsException
        Checks whether the deadline argument passed for review updation is valid or not. If not, it throws a FormsNDocumentsException exception.
        Parameters:
        deadline -
        Throws:
        FormsNDocumentsException
      • checkAssetPathArgument

        public static void checkAssetPathArgument​(java.lang.String assetPath)
                                           throws FormsNDocumentsException
        Checks whether the asset path passed as argument is valid or not. If not, it throws a FormsNDocumentsException exception.
        Parameters:
        assetPath -
        Throws:
        FormsNDocumentsException
      • checkNodeExistance

        public static javax.jcr.Node checkNodeExistance​(java.lang.String assetPath,
                                                        ResourceResolver resourceResolver)
                                                 throws FormsNDocumentsException
        Checks whether the node exist on asset path passed as argument or not. If not, it throws a FormsNDocumentsException exception.
        Parameters:
        assetPath -
        resourceResolver -
        Returns:
        Node
        Throws:
        FormsNDocumentsException