sharepoint_connector
Facilitates content synchronization between Drupal websites and Sharepoint lists using the Microsoft Graph API. Easily send your content and user submitted data directly into Sharepoint.
Features
- Seamless Integration with Microsoft Graph API: The module is tailored to effortlessly connect with the Microsoft Graph API, ensuring swift and smooth content synchronization between your Drupal site and Sharepoint lists.
- Granular Content Synchronization: Offering the unique ability to configure field-level mappings between Drupal and Sharepoint, users can ensure that specific data is sent to the corresponding columns in Sharepoint lists. Each content type or webform can be individually enabled and mapped.
- Secure API Key Management: Recognizing the importance of security, the module provides a dual method for API key integration. Users can either directly input credentials or, for enhanced security, pull credentials from environment variables in the settings.php file.
- Webform Data Synchronization: For sites utilizing the Webform module, the Sharepoint Connector not only synchronizes content but also user-submitted data. Once a webform is submitted and saved in Drupal, its data is immediately synced with the configured Sharepoint list.
- Dedicated Configuration & Settings UI: Users can navigate through a comprehensive settings page, with distinct tabs for Content Types and Webforms, making it easier to configure and manage the module.
- Editing and Deletion Capabilities: Once configurations for content types or webforms are added, users are provided with easy-to-use edit and delete options, ensuring flexibility and control over data mapping.
- Dynamic URL Assignments: To give users the utmost control, each content type and webform can have its own unique Sharepoint list URL. This is apart from the default URL set in the main settings page, providing granular control over data synchronization destinations.
- Automatic Data Transfer: After the initial setup and configuration, the module takes care of everything. When an enabled content type or webform submission is saved, its data is auto-magically sent to the configured Sharepoint list without any further user intervention.
Post-Installation
Navigate to the module's settings page.
1. Input Credentials Directly:
- Enter
Client ID,Client Secret,Tenant ID, and theBase URLfor your Sharepoint list.
To enhance security, instead of storing the API keys in the database, you can use environment variables in the
settings.phpfile.
2. Using Environment Variables:
- Set the following environment variables in the
settings.phpfile:
$config['sharepoint_connector.settings']['client_id'] = getenv('CLIENT_ID_ENV_VAR');
$config['sharepoint_connector.settings']['client_secret'] = getenv('CLIENT_SECRET_ENV_VAR');
$config['sharepoint_connector.settings']['tenant_id'] = getenv('TENANT_ID_ENV_VAR');
$config['sharepoint_connector.settings']['host'] = getenv('BASE_URL_ENV_VAR');
Usage
Content Type Synchronization
- Navigate to the Sharepoint Connector settings page from the Extend or Configuration page.
- Click on the second tab on the module's settings page
Content Types. Here, you'll see a list of all content types available on your Drupal website - Click the
Addbutton corresponding to a content type to configure field mapping between Drupal and Sharepoint.
If a configuration already exists for a content type, theAddbutton will be replaced by anEditbutton. Clicking the dropdown arrow on the right of the button will also present an option toDeletethe settings for that content type. - This will navigate you to a page where all fields for that content type are listed with checkboxes next to them.
- Checking a box reveals a text field. Here, input the corresponding Sharepoint list column name where you want the Drupal field data to be sent.
- Each content type can have a unique Sharepoint list URL, different from the default one set in the main settings page. This provides granular control over where each content type's data is sent.
- After mapping all desired fields, save the settings.
Webform Synchronization (for sites with the Webform module installed)
- Navigate to the Sharepoint Connector settings page from the Extend or Configuration page.
- Click on the second tab on the module's settings page
Webforms. Here, you'll see a list of all webforms available on your Drupal website. - Click the
Addbutton corresponding to a webform to configure field mapping between the webform's fields and Sharepoint.
If a configuration already exists for a webform**, theAddbutton will be replaced by anEditbutton. Clicking the dropdown arrow on the right of the button will also present an option toDeletethe settings for that webform. - This will navigate you to a page where all fields for that webform are listed with checkboxes next to them.
- Checking a box reveals a text field. Here, input the corresponding Sharepoint list column name where you want the webform field data to be sent.
- Each webform can have its unique Sharepoint list URL, different from the default one set in the main settings page. This provides granular control over where each webform's submission data is sent.
- After mapping all desired fields, save the settings.
Once the module settings are configured and the fields are mapped and enabled data will automatically be sent to the configured SharePoint list(s) via the Microsoft Graph API:
- Whenever a content item of an enabled type is saved
- Whenever a submission of an enabled webform is saved
Additional Requirements
Before using this module, users need to generate Microsoft Graph API keys in order to send data to SharePoint. Follow the instructions in the README file to generate keys via the Azure portal using Office 365 credentials and to retrieve Sharepoint list URLs. More information can be found on the Microsoft website.
Remember to keep the client ID, client secret, and tenant ID private, as they can be used to access your resources on Microsoft Graph API.