Namespace: sharing

sharing

Manage the AskiaPortal sharing window.

Because the sharing mechanism is provided by AskiaPortal, the sharing window is standalone and will add/edit/delete the sharing directly without the requirement of an extra code from your side.

In order words, calling this window will all do the sharing job for you.

 // Show the sharing option of the `template` named "My Beautiful Template" (with id = 12) 
 // and managed by the current module
 portal.sharing.show({
     type : "templace",
     id   : 12,
     name : "My Beautiful Template",
     moduleGuid : "current"
 }).then(result => {
     console.log(result);
 });


 // Show the sharing option of the AskiaPortal `survey` named "EX" (with id = 1)
 portal.sharing.show({
     type : "survey",
     id   : 1,
     name : "EX",
     moduleGuid : askiaportal
 });
Dependencies:
  • ./js/portal.channel.js

Methods

(static) show(object) → {Promise}

Display the sharing dialog window from AskiaPortal

 // Show the sharing option of the `template` named "My Beautiful Template" (with id = 12) 
 // and managed by the current module
 portal.sharing.show({
     type : "templace",
     id   : 12,
     name : "My Beautiful Template",
     moduleGuid : "current"
 }).then(result => {
     console.log(result);
 });


 // Show the sharing option of the AskiaPortal `survey` named "EX" (with id = 1)
 portal.sharing.show({
     type : "survey",
     id   : 1,
     name : "EX",
     moduleGuid : askiaportal
 }).then(result => {
     console.log(result);
 });

 // Show the sharing option of the `entity` named "Entity name" (with id = 1)
 // managed by the module with the GUID = "cc39c520-7951-42c8-84ad-4fcfa9ccdf1f"
 portal.sharing.show({
     type : "entity",
     id   : 1,
     name : "Entity name",
     moduleGuid : "cc39c520-7951-42c8-84ad-4fcfa9ccdf1f"
 }).then(result => {
     console.log(result);
 });

 // Show the sharing option of the `item` named "Item name" (with id = 1)
 // managed by the module with the GUID = "cc39c520-7951-42c8-84ad-4fcfa9ccdf1f"
 // and part of the survey id = 12
 portal.sharing.show({
     type : "item",
     id   : 1,
     name : "Item name",
     moduleGuid : "cc39c520-7951-42c8-84ad-4fcfa9ccdf1f",
     surveyId : 12
 }).then(result => {
     console.log(result);
 });
Parameters:
Name Type Description
object Object

Object to share.

Properties
Name Type Attributes Description
type String

Type of the object to share.

name String

Name of the object to share.

id Number

Id of the object to share.

moduleGuid String

GUID of the module that contains the object (use "askiaportal" for AskiaPortal or "current" for the current displayed module).

surveyId Number <optional>

Identifier of the survey from where the object belongs to.

Returns:
Type
Promise