| Title: | 'Microsoft SharePoint' Interface for the 'connector' Package |
|---|---|
| Description: | Extends the 'connector' package to provide a convenient interface for accessing and interacting with 'Microsoft SharePoint' directly from 'R'. Supports listing, reading, writing, uploading, downloading, and removing files and directories on 'SharePoint' document libraries. Authentication is handled through 'Azure' tokens via the 'AzureAuth' package. |
| Authors: | Vladimir Obucina [aut, cre] (ORCID: <https://orcid.org/0009-0008-2608-2661>), Cervan Girard [aut], Aksel Thomsen [aut], Steffen Falgreen Larsen [aut], Novo Nordisk A/S [cph] |
| Maintainer: | Vladimir Obucina <[email protected]> |
| License: | Apache License (>= 2) |
| Version: | 0.1.0 |
| Built: | 2026-06-01 16:47:43 UTC |
| Source: | https://github.com/cran/connector.sharepoint |
Addition list content methods for sharepoint connectors implemented for
connector::create_directory_cnt():
ConnectorSharepoint: Reuses the connector::create_directory_cnt()
method for ConnectorSharepoint()
create_directory_cnt(connector_object, name, open = TRUE, ...) ## S3 method for class 'ConnectorSharepoint' create_directory_cnt(connector_object, name, open = TRUE, ...)create_directory_cnt(connector_object, name, open = TRUE, ...) ## S3 method for class 'ConnectorSharepoint' create_directory_cnt(connector_object, name, open = TRUE, ...)
connector_object |
Connector The connector object to use. |
name |
character The name of the directory to create |
open |
create a new connector object |
... |
ConnectorSharepoint: Additional parameters to pass to
|
ConnectorSharepoint object or ConnectorSharepoint object of a newly built directory
Generic implementing of how to disconnect from the relevant connections. Mostly relevant for DBI connectors.
ConnectorDBI: Uses DBI::dbDisconnect() to create a table reference to close a DBI connection.
disconnect_cnt(connector_object, ...)disconnect_cnt(connector_object, ...)
connector_object |
Connector The connector object to use. |
... |
Additional arguments passed to the method for the individual connector. |
invisible connector_object.
Addition list content methods for sharepoint connectors implemented for
connector::download_cnt():
ConnectorSharepoint: Reuses the connector::download_cnt()
method for ConnectorSharepoint()
download_cnt(connector_object, src, dest = basename(src), ...) ## S3 method for class 'ConnectorSharepoint' download_cnt(connector_object, src, dest = basename(src), ...)download_cnt(connector_object, src, dest = basename(src), ...) ## S3 method for class 'ConnectorSharepoint' download_cnt(connector_object, src, dest = basename(src), ...)
connector_object |
Connector The connector object to use. |
src |
The name of the file to download from SharePoint |
dest |
The local path to save the downloaded file |
... |
ConnectorSharepoint: Additional parameters to pass to the
|
ConnectorSharepoint object
Addition list content methods for sharepoint connectors implemented for
connector::download_directory_cnt():
download_directory_cnt(connector_object, src, dest = basename(src), ...) ## S3 method for class 'ConnectorSharepoint' download_directory_cnt( connector_object, src, dest = basename(src), ..., recursive = TRUE )download_directory_cnt(connector_object, src, dest = basename(src), ...) ## S3 method for class 'ConnectorSharepoint' download_directory_cnt( connector_object, src, dest = basename(src), ..., recursive = TRUE )
connector_object |
Connector The connector object to use. |
src |
The name of the directory to download from SharePoint |
dest |
The local directory path to save the downloaded content |
... |
additional parameters passed on to |
recursive |
If |
ConnectorSharepoint object
Two solutions are possible:
The user has set the environment variable SHAREPOINT_AZURE_HASH
The user has set the file .active_hash in the AzureR directory
get_default_hash()get_default_hash()
A character string with the token hash, or NULL if not found
## Not run: hash <- get_default_hash() ## End(Not run)## Not run: hash <- get_default_hash() ## End(Not run)
Retrieve a token from the AzureAuth package
get_token(hash = get_default_hash())get_token(hash = get_default_hash())
hash |
The hash of the token to use. By default, use this function to retrieve it get_default_hash. If not found, use the first token found. |
An AzureAuth::AzureToken object
## Not run: token <- get_token() ## End(Not run)## Not run: token <- get_token() ## End(Not run)
Addition list content methods for sharepoint connectors implemented for
connector::list_content_cnt():
ConnectorSharepoint: Reuses the connector::list_content_cnt()
method for ConnectorSharepoint()
list_content_cnt(connector_object, ...) ## S3 method for class 'ConnectorSharepoint' list_content_cnt(connector_object, ...)list_content_cnt(connector_object, ...) ## S3 method for class 'ConnectorSharepoint' list_content_cnt(connector_object, ...)
connector_object |
Connector The connector object to use. |
... |
ConnectorSharepoint: Additional parameters to pass to the
|
A character vector of content names
ConnectorSharepoint: Implementation of the log_read_connector
function for the ConnectorSharepoint class.
Addition log read methods for sharepoint connectors implemented for
connector::log_read_connector():
## S3 method for class 'ConnectorSharepoint' log_read_connector(connector_object, name, ...) log_read_connector(connector_object, name, ...)## S3 method for class 'ConnectorSharepoint' log_read_connector(connector_object, name, ...) log_read_connector(connector_object, name, ...)
connector_object |
The connector object to log operations for. Can be any connector class (ConnectorFS, ConnectorDBI, ConnectorLogger, etc.) |
name |
Character string specifying the name or identifier of the resource being operated on (e.g., file name, table name) |
... |
Additional parameters passed to specific method implementations. May include connector-specific options or metadata. |
Connector Logging Functions
The logging system is built around S3 generic functions that dispatch to specific implementations based on the connector class. Each operation is logged with contextual information including connector details, operation type, and resource names.
These are primarily side-effect functions that perform logging. The actual return value depends on the specific method implementation, typically:
log_read_connector: Result of the read operation
log_write_connector: Invisible result of write operation
log_remove_connector: Invisible result of remove operation
log_list_content_connector: List of connector contents
ConnectorSharepoint: Implementation of the log_remove_connector
function for the ConnectorSharepoint class.
Addition log remove methods for sharepoint connectors implemented for
connector::log_remove_connector():
## S3 method for class 'ConnectorSharepoint' log_remove_connector(connector_object, name, ...) log_remove_connector(connector_object, name, ...)## S3 method for class 'ConnectorSharepoint' log_remove_connector(connector_object, name, ...) log_remove_connector(connector_object, name, ...)
connector_object |
The connector object to log operations for. Can be any connector class (ConnectorFS, ConnectorDBI, ConnectorLogger, etc.) |
name |
Character string specifying the name or identifier of the resource being operated on (e.g., file name, table name) |
... |
Additional parameters passed to specific method implementations. May include connector-specific options or metadata. |
Connector Logging Functions
The logging system is built around S3 generic functions that dispatch to specific implementations based on the connector class. Each operation is logged with contextual information including connector details, operation type, and resource names.
These are primarily side-effect functions that perform logging. The actual return value depends on the specific method implementation, typically:
log_read_connector: Result of the read operation
log_write_connector: Invisible result of write operation
log_remove_connector: Invisible result of remove operation
log_list_content_connector: List of connector contents
ConnectorSharepoint: Implementation of the log_write_connector
function for the ConnectorSharepoint class.
Addition log write methods for sharepoint connectors implemented for
connector::log_write_connector():
## S3 method for class 'ConnectorSharepoint' log_write_connector(connector_object, name, ...) log_write_connector(connector_object, name, ...)## S3 method for class 'ConnectorSharepoint' log_write_connector(connector_object, name, ...) log_write_connector(connector_object, name, ...)
connector_object |
The connector object to log operations for. Can be any connector class (ConnectorFS, ConnectorDBI, ConnectorLogger, etc.) |
name |
Character string specifying the name or identifier of the resource being operated on (e.g., file name, table name) |
... |
Additional parameters passed to specific method implementations. May include connector-specific options or metadata. |
Connector Logging Functions
The logging system is built around S3 generic functions that dispatch to specific implementations based on the connector class. Each operation is logged with contextual information including connector details, operation type, and resource names.
These are primarily side-effect functions that perform logging. The actual return value depends on the specific method implementation, typically:
log_read_connector: Result of the read operation
log_write_connector: Invisible result of write operation
log_remove_connector: Invisible result of remove operation
log_list_content_connector: List of connector contents
Addition read methods for sharepoint connectors implemented for
connector::read_cnt():
ConnectorSharepoint: Reuses the connector::read_cnt()
method for ConnectorSharepoint()
read_cnt(connector_object, name, ...) ## S3 method for class 'ConnectorSharepoint' read_cnt(connector_object, name, ...)read_cnt(connector_object, name, ...) ## S3 method for class 'ConnectorSharepoint' read_cnt(connector_object, name, ...)
connector_object |
Connector The connector object to use. |
name |
The name of the file to read |
... |
ConnectorSharepoint: Additional parameters to pass to the
|
R object with the content. For rectangular data a data.frame.
Addition remove methods for sharepoint connectors implemented for
connector::remove_cnt():
ConnectorSharepoint: Reuses the connector::remove_cnt()
method for ConnectorSharepoint()
remove_cnt(connector_object, name, ...) ## S3 method for class 'ConnectorSharepoint' remove_cnt(connector_object, name, ...)remove_cnt(connector_object, name, ...) ## S3 method for class 'ConnectorSharepoint' remove_cnt(connector_object, name, ...)
connector_object |
Connector The connector object to use. |
name |
character Name of the content to read, write, or remove. Typically the table name. |
... |
ConnectorSharepoint: Additional parameters to pass to the
|
ConnectorSharepoint object
Addition list content methods for sharepoint connectors implemented for
connector::remove_directory_cnt():
ConnectorSharepoint: Reuses the connector::remove_directory_cnt()
method for ConnectorSharepoint()
remove_directory_cnt(connector_object, name, ...) ## S3 method for class 'ConnectorSharepoint' remove_directory_cnt(connector_object, name, ...)remove_directory_cnt(connector_object, name, ...) ## S3 method for class 'ConnectorSharepoint' remove_directory_cnt(connector_object, name, ...)
connector_object |
Connector The connector object to use. |
name |
character The name of the directory to remove |
... |
ConnectorSharepoint: Additional parameters to pass to
|
ConnectorSharepoint object
Addition tbl methods for sharepoint connectors implemented for
connector::tbl_cnt():
ConnectorSharepoint: Uses read_cnt() to allow redundancy.
tbl_cnt(connector_object, name, ...) ## S3 method for class 'ConnectorSharepoint' tbl_cnt(connector_object, name, ...)tbl_cnt(connector_object, name, ...) ## S3 method for class 'ConnectorSharepoint' tbl_cnt(connector_object, name, ...)
connector_object |
Connector The connector object to use. |
name |
character Name of the content to read, write, or remove. Typically the table name. |
... |
Additional arguments passed to the method for the individual connector. |
A dplyr::tbl object.
Addition list content methods for sharepoint connectors implemented for
connector::upload_cnt():
ConnectorSharepoint: Reuses the connector::upload_cnt()
method for ConnectorSharepoint()
upload_cnt( connector_object, src, dest = basename(src), overwrite = zephyr::get_option("overwrite", "connector"), ... ) ## S3 method for class 'ConnectorSharepoint' upload_cnt( connector_object, src, dest = basename(src), overwrite = zephyr::get_option("overwrite", "connector.sharepoint"), ..., recursive = FALSE )upload_cnt( connector_object, src, dest = basename(src), overwrite = zephyr::get_option("overwrite", "connector"), ... ) ## S3 method for class 'ConnectorSharepoint' upload_cnt( connector_object, src, dest = basename(src), overwrite = zephyr::get_option("overwrite", "connector.sharepoint"), ..., recursive = FALSE )
connector_object |
Connector The connector object to use. |
src |
The local file path to upload |
dest |
The destination name/path in SharePoint |
overwrite |
Overwrite existing content if it exists in the connector?
See connector-options for details. Default can be set globally with
|
... |
ConnectorSharepoint: Additional parameters to pass to
the |
recursive |
If |
ConnectorSharepoint object
Addition list content methods for sharepoint connectors implemented for
connector::upload_directory_cnt():
upload_directory_cnt( connector_object, src, dest, overwrite = zephyr::get_option("overwrite", "connector"), open = FALSE, ... ) ## S3 method for class 'ConnectorSharepoint' upload_directory_cnt( connector_object, src, dest = basename(src), overwrite = zephyr::get_option("overwrite", "connector.sharepoint"), open = FALSE, ..., recursive = TRUE )upload_directory_cnt( connector_object, src, dest, overwrite = zephyr::get_option("overwrite", "connector"), open = FALSE, ... ) ## S3 method for class 'ConnectorSharepoint' upload_directory_cnt( connector_object, src, dest = basename(src), overwrite = zephyr::get_option("overwrite", "connector.sharepoint"), open = FALSE, ..., recursive = TRUE )
connector_object |
Connector The connector object to use. |
src |
The local directory path to upload |
dest |
The destination directory name/path in SharePoint |
overwrite |
Overwrite existing content if it exists in the connector?
See connector-options for details. Default can be set globally with
|
open |
logical Open the directory as a new connector object. |
... |
additional parameters passed on to |
recursive |
If |
ConnectorSharepoint object
Addition write methods for sharepoint connectors implemented for
connector::write_cnt():
ConnectorSharepoint: Reuses the connector::write_cnt()
method for ConnectorSharepoint()
write_cnt( connector_object, x, name, overwrite = zephyr::get_option("overwrite", "connector"), ... ) ## S3 method for class 'ConnectorSharepoint' write_cnt( connector_object, x, name, overwrite = zephyr::get_option("overwrite", "connector.sharepoint"), ... )write_cnt( connector_object, x, name, overwrite = zephyr::get_option("overwrite", "connector"), ... ) ## S3 method for class 'ConnectorSharepoint' write_cnt( connector_object, x, name, overwrite = zephyr::get_option("overwrite", "connector.sharepoint"), ... )
connector_object |
Connector The connector object to use. |
x |
The object to write to the connection |
name |
character Name of the content to read, write, or remove. Typically the table name. |
overwrite |
Overwrite existing content if it exists in the connector?
See connector-options for details. Default can be set globally with
|
... |
ConnectorSharepoint: Additional parameters to pass to the
|
invisible connector_object.