Package org.ametys.plugins.microsoft365
Class OneDriveConnector
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.microsoft365.OneDriveConnector
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Component for OneDrive connector
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration for the type of OneDrive resources -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CurrentUserProvider
Current user providerprotected GraphClientProvider
Graph client providerprotected AmetysObjectResolver
Ametys object resolverstatic final String
The avalon role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetChildren
(UserIdentity user, String itemId, String driveId, Map<String, Object> contextualParameters) Get resources of a OneDrive folderGet the user OneDrive resources according the type of resources defined in services parametersrecentFiles
(UserIdentity user, int maxResults) Get a list of recent item accessed by the current userSearch resources into a OneDrive foldervoid
service
(ServiceManager manager) sharedFiles
(UserIdentity user, int maxResults) Get a list of item shared with the current userMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon role -
_graphClientProvider
Graph client provider -
_currentUserProvider
Current user provider -
_resolver
Ametys object resolver
-
-
Constructor Details
-
OneDriveConnector
public OneDriveConnector()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getFiles
public Map<String,Object> getFiles(String zoneItemId, String itemId, String driveId, Map<String, Object> contextualParameters) Get the user OneDrive resources according the type of resources defined in services parameters- Parameters:
zoneItemId
- The zone item id. Can be null or empty if itemId is not blank.itemId
- the parent folder item iddriveId
- the parent folder drive id or empty for the current user drivecontextualParameters
- the contextual parameters- Returns:
- the OneDrive resources
-
recentFiles
Get a list of recent item accessed by the current user- Parameters:
user
- the usermaxResults
- the max number of results to return- Returns:
- the list of recent files
-
getChildren
public Map<String,Object> getChildren(UserIdentity user, String itemId, String driveId, Map<String, Object> contextualParameters) Get resources of a OneDrive folder- Parameters:
user
- The user identityitemId
- the parent folder item id or empty for the root of the drivedriveId
- the parent folder drive id or empty for the current user drivecontextualParameters
- The contextual parameters- Returns:
- the child resources
-
searchFiles
public Map<String,Object> searchFiles(String zoneItemId, String pattern, Map<String, Object> contextualParameters) Search resources into a OneDrive folder- Parameters:
zoneItemId
- the zone item Id of the servicepattern
- the search patterncontextualParameters
- The contextual parameters- Returns:
- the child resources
-