Sharing

Introduction

DCP uses the concept of share links to exchange views between different users. From a design pattern we differentiate between user generated share links and share links which were generated by processes (e.g. notifications) which we refer to as system generated share links. While user generated share links are available as favorites, system generated share links are hidden.

Share Links are stored in the DCP Core database. Simplified, the share link is a mapping between a GUID which is used by the user/in the URL and a JSON object stored. This object contains all required information to reload a specific presentation on the screen. The object structure is defined by the FE and varies between the different views. The DCP framework provides the functionality to persist these mappings. With a click on "Share" the FE builds the JSON object and calls the backend service for persistent storage. To reload the presentation, the following flow is implemented: In the FE apps the generated link leads the user to a component outside of Site scope (LayoutComponent), where the current selected site is compared against the site specified in the share link. If the Site ID is the same, the user is redirected to the share link destination. If not, an additional call to the SetUserSite is performed prior to the user redirect. The reason to do this outside of Site scope is that the Route Guards checking if the site is Active can result in a navigation loop. If the Module is active, but the user has no permissions for the site in the share link, the direct load of the share link destination and some of the Route Guards stopping the User are ending in a navigation loop.

Versioning

As share links for validated apps need to ensure downward compatibility at all times, DCP needs to convert between different formats as the application evolves. Therefore, share links need to be versioned. By default, all shared links do not have the property Link.additionalFilter.version. In cases where the property is missing, version 1 is assumed. To implement a new format for a page:

  • the shared link version is incremented
  • a convert method is added to convert from last version to the new one (or create the class itself if not exist)

Adapters

Are used to convert from one version/format to the next. If the conversion needs to happen across multiple versions, the adapters are chained. The converted object is then used to load the page.

erDiagram

SharedLinks  {
 	int(4) ID "UniqueId"
	nvarchar JLink 
	uniqueidentifier(16) LinkGUID 
	nvarchar(500) Title 
	bit(1) IsDelete 
	int(4) SiteID 
	datetime(8) DateCreated "Creation datetime in UTC"
	datetime(8) DateUpdated "Update datetime in UTC"
	int(4) UserIDCreated "The userId who created the entity"
	int(4) UserIDUpdated "The userId who made this change"
}

SystemGeneratedSharedLinks  {
 	int(4) ID "UniqueId"
	nvarchar JLink "JSON object storing the page configuration to reload the page"
	uniqueidentifier(16) LinkGUID "Unique GUID used in the URL for the look-up"
	bit(1) IsDelete "Flag if this link is soft deleted"
	datetime(8) DateCreated "Creation datetime in UTC"
	int(4) SiteID "Relation to the site for which the data should be displayed"
}

ShareLinkAlias  {
 	int(4) ID "UniqueId"
	nvarchar(500) Name "User defined name of the share link alias"
	int(4) SharedLinkID 
	int(4) LastModifiedBy 
	int(4) OwnerUserId 
	datetime2(8) SysStartTime 
	datetime2(8) SysEndTime 
}

SharedLinks ||--o{ ShareLinkAlias : "mapped to"

Records classification and audit trail

Specification Value
Content/Overview Share Links store objects to reload a dedicated presentation on the screen
Data classification Convenience records - user settings only
Change Tracking No change tracking
Audit Trail N/A
Retention period 3 years
This page was last edited on 19 August 2024, 15:10 (UTC).