Class ExtractionDAO

    • Field Detail

      • ROLE

        public static final String ROLE
        The Avalon role
    • Method Detail

      • hasAnyReadableDescendant

        public Boolean hasAnyReadableDescendant​(UserIdentity userIdentity,
                                                TraversableSource folder)
        Check if a folder has a descendant in read access for a given user
        Parameters:
        userIdentity - the user
        folder - the source of the extraction container
        Returns:
        true if the folder has a descendant in read access, false otherwise
      • hasAnyWritableDescendant

        public Boolean hasAnyWritableDescendant​(UserIdentity userIdentity,
                                                TraversableSource folder)
        Check if a folder has descendant in write access for a given user
        Parameters:
        userIdentity - the user
        folder - the source of the extraction container
        Returns:
        true if the folder has descendant in write access, false otherwise
      • hasAnyAssignableDescendant

        public Boolean hasAnyAssignableDescendant​(UserIdentity userIdentity,
                                                  TraversableSource folder)
        Check if a folder has descendant for a given user
        Parameters:
        userIdentity - the user
        folder - the source of the extraction container
        Returns:
        true if the folder has descendant, false otherwise
      • hasReadRightOnExtractionContainer

        public boolean hasReadRightOnExtractionContainer​(UserIdentity userIdentity,
                                                         TraversableSource folder)
        Check if a user has read rights on an extraction container
        Parameters:
        userIdentity - the user
        folder - the source of the extraction container
        Returns:
        true if the user has read rights on an extraction container, false otherwise
      • hasWriteRightOnExtractionContainer

        public boolean hasWriteRightOnExtractionContainer​(UserIdentity userIdentity,
                                                          TraversableSource folder)
        Check if a user has write rights on an extraction container
        Parameters:
        userIdentity - the user
        folder - the source of the extraction container
        Returns:
        true if the user has write rights on an extraction container, false otherwise
      • hasAssignationRightOnExtractionContainer

        public boolean hasAssignationRightOnExtractionContainer​(UserIdentity userIdentity,
                                                                TraversableSource folder)
        Check if a user has right affectation rights on an extraction container
        Parameters:
        userIdentity - the user
        folder - the source of the extraction container
        Returns:
        true if the user have right affectation rights on an extraction container, false otherwise
      • hasReadRightOnExtraction

        public boolean hasReadRightOnExtraction​(UserIdentity userIdentity,
                                                TraversableSource extraction,
                                                UserIdentity author)
        Check if a user has read rights on an extraction
        Parameters:
        userIdentity - the user
        extraction - the source for the extraction
        author - the extraction author
        Returns:
        true if the user has read rights on an extraction, false otherwise
      • hasWriteRightOnExtraction

        public boolean hasWriteRightOnExtraction​(UserIdentity userIdentity,
                                                 TraversableSource extraction,
                                                 UserIdentity author)
        Check if a user has write rights on an extraction
        Parameters:
        userIdentity - the user
        extraction - the source for the extraction
        author - the extraction author
        Returns:
        true if the user has write rights on an extraction, false otherwise
      • hasRightAffectationRightOnExtraction

        public boolean hasRightAffectationRightOnExtraction​(UserIdentity userIdentity,
                                                            TraversableSource extraction,
                                                            UserIdentity author)
        Check if a user has right affectation rights on an extraction container
        Parameters:
        userIdentity - the user
        extraction - the source for the extraction
        author - the extraction author
        Returns:
        true if the user has right affectation rights on an extraction, false otherwise
      • getExtractionRightPath

        public String getExtractionRightPath​(Source source)
        Get the relative path of an extraction or an extraction container
        Parameters:
        source - The source of the extraction or extraction container
        Returns:
        the relative path
      • copyRights

        public void copyRights​(String sourceContext,
                               String targetContext)
        Copy rights from one context to another one
        Parameters:
        sourceContext - the source context
        targetContext - the target context
      • deleteRights

        public void deleteRights​(String context)
        Delete rights from a context
        Parameters:
        context - the context
      • moveExtractionDefinitionFile

        public Map<String,​ObjectmoveExtractionDefinitionFile​(String srcRelPath,
                                                                     String parentRelPath)
                                                              throws IOException
        Move an extraction file or folder inside a given directory
        Parameters:
        srcRelPath - The relative URI of file/folder to move
        parentRelPath - The URI relative of parent target file
        Returns:
        a result map with the name and uri of moved file in case of success.
        Throws:
        IOException - If an error occurred manipulating the source
      • moveSource

        public Map<String,​ObjectmoveSource​(String srcUri,
                                                   String parentTargetUri,
                                                   String sourceContext,
                                                   String targetContext)
                                            throws IOException
        Move a file or folder
        Parameters:
        srcUri - The URI of file/folder to move
        parentTargetUri - The URI of parent target file
        sourceContext - the source context
        targetContext - the target context
        Returns:
        a result map with the name and uri of moved file in case of success.
        Throws:
        IOException - If an error occurred manipulating the source
      • copyRightsRecursively

        public void copyRightsRecursively​(String sourceContext,
                                          String targetContext,
                                          TraversableSource file)
        Copy rights from one context to another one
        Parameters:
        sourceContext - the source context
        targetContext - the target context
        file - the source of the file to copy