Team Sharing Technical Reference
Summary
- AdapTable fires an Event when an Active Shared Entity is updated
- The Team Sharing API enables run-time, progamattic access to Team Sharing
Team Sharing Event
AdapTable fires the TeamSharingEntityChanged Event whenever an Active Shared Entity is sychronised.
TeamSharingEntityChangedInfo
The TeamSharingEntityChangedInfo object provided by the event contains a single sharedEntity property:
| Property | Type | Description |
|---|---|---|
| sharedEntity | SharedEntity | Object containing the Shared Entity that has changed |
| adaptableContext | any | Custom application Context provided in AdaptableOptions.adaptableContext |
It is of type sharedentity which provides very full details of what is shared and when and how it was updated:
| Property | Type | Description |
|---|---|---|
| ChangedAt | number | Last time when the object was changed |
| ChangedBy | string | Last User who changed the object |
| Description | string | Description of object being shared |
| Entity | AdaptableObject | Actual Adaptable Object being shared |
| EntityDependencyIds | TypeUuid[] | Ids of direct entity dependencies |
| EntityType | 'adaptableEntity' | Type of shared entity (either Adaptable specific or custom object) |
| Module | AdaptableModule | Adaptable Module to which object belongs |
| Revision | number | Revision - incremental for 'Active', always 1 for 'Snapshot' |
| Timestamp | number | When the object was shared |
| Type | SharedEntityType | 'Snapshot' (for 1-time sharing) or 'Active' (for continuous sharing) |
| UserName | string | User who shared the object |
| IsReadOnly | boolean | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full') |
Event Subscription
Subscribing to the Event is done the same way as with all Adaptable Events:
api.eventApi.on('TeamSharingEntityChanged', (eventInfo: TeamSharingEntityChangedInfo) => {
// do something with the info
});Team Sharing Options
There are a number of properties to configure Team Sharing Team Sharing Options
| Property | Type | Description | Default |
|---|---|---|---|
| applySharedEntities | (sharedEntities:SharedEntity[], context:SharedEntitiesContext) =>SharedEntity[] | Allows hooking into Shared Entities loading process | |
| enableTeamSharing | boolean | Whether Team Sharing is enabled | false |
| handleCustomSharedEntityImport | (sharedEntity:CustomSharedEntity, context:SharedEntitiesContext) => void | Handles import of Custom Shared Entities | |
| loadSharedEntities | (context:SharedEntitiesContext) => Promise<SharedEntity[]> | (Async) Loads available Shared Entities - user can download and auto-merge with Adaptable State | null |
| persistSharedEntities | (sharedEntities:SharedEntity[], context:SharedEntitiesContext) => Promise<void> | (Async) Persists Shared Entities so that they can be downloaded by other team members | null |
| saveSharedEntities | (sharedEntities:SharedEntity[], context:SharedEntitiesContext) =>SharedEntity[] | Allows hooking into Shared Entities persistence process | |
| showUpdateNotificationOncePerUpdate | boolean | Whether to show update notification once per update | false |
| suppressOverrideConfigWarning | boolean | Suppress warning when an Import overrides existing Adaptable State item | false |
| updateInterval | number | Frequency (in minutes) to check if Active Shared Entities have a newer revision | 0 (never) |
| updateNotification | 'Alert' | 'AlertWithNotification' | 'SystemStatus' | How user is informed when Active Shared Entities have newer revisions | null (none) |
Team Sharing API
Full programmatic access to Team Sharing is available in Team Sharing API.
| Method | Returns | Description |
|---|---|---|
| checkForUpdates() | void | Checks if active Shared Entities have updates (higher revisions than the local counterpart objects) |
| getLoadedAdaptableSharedEntities() | AdaptableSharedEntity[] | Retrieves locally loaded Adaptable Shared Entries. |
| getLoadedCustomSharedEntities() | CustomSharedEntity[] | Retrieves locally loaded Custom Shared Entries. |
| getLoadedSharedEntities() | SharedEntity[] | Retrieves all locally loaded shared entries (AdaptableSharedEntity & CustomSharedEntity). |
| hasTeamSharingFullRights() | boolean | Whether current user has full Team Sharing rights (for creating & updating shared items) |
| importSharedEntry(sharedEntity) | void | Import the given Shared Entity. In case of CustomSharedEntity, the import logic will be delegated to TeamSharingOptions.handleCustomSharedEntityImport(...). |
| isTeamSharingAvailable() | boolean | Whether Team Sharing is available to use |
| loadSharedEntities() | Promise<SharedEntity[]> | Retrieves all currently shared entities; async operation leveraging TeamSharingOptions.loadSharedEntities(...) method |
| openTeamSharingSettingsPanel() | void | Opens Settings Panel with Team Sharing section selected and visible |
| persistSharedEntities(sharedEntities) | Promise<boolean> | Sets currently shared entities; async operation leveraging TeamSharingOptions.persistSharedEntities(...) method |
| refreshTeamSharing() | void | Refreshes the local TeamSharing state by (re)loading the remote state. |
| shareAdaptableEntity(adaptableObject, module, sharedEntityConfig) | void | Puts an Adaptable Object into Team Share |
| shareCustomEntity(customObject, sharedEntityConfig) | void | Puts an custom Object into Team Share |
| unshareEntity(entityId) | void | Removes a Shared Entity from the Team Share. |