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:

PropertyTypeDescription
sharedEntitySharedEntityObject containing the Shared Entity that has changed
adaptableContextanyCustom 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:

PropertyTypeDescription
ChangedAtnumberLast time when the object was changed
ChangedBystringLast User who changed the object
DescriptionstringDescription of object being shared
EntityAdaptableObjectActual Adaptable Object being shared
EntityDependencyIdsTypeUuid[]Ids of direct entity dependencies
EntityType'adaptableEntity'Type of shared entity (either Adaptable specific or custom object)
ModuleAdaptableModuleAdaptable Module to which object belongs
RevisionnumberRevision - incremental for 'Active', always 1 for 'Snapshot'
TimestampnumberWhen the object was shared
TypeSharedEntityType'Snapshot' (for 1-time sharing) or 'Active' (for continuous sharing)
UserNamestringUser who shared the object
IsReadOnlybooleanSets 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

PropertyTypeDescriptionDefault
applySharedEntities(sharedEntities:SharedEntity[], context:SharedEntitiesContext) =>SharedEntity[]Allows hooking into Shared Entities loading process
enableTeamSharingbooleanWhether Team Sharing is enabledfalse
handleCustomSharedEntityImport(sharedEntity:CustomSharedEntity, context:SharedEntitiesContext) => voidHandles import of Custom Shared Entities
loadSharedEntities(context:SharedEntitiesContext) => Promise<SharedEntity[]>(Async) Loads available Shared Entities - user can download and auto-merge with Adaptable Statenull
persistSharedEntities(sharedEntities:SharedEntity[], context:SharedEntitiesContext) => Promise<void>(Async) Persists Shared Entities so that they can be downloaded by other team membersnull
saveSharedEntities(sharedEntities:SharedEntity[], context:SharedEntitiesContext) =>SharedEntity[]Allows hooking into Shared Entities persistence process
showUpdateNotificationOncePerUpdatebooleanWhether to show update notification once per updatefalse
suppressOverrideConfigWarningbooleanSuppress warning when an Import overrides existing Adaptable State itemfalse
updateIntervalnumberFrequency (in minutes) to check if Active Shared Entities have a newer revision0 (never)
updateNotification'Alert' | 'AlertWithNotification' | 'SystemStatus'How user is informed when Active Shared Entities have newer revisionsnull (none)

Team Sharing API

Full programmatic access to Team Sharing is available in Team Sharing API.

MethodReturnsDescription
checkForUpdates()voidChecks 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()booleanWhether current user has full Team Sharing rights (for creating & updating shared items)
importSharedEntry(sharedEntity)voidImport the given Shared Entity. In case of CustomSharedEntity, the import logic will be delegated to TeamSharingOptions.handleCustomSharedEntityImport(...).
isTeamSharingAvailable()booleanWhether Team Sharing is available to use
loadSharedEntities()Promise<SharedEntity[]>Retrieves all currently shared entities; async operation leveraging TeamSharingOptions.loadSharedEntities(...) method
openTeamSharingSettingsPanel()voidOpens Settings Panel with Team Sharing section selected and visible
persistSharedEntities(sharedEntities)Promise<boolean>Sets currently shared entities; async operation leveraging TeamSharingOptions.persistSharedEntities(...) method
refreshTeamSharing()voidRefreshes the local TeamSharing state by (re)loading the remote state.
shareAdaptableEntity(adaptableObject, module, sharedEntityConfig)voidPuts an Adaptable Object into Team Share
shareCustomEntity(customObject, sharedEntityConfig)voidPuts an custom Object into Team Share
unshareEntity(entityId)voidRemoves a Shared Entity from the Team Share.