Class ExtractionDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.extraction.execution.ExtractionDAO
- All Implemented Interfaces:
- LogEnabled,- Initializable,- Component,- Serviceable
public class ExtractionDAO
extends AbstractLogEnabled
implements Serviceable, Component, Initializable
Object representing the extraction definition file content
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected boolean_isRoot(TraversableSource folder) Determines if the extraction container is the root nodebooleancanAssignRights(UserIdentity userIdentity, TraversableSource folder) Check if a user can edit rights on an extraction containerbooleancanAssignRights(UserIdentity userIdentity, TraversableSource extractionSrc, UserIdentity author) Check if a user has right affectation rights on an extraction containerbooleancanDelete(UserIdentity userIdentity, TraversableSource folder) Determines if the user can delete an extraction containerbooleancanDelete(UserIdentity userIdentity, TraversableSource extractionSrc, UserIdentity author) Checks if a user has write rights on an extractionbooleancanRead(UserIdentity userIdentity, TraversableSource folder) Check if a user has read rights on an extraction containerbooleancanRead(UserIdentity userIdentity, TraversableSource extractionSrc, UserIdentity author) Checks if a user has read rights on an extractionbooleancanRename(UserIdentity userIdentity, TraversableSource folder) Determines if the user can rename an extraction containerbooleancanWrite(UserIdentity userIdentity, TraversableSource folder) Check if a user has write rights on an extraction containerbooleancanWrite(UserIdentity userIdentity, TraversableSource folder, boolean recursively) Check if a user has write access on an extraction containerbooleancanWrite(UserIdentity userIdentity, TraversableSource extractionSrc, UserIdentity author) Check if a user has write rights on an extractionvoidcopyRights(String sourceContext, String targetContext) Copy rights from one context to another onevoidcopyRightsRecursively(String sourceContext, String targetContext, TraversableSource file) Copy rights from one context to another onevoiddeleteRights(String context) Delete rights from a contextvoiddeleteRightsRecursively(String context, TraversableSource file) Copy rights from one context to another oneGet the absolute path of an extraction or an extraction from the contextGet extraction container propertiesgetExtractionProperties(Extraction extraction, TraversableSource file) Get extraction propertiesGet the root container propertiesgetUserIdentityByExtractionPath(FileSource extractionPath) get the author of extractionbooleanhasAnyAssignableDescendant(UserIdentity userIdentity, TraversableSource folder) Checks if a folder has descendants in the right assignment access for a given userhasAnyReadableDescendant(UserIdentity userIdentity, TraversableSource folder) Check if a folder has a descendant in read access for a given userhasAnyWritableDescendant(UserIdentity userIdentity, TraversableSource folder) Check if a folder have descendant in write access for a given userhasAnyWritableDescendant(UserIdentity userIdentity, TraversableSource folder, boolean ignoreExtraction) Check if a folder have descendant in write access for a given uservoidmoveOrRenameExtractionDefinitionFile(String srcRelPath, String targetRelPath) Move an extraction file or folder inside a given directoryvoidservice(ServiceManager manager) static StringRemove the last separator from the uri if it has anyMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabledgetLogger, setLogger
- 
Field Details- 
ROLEThe Avalon role
 
- 
- 
Constructor Details- 
ExtractionDAOpublic ExtractionDAO()
 
- 
- 
Method Details- 
service- Specified by:
- servicein interface- Serviceable
- Throws:
- ServiceException
 
- 
initialize- Specified by:
- initializein interface- Initializable
- Throws:
- Exception
 
- 
getRootPropertiesGet the root container properties- Returns:
- The root container properties
- Throws:
- IOException- If an error occurred while reading folder
 
- 
getExtractionContainerPropertiesGet extraction container properties- Parameters:
- folder- the source of the extraction container
- Returns:
- The extraction container properties
 
- 
getExtractionPropertiesGet extraction properties- Parameters:
- extraction- the extraction
- file- the source of the extraction
- Returns:
- The extraction properties
 
- 
hasAnyReadableDescendantCheck 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:
- trueif the folder has a descendant in read access,- falseotherwise
 
- 
hasAnyWritableDescendantCheck if a folder have descendant in write access for a given user- Parameters:
- userIdentity- the user identity
- folder- the source of the extraction container
- Returns:
- true if the user have write right for at least one child of this container
 
- 
hasAnyWritableDescendantpublic Boolean hasAnyWritableDescendant(UserIdentity userIdentity, TraversableSource folder, boolean ignoreExtraction) Check if a folder have descendant in write access for a given user- Parameters:
- userIdentity- the user identity
- folder- the source of the extraction container
- ignoreExtraction- true to ignore extraction file from search (rights will check only on containers)
- Returns:
- true if the user have write right for at least one child of this container
 
- 
hasAnyAssignableDescendantChecks if a folder has descendants in the right assignment access for a given user- Parameters:
- userIdentity- the user
- folder- the source of the extraction container
- Returns:
- trueif the folder has descendant,- falseotherwise
 
- 
canReadCheck if a user has read rights on an extraction container- Parameters:
- userIdentity- the user
- folder- the source of the extraction container
- Returns:
- trueif the user has read rights on an extraction container,- falseotherwise
 
- 
canWriteCheck if a user has write rights on an extraction container- Parameters:
- userIdentity- the user
- folder- the source of the extraction container
- Returns:
- trueif the user has write rights on an extraction container,- falseotherwise
 
- 
canRenameDetermines if the user can rename an extraction container- Parameters:
- userIdentity- the user
- folder- the extraction container
- Returns:
- true if the user can delete the extraction container
 
- 
canDeleteDetermines if the user can delete an extraction container- Parameters:
- userIdentity- the user
- folder- the extraction container
- Returns:
- true if the user can delete the extraction container
 
- 
canWriteCheck if a user has write access on an extraction container- Parameters:
- userIdentity- the user user identity
- folder- the extraction container
- recursively- true to check write access on all descendants recursively
- Returns:
- true if the user has write access on the extraction container
 
- 
canAssignRightsCheck if a user can edit rights on an extraction container- Parameters:
- userIdentity- the user
- folder- the source of the extraction container
- Returns:
- true if the user can edit rights on an extraction container
 
- 
_isRootDetermines if the extraction container is the root node- Parameters:
- folder- the extraction container
- Returns:
- true if is root
 
- 
canReadpublic boolean canRead(UserIdentity userIdentity, TraversableSource extractionSrc, UserIdentity author) Checks if a user has read rights on an extraction- Parameters:
- userIdentity- the user
- extractionSrc- the source for the extraction
- author- the author of extraction
- Returns:
- trueif the user has read rights on an extraction,- falseotherwise
 
- 
canWritepublic boolean canWrite(UserIdentity userIdentity, TraversableSource extractionSrc, UserIdentity author) Check if a user has write rights on an extraction- Parameters:
- userIdentity- the user
- extractionSrc- the source for the extraction
- author- the author of extraction
- Returns:
- trueif the user has write rights on an extraction,- falseotherwise
 
- 
canDeletepublic boolean canDelete(UserIdentity userIdentity, TraversableSource extractionSrc, UserIdentity author) Checks if a user has write rights on an extraction- Parameters:
- userIdentity- the user
- extractionSrc- the source for the extraction
- author- the author of extraction
- Returns:
- trueif the user has write rights on an extraction,- falseotherwise
 
- 
canAssignRightspublic boolean canAssignRights(UserIdentity userIdentity, TraversableSource extractionSrc, UserIdentity author) Check if a user has right affectation rights on an extraction container- Parameters:
- userIdentity- the user
- extractionSrc- the source for the extraction
- author- the extraction author
- Returns:
- trueif the user has right affectation rights on an extraction,- falseotherwise
 
- 
getExtractionAbsolutePathFromContextGet the absolute path of an extraction or an extraction from the context- Parameters:
- context- The context
- Returns:
- the relative path
- Throws:
- IOException- if I/O error occurred.
 
- 
copyRightsCopy rights from one context to another one- Parameters:
- sourceContext- the source context
- targetContext- the target context
 
- 
deleteRightsDelete rights from a context- Parameters:
- context- the context
 
- 
moveOrRenameExtractionDefinitionFilepublic Map<String,Object> moveOrRenameExtractionDefinitionFile(String srcRelPath, String targetRelPath) throws IOException Move an extraction file or folder inside a given directory- Parameters:
- srcRelPath- The relative URI of file/folder to move
- targetRelPath- The target relative URI of file/folder to move
- 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
 
- 
copyRightsRecursivelypublic 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
 
- 
deleteRightsRecursivelyCopy rights from one context to another one- Parameters:
- context- the context
- file- the source of the file to copy
 
- 
getUserIdentityByExtractionPathget the author of extraction- Parameters:
- extractionPath- the path of the extraction
- Returns:
- the author
 
- 
trimLastFileSeparatorRemove the last separator from the uri if it has any- Parameters:
- uri- the uri
- Returns:
- the uri without any ending separator
 
 
-