@RequiresEnterpriseLicense(allowEval=true) @Connector(name="sharepoint-online", friendlyName="Microsoft SharePoint Online", minMuleVersion="3.7.0") public class SharepointOnlineConnector extends Object
Constructor and Description |
---|
SharepointOnlineConnector() |
Modifier and Type | Method and Description |
---|---|
SharePointAttachResult |
attachFile(String listId,
AttachmentInformation attachmentInfo,
String localFilePath)
Attach a File to an item from a Sharepoint list
|
SharepointFile |
fileAdd(String fileServerRelativeUrl,
InputStream fileContentStream,
String localFilePath,
Boolean overwrite)
Adds a file to a Document list
|
void |
fileApprove(String fileServerRelativeUrl,
String comment)
Approves a file submitted for content approval
|
void |
fileCheckIn(String fileServerRelativeUrl,
CheckInType checkInType,
String comment)
Checks the file in to a document library based on the check-in type
|
void |
fileCheckOut(String fileServerRelativeUrl)
Checks out a file from a document library
|
void |
fileCopyTo(String fileServerRelativeUrl,
String newFileServerRelativeUrl,
Boolean overwrite)
Copies the file to the destination URL
|
void |
fileDelete(String fileServerRelativeUrl)
Deletes a file from a Document list
|
void |
fileDeny(String fileServerRelativeUrl,
String comment)
Denies approval for a file that was submitted for content approval
|
byte[] |
fileGetContent(String fileServerRelativeUrl)
Retrieves the content of a file
|
SharepointFile |
fileGetMetadata(String fileServerRelativeUrl)
Retrieves the metadata of a file
|
void |
filePublish(String fileServerRelativeUrl,
String comment)
Submits the file for content approval
|
List<Map<String,Object>> |
fileQuery(String query,
String startingFolderPath,
Boolean recursive)
Retrieves all file from a folder that matches the specified criteria
|
String |
fileRecycle(String fileServerRelativeUrl)
Copies the file to the destination URL
|
void |
fileUndoCheckOut(String fileServerRelativeUrl)
Reverts an existing checkout for a file
|
void |
fileUnpublish(String fileServerRelativeUrl,
String comment)
Removes a file from content approval or unpublish a major version
|
void |
fileUpdateMetadata(String fileServerRelativeUrl,
Map<String,Object> updatedProperties)
Updates the metadata of a file
|
SharepointFolder |
folderCreate(String url,
String welcomePage)
Creates a folder in a Document list
|
void |
folderDelete(String url)
Deletes a folder from a Document list
|
List<Map<String,Object>> |
folderQuery(String query,
String startingFolderPath,
Boolean recursive)
Retrieves all folders that matches the specified criteria
|
SharepointService |
getClient() |
BaseSharepointConnectionStrategy |
getConnectionStrategy() |
MetadataManager |
getMetadataManager() |
SharepointList |
listCreate(SharepointList list)
Creates a new SharepointList
|
void |
listDelete(String listId)
Deletes a Sharepoint list
|
SharepointList |
listGet(String listId)
Retrieves a Sharepoint list
|
List<SharepointList> |
listGetAll()
Retrieves all Sharepoint lists
|
Map<String,Object> |
listItemCreate(String listId,
Map<String,Object> properties)
Creates a new Item in an existing Sharepoint list
|
void |
listItemDelete(String listId,
String itemId)
Deletes an Item from a Sharepoint list
|
org.mule.streaming.ProviderAwarePagingDelegate<Map<String,Object>,SharepointOnlineConnector> |
listItemQuery(String query,
Boolean retrieveReferences,
org.mule.streaming.PagingConfiguration pagingConfiguration)
Executes a query against a Sharepoint list and returns list items that match the specified criteria
|
void |
listItemUpdate(String listId,
String itemId,
Map<String,Object> updatedProperties)
Updates an Item from a Sharepoint list
|
void |
listUpdate(String listId,
SharepointList list)
Updates the specified properties of a Sharepoint lists
|
List<Map<String,Object>> |
resolveCollection(String url)
Executes an HTTP GET against the Sharepoint API.
|
Map<String,Object> |
resolveObject(String url,
ResolveRequestType resolveRequestType,
Object body)
Executes an HTTP GET against the Sharepoint API (POST if body is blob).
|
void |
setConnectionStrategy(BaseSharepointConnectionStrategy connectionStrategy) |
void |
setMetadataManager(MetadataManager metadataManager) |
String |
translateQueryDsqlToNative(org.mule.common.query.DsqlQuery query)
Method that handles the request to transform a query from DSQL to Native QL
|
@QueryTranslator public String translateQueryDsqlToNative(org.mule.common.query.DsqlQuery query)
query
- the DSQL query object with the query to be transformed in native format@Paged @Processor @MetaDataScope(value=ListQueryCategory.class) public org.mule.streaming.ProviderAwarePagingDelegate<Map<String,Object>,SharepointOnlineConnector> listItemQuery(@Query(limit=false,offset=false) String query, @Default(value="false") @FriendlyName(value="Retrieve full objects for reference fields (note: large lists with many reference fields may take a long time to retrieve)") Boolean retrieveReferences, org.mule.streaming.PagingConfiguration pagingConfiguration) throws SharepointException
query
- Query in the format listId?queryStringretrieveReferences
- Retrieve referencespagingConfiguration
- pagination of resultsSharepointException
- when there is an error@Processor @MetaDataScope(value=ListCategory.class) public void listDelete(@MetaDataKeyParam @Default(value="#[payload]") String listId) throws SharepointException
listId
- (Mandatory) Id of the list to deleteSharepointException
- when there is an error@Processor @MetaDataScope(value=ListCategory.class) public SharepointList listGet(@MetaDataKeyParam @Default(value="#[payload]") String listId) throws SharepointException
listId
- (Mandatory) Id of the list to retrieveSharepointException
- when there is an error@Processor public List<SharepointList> listGetAll() throws SharepointException
SharepointException
- when there is an error@Processor @MetaDataScope(value=ListCategory.class) public void listUpdate(@MetaDataKeyParam String listId, @Default(value="#[payload]") SharepointList list) throws SharepointException
listId
- (Mandatory) Id of the list to updatelist
- (Mandatory) List Properties to updateSharepointException
- when there is an error@Processor public SharepointList listCreate(@Default(value="#[payload]") SharepointList list) throws SharepointException
list
- (Mandatory) Sharepoint List reference to createSharepointException
- when there is an error@Processor @MetaDataScope(value=ListCategory.class) public Map<String,Object> listItemCreate(@MetaDataKeyParam String listId, @Default(value="#[payload]") Map<String,Object> properties) throws SharepointException
listId
- (Mandatory) Id of the list where to create the Itemproperties
- (Mandatory) Properties of the item to createSharepointException
- when there is an error@Processor @MetaDataScope(value=ListCategory.class) public void listItemDelete(@MetaDataKeyParam String listId, @Default(value="#[payload]") String itemId) throws SharepointException
listId
- (Mandatory) Id of the list where to delete the ItemitemId
- (Mandatory) Id of the item to deleteSharepointException
- when there is an error@Processor @MetaDataScope(value=ListCategory.class) public SharePointAttachResult attachFile(@MetaDataKeyParam String listId, @Default(value="#[payload]") AttachmentInformation attachmentInfo, @Optional @Path String localFilePath) throws SharepointException
listId
- (Mandatory) Id of the list the item belongs toattachmentInfo
- (Mandatory) the attachment information.Contains the itemId of the list item, the file name and the file content represented as a stream. The stream and file name
must be given if localFilePath is emptylocalFilePath
- the path to the file. Mandatory if the attachmentInfo is not filled with the relevant file information.SharepointException
- when there is an error@Processor @MetaDataScope(value=ListCategory.class) public void listItemUpdate(@MetaDataKeyParam String listId, String itemId, @Default(value="#[payload]") Map<String,Object> updatedProperties) throws SharepointException
listId
- (Mandatory) Id of the list where to update the ItemitemId
- (Mandatory) Id of the item to updateupdatedProperties
- (Mandatory) Item properties to updateSharepointException
- when there is an error@Processor public SharepointFolder folderCreate(@Default(value="#[payload]") String url, @Optional String welcomePage) throws SharepointException
url
- (Mandatory) Server relative URL of the folder to create, e.g. /Shared Documents/new folder, creates a folder in the 'Shared Documents' listwelcomePage
- (Optional) Welcome page property of the folder, e.g. index.htmlSharepointException
- when there is an error@Processor public void folderDelete(@Default(value="#[payload]") String url) throws SharepointException
url
- (Mandatory) Server relative URL of the folder to delete, e.g. /Shared Documents/new folder, deletes 'new folder' from 'Shared Documents' listSharepointException
- when there is an error@Processor @MetaDataScope(value=FolderCategory.class) public List<Map<String,Object>> folderQuery(@Query(limit=false,offset=false) String query, @Default(value="/") String startingFolderPath, @Default(value="false") Boolean recursive) throws SharepointException
query
- (Mandayory) OData query in the format listDocumentName?queryString, e.g Shared Documents?$select=Name&$filter Name e.g. 'folderName'startingFolderPath
- (Optional) The starting path of the folder from where to begin the query, relative to the document library selected as part of the query below, e.g.
/myfolder/level2 search for folders inside /document library/myfolder/level2. [Note: you must specify the document library as part of the query below]recursive
- Specifies whether to search recursively in inner foldersSharepointException
- when there is an error@Processor public SharepointFile fileAdd(String fileServerRelativeUrl, @Default(value="#[payload]") InputStream fileContentStream, @Optional @Path String localFilePath, @Default(value="false") Boolean overwrite) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Path and file name of the destination, e.g. /Shared Documents/#[flowVars.originalFilename] creates a file in 'Shared Documents' libraryfileContentStream
- (Optional) The byte stream to be uploaded, e.g. #[payload] or #[file reference] . [Note: One of File Content Stream or Local File Path has to be specified]localFilePath
- (Optional) Physical file path of a file to upload, e.g. /local/path/to/file.ext. [Note: One of File Content Stream or Local File Path has to be specified]overwrite
- Specifies whether to overwrite the uploaded file if another with the same name already existsSharepointException
- when there is an error@Processor public void fileDelete(@Default(value="#[payload]") String fileServerRelativeUrl) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to delete, e.g. /Shared Documents/filename.ext deletes 'filename.ext' from 'Shared Documents' librarySharepointException
- when there is an error@Processor public SharepointFile fileGetMetadata(@Default(value="#[payload]") String fileServerRelativeUrl) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to retrieve, e.g. /Shared Documents/filename.ext retrieves 'filename.ext' from 'Shared Documents' librarySharepointException
- when there is an error@Processor public void fileUpdateMetadata(String fileServerRelativeUrl, @Default(value="#[payload]") Map<String,Object> updatedProperties) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to retrieve, e.g. /Shared Documents/filename.ext retrieves 'filename.ext' from 'Shared Documents' libraryupdatedProperties
- (Mandatory) File properties to updateSharepointException
- when there is an error@Processor public byte[] fileGetContent(@Default(value="#[payload]") String fileServerRelativeUrl) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to get the content, e.g. /Shared Documents/filename.ext gets the content of 'filename.ext' from 'Shared
Documents' librarySharepointException
- when there is an error@Processor public void fileCheckOut(@Default(value="#[payload]") String fileServerRelativeUrl) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to check out, e.g. /Shared Documents/filename.ext checks out 'filename.ext' in 'Shared Documents' librarySharepointException
- when there is an error@Processor public void fileUndoCheckOut(@Default(value="#[payload]") String fileServerRelativeUrl) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to undo the check out, e.g. /Shared Documents/filename.ext undoes the check out of 'filename.ext' in
'Shared Documents' librarySharepointException
- when there is an error@Processor public void fileCheckIn(@Default(value="#[payload]") String fileServerRelativeUrl, CheckInType checkInType, @Optional String comment) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to check in, e.g. /Shared Documents/filename.ext checks in 'filename.ext' in 'Shared Documents' librarycheckInType
- Check In type for te file: MinorCheckIn, MajorCheckIn or OverwriteCheckIncomment
- A comment for the check-inSharepointException
- when there is an error@Processor public void filePublish(@Default(value="#[payload]") String fileServerRelativeUrl, @Optional String comment) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to publish, e.g. /Shared Documents/filename.ext publishes 'filename.ext' in 'Shared Documents' librarycomment
- The comment for the published fileSharepointException
- when there is an error@Processor public void fileUnpublish(@Default(value="#[payload]") String fileServerRelativeUrl, @Optional String comment) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to unpublish, e.g. /Shared Documents/filename.ext unpublishes 'filename.ext' in 'Shared Documents' librarycomment
- The comment for the published fileSharepointException
- when there is an error@Processor public void fileApprove(@Default(value="#[payload]") String fileServerRelativeUrl, @Optional String comment) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to approve, e.g. /Shared Documents/filename.ext approves 'filename.ext' in 'Shared Documents' librarycomment
- The comment for the approvalSharepointException
- when there is an error@Processor public void fileDeny(@Default(value="#[payload]") String fileServerRelativeUrl, @Optional String comment) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to deny, e.g. /Shared Documents/filename.ext denies 'filename.ext' in 'Shared Documents' librarycomment
- The comment for the denialSharepointException
- when there is an error@Processor public void fileCopyTo(@Default(value="#[payload]") String fileServerRelativeUrl, String newFileServerRelativeUrl, @Default(value="false") Boolean overwrite) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to copy, e.g. /Shared Documents/filename.extnewFileServerRelativeUrl
- (Mandatory) Destination Sharepoint Server relative URL of the file to unpublish, e.g. /Shared Documents/new filename.ext copies to 'new filename.ext' in 'Shared
Documents' libraryoverwrite
- Specifies whether to overwrite a file with the same name in the same locationSharepointException
- when there is an error@Processor public String fileRecycle(@Default(value="#[payload]") String fileServerRelativeUrl) throws SharepointException
fileServerRelativeUrl
- (Mandatory) Sharepoint Server relative URL of the file to recycle, e.g. /Shared Documents/filename.ext recycle 'filename.ext' in 'Shared Documents' librarySharepointException
- when there is an error@Processor @MetaDataScope(value=FileCategory.class) public List<Map<String,Object>> fileQuery(@Query(limit=false,offset=false) String query, @Default(value="/") String startingFolderPath, @Default(value="false") Boolean recursive) throws SharepointException
query
- (Mandayory) OData query in the format listDocumentName?queryString, e.g Shared Documents?$select=Name&$filter Name eq 'filename'startingFolderPath
- (Optional) The starting path of the folder from where to begin the query, relative to the document library selected as part of the query below, e.g.
/myfolder/level2 search for files inside /document library/myfolder/level2. [Note: you must specify the document library as part of the query below]recursive
- Specifies whether to search recursively in inner foldersSharepointException
- when there is an error@Processor public Map<String,Object> resolveObject(String url, @Default(value="Get") @FriendlyName(value="Request Type") ResolveRequestType resolveRequestType, @Default(value="#[payload]") @FriendlyName(value="Request Body") Object body) throws SharepointException
url
- (Mandatory) The absolute or relative url to get.resolveRequestType
- The request type to be sent.body
- Body of the request to send. 'null' if empty request body.SharepointException
- when there is an error@Processor public List<Map<String,Object>> resolveCollection(String url) throws SharepointException
url
- (Mandatory) The absolute or relative url to get.SharepointException
- when there is an errorpublic BaseSharepointConnectionStrategy getConnectionStrategy()
public void setConnectionStrategy(BaseSharepointConnectionStrategy connectionStrategy)
public SharepointService getClient()
public MetadataManager getMetadataManager()
public void setMetadataManager(MetadataManager metadataManager)
Copyright © 2010–2020. All rights reserved.