diff --git a/docs/add-functionality/add-event.md b/docs/add-functionality/add-event.md index 4d84c8e..c6bf4cd 100644 --- a/docs/add-functionality/add-event.md +++ b/docs/add-functionality/add-event.md @@ -141,74 +141,6 @@ embedDossier.registerEventHandler(EventType.ON_FILTER_UPDATED, filterUpdatedHand } ``` -### onError - -#### Event enumeration - -`EventType.ON_ERROR` - -#### Description - -Raised when an error occurs. - -#### Content - -Error object. - -#### Code example - -```js -embedDossier.registerEventHandler(EventType.ON_ERROR, errorHandler); -``` - -#### Content example - -```json -{ - "title": "Existing Live Session", - "message": "Invalid access token", - "desc": "You're logged in from another tab or window. Please refresh your session to see the latest updates.", - "errorCode": "ERR003_2", - "iServerErrorCode": "", - "statusCode": 401, - "ticketId": "e71565e0c8434133a4a4a53a56d92efb" -} -``` - -### onSessionError - -#### Event enumeration - -`EventType.ON_SESSION_ERROR` - -#### Description - -Raised when a session error occurs. - -#### Content - -Error object. - -#### Code example - -```js -embedDossier.registerEventHandler(EventType.ON_SESSION_ERROR, sessionErrorHandler); -``` - -#### Content example - -```json -{ - "title": "Existing Live Session", - "message": "Invalid access token", - "desc": "You're logged in from another tab or window. Please refresh your session to see the latest updates.", - "errorCode": "ERR003_2", - "iServerErrorCode": "", - "statusCode": 401, - "ticketId": "e71565e0c8434133a4a4a53a56d92efb" -} -``` - ### onPageLoaded #### Event enumeration @@ -429,79 +361,62 @@ embedDossier.registerEventHandler(EventType.ON_VISUALIZATION_RESIZED, vizResized } ``` -### onLibraryItemSelected +### onDossierInstanceIDChange #### Event enumeration -`EventType.ON_LIBRARY_ITEM_SELECTED` +`EventType.ON_DOSSIER_INSTANCE_ID_CHANGE` #### Description -Raised when a library item selected. Need library item select mode to be enabled. +Raised when the embedded dossier instance id changes. #### Content -Object containing library item selection information. +String of the new instance id. #### Code example ```js -embedDossier.registerEventHandler(EventType.ON_LIBRARY_ITEM_SELECTED, libraryItemSelectionHandler); +embedDossier.registerEventHandler(EventType.ON_DOSSIER_INSTANCE_ID_CHANGE, dossierChangedHandler); ``` #### Content example -```json -[ - { - "id": "A7B1C43C4ABA7E499D4E1789A2EBCD55", - "docId": "BFB749B340572473A1288E9A2F6EDDA6", - "projectId": "B19DEDCC11D4E0EFC000EB9495D0F44F", - "name": "Distribution Center & Brands", - "type": 55, - "subtype": null - } -] -``` +"003EB6548141F191CC73308269BB2635" -### onLibraryMenuSelected +### onDossierAuthoringSaved #### Event enumeration -`EventType.ON_LIBRARY_MENU_SELECTED` +`EventType.ON_DOSSIER_AUTHORING_SAVED` #### Description -Raised when a library menu selected. +Raised when a dossier is saved after authoring or editing. #### Content -Object containing library menu selection information. +None #### Code example ```js -embedDossier.registerEventHandler(EventType.ON_LIBRARY_MENU_SELECTED, libraryMenuSelectionHandler); -``` - -#### Content example - -```json -{ - "menuKey": "myContent", - "groupId": null -} +embedDossier.registerEventHandler( + EventType.ON_DOSSIER_AUTHORING_SAVED, + dossierAuthoringSavedHandler +); ``` -### onLibraryItemSelectionCleared +### onDossierAuthoringClosed #### Event enumeration -`EventType.ON_LIBRARY_ITEM_SELECTION_CLEARED` +`EventType.ON_DOSSIER_AUTHORING_CLOSED` #### Description -Raised when a library item selection cleared. +Raised when the authoring or edit mode of dossier is closed. #### Content @@ -511,99 +426,114 @@ None ```js embedDossier.registerEventHandler( - EventType.ON_LIBRARY_ITEM_SELECTION_CLEARED, - libraryItemSelectioClearnHandler + EventType.ON_DOSSIER_AUTHORING_CLOSED, + dossierAuthoringClosedHandler ); ``` -### onDossierInstanceIDChange +### onPageRenderFinished #### Event enumeration -`EventType.ON_DOSSIER_INSTANCE_ID_CHANGE` +`EventType.ON_PAGE_RENDER_FINISHED` #### Description -Raised when the embedded dossier instance id changes. +Raised when the dossier consumption page finishes rendering. #### Content -String of the new instance id. +None #### Code example ```js -embedDossier.registerEventHandler(EventType.ON_DOSSIER_INSTANCE_ID_CHANGE, dossierChangedHandler); +embedDossier.registerEventHandler(EventType.ON_PAGE_RENDER_FINISHED, pageRenderFinishedHandler); ``` -#### Content example - -"003EB6548141F191CC73308269BB2635" - -### onDossierAuthoringSaved +### onDossierInstanceChanged #### Event enumeration -`EventType.ON_DOSSIER_AUTHORING_SAVED` +`EventType.ON_DOSSIER_INSTANCE_CHANGED` #### Description -Raised when a dossier is saved after authoring or editing. +Raised when the a new dossier instance is created on a dossier consumption page. #### Content -None +The event callback parameters contain the project id, dossier id and the instance id. #### Code example ```js -embedDossier.registerEventHandler( - EventType.ON_DOSSIER_AUTHORING_SAVED, - dossierAuthoringSavedHandler -); +embedDossier.registerEventHandler(EventType.ON_DOSSIER_INSTANCE_CHANGED, (content) => { + // Use the content here +}); ``` -### onDossierAuthoringClosed - -#### Event enumeration - -`EventType.ON_DOSSIER_AUTHORING_CLOSED` - -#### Description - -Raised when the authoring or edit mode of dossier is closed. - -#### Content - -None - -#### Code example +#### Content example -```js -embedDossier.registerEventHandler( - EventType.ON_DOSSIER_AUTHORING_CLOSED, - dossierAuthoringClosedHandler -); +```json +{ + "projectId": "B19DEDCC11D4E0EFC000EB9495D0F44F", + "dossierId": "D9AB379D11EC92C1D9DC0080EFD415BB", + "instanceId": "EC003BC7A046E75DE83373A254824F20" +} ``` -### onPageRenderFinished +### onComponentSelectionChanged #### Event enumeration -`EventType.ON_PAGE_RENDER_FINISHED` +`EventType.ON_COMPONENT_SELECTION_CHANGED` #### Description -Raised when the page finishes rendering. +Raised when the dossier consumption page finishes rendering. #### Content -None +The information of the selected components. #### Code example ```js -embedDossier.registerEventHandler(EventType.ON_PAGE_RENDER_FINISHED, pageRenderFinishedHandler); +embedDossier.registerEventHandler(EventType.ON_COMPONENT_SELECTION_CHANGED, (content) => { + // Use the content here +}); +``` + +#### Content example + +```json +{ + "projectId": "B19DEDCC11D4E0EFC000EB9495D0F44F", + "dossierId": "EC5441154009D3C39D5BD6AD75865EF4", + "selectedComponents": [ + { + "key": "K52", + "type": "visualization", + "chapterKey": "K36", + "pageKey": "K53", + "dimensions": { + "width": 300.45, + "height": 400.45 + } + }, + { + "key": "53ACF03646491B5F5F5A7B83EB1BB0BE", + "type": "group", + "chapterKey": "K87", + "pageKey": "K67", + "dimensions": { + "width": 700, + "height": 1000 + } + } + ] +} ``` ## Event handlers diff --git a/docs/add-functionality/authoring-library.md b/docs/add-functionality/authoring-library.md index f78a8ba..36fabde 100644 --- a/docs/add-functionality/authoring-library.md +++ b/docs/add-functionality/authoring-library.md @@ -48,7 +48,7 @@ In authoring mode, most dossier-related APIs are disabled as they are designed f | Dossier.removeSessionErrorhandler | Handles the error handlers. | | Dossier.makeSureSessionAlive | Checks the session. If it is expired, you should refresh it. | -The other APIs are disabled in authoring mode. If a disabled API is called in authoring mode, an error is returned with the message, "The API ${funcName} isn't supported in the authoring mode!" +The other APIs are disabled in authoring mode. If a disabled API is called in authoring mode, an error is returned with the message, "The API $\{funcName\} isn't supported in the authoring mode!" ### Events @@ -301,7 +301,7 @@ When an error occurs, the API returns a promise object that in turn returns an e | Error Case | Error Category | Handling Module | Error Handling | | ------------------------------------------------- | -------------- | --------------- | --------------------------------------------- | | The authoring parameter has the wrong input type. | Invalid input | Embedded SDK | Display an error message and an alert dialog. | -| The authoring.{key} has the wrong input type. | Invalid input | Embedded SDK | Display an error message and an alert dialog. | +| The authoring.$\{key\} has the wrong input type. | Invalid input | Embedded SDK | Display an error message and an alert dialog. | ### API for creating a new dossier for authoring diff --git a/docs/add-functionality/embed-vis.md b/docs/add-functionality/embed-vis.md index 2e18157..fea63a8 100644 --- a/docs/add-functionality/embed-vis.md +++ b/docs/add-functionality/embed-vis.md @@ -151,9 +151,12 @@ myDossier && in which the `resizedVisualization` callback parameter uses the following format: -| Parameter Name | Description | Data Type | Sample | -| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------- | -| `resizedVisualization` | The resized visualization information, similar to:
{`size` is `normal` or `maximized`. | Object |
visualizationKey: "string",
size: "maximized"
}
{| +```json +{ + "visualizationKey": "K52", + "size": "maximized" // "normal" or "maximized" +} +``` ## API errors @@ -161,16 +164,16 @@ in which the `resizedVisualization` callback parameter uses the following form Since you cannot set the callback parameters, it's impossible for these parameters to produce errors. When an error occurs for other reasons, the Embedding SDK returns a promise object that in turn returns an error object in rejected cases. The possible errors are shown below. -| Related APIs | Error Case | Error Handler Callback Parameter | Error Message | -| ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Dossier.changeVisualizationSize(props)` | The `visKey` is not a valid visualization key or it is not in the current page or panel stack. | Error Object | There isn’t a visualization whose key is “${0}“. Please check whether your input visKey is correct. | -| | The dossier page is still loading. | | You couldn’t manipulate a visualization when the page data is not ready. Please wait a few seconds to call this function again. | -| | The dossier’s manipulation is not finished, so maximize or restore could not be performed. This may occur when the last maximize or restore is in progress. | | You couldn’t resize a visualization when the dossier is busy for loading data. | -| | Another visualization is already maximized. | | Another visualization ${maximizedSiblingKey} is already maximized. Please call dossier.changeVisualizationSize({visualizationKey: "${maximizedSiblingKey}", size: "normal"}) to restore it first. | -| | `visualizationKey` is missing. | | Invalid input for Dossier.changeVisualizationSize(props): data should have required property 'visualizationKey' | -| | `size` is not a valid value. | | Invalid input for Dossier.changeVisualizationSize(props): data.size should match pattern "(^(maximized\|normal)$)" | -| | `resizeButtonVisible` is not a valid value, | | Invalid input for Dossier.changeVisualizationSize(props): data.resizeButtonVisible should be boolean | -| `microstrategy.dossier.create(props)` `Dossier.changeVisualizationSize(props)` | `visualizationKey` is missing | | Error when valid parameter for microstrategy.dossier.create: data.visualizationAppearances[0] should have required property 'visualizationKey' | -| | `size` is not a valid value. | | Error when valid parameter for microstrategy.dossier.create: data.visualizationAppearances[0].size should match pattern "(^(maximized\|normal)$)" | -| | `resizeButtonVisible` isn’t a valid value. | | Error when valid parameter for microstrategy.dossier.create: data.visualizationAppearances[0].resizeButtonVisible should be boolean | -| | The value of `visualizationKey` is not a valid visualization key or it is not in the current page or panel stack . | | There isn’t a visualization whose key is '${vizAppearance.visualizationKey}' in the current page. Please check whether your input 'visualizationKey' is correct. | +| Related APIs | Error Case | Error Handler Callback Parameter | Error Message | +| ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Dossier.changeVisualizationSize(props)` | The `visKey` is not a valid visualization key or it is not in the current page or panel stack. | Error Object | There isn’t a visualization whose key is “${0}“. Please check whether your input visKey is correct. | +| | The dossier page is still loading. | | You couldn’t manipulate a visualization when the page data is not ready. Please wait a few seconds to call this function again. | +| | The dossier’s manipulation is not finished, so maximize or restore could not be performed. This may occur when the last maximize or restore is in progress. | | You couldn’t resize a visualization when the dossier is busy for loading data. | +| | Another visualization is already maximized. | | Another visualization `"${maximizedSiblingKey}"` is already maximized. Please call `dossier.changeVisualizationSize({visualizationKey: "${maximizedSiblingKey}", size: "normal"})` to restore it first. | +| | `visualizationKey` is missing. | | Invalid input for Dossier.changeVisualizationSize(props): data should have required property 'visualizationKey' | +| | `size` is not a valid value. | | Invalid input for Dossier.changeVisualizationSize(props): data.size should match pattern "(^(maximized\|normal)$)" | +| | `resizeButtonVisible` is not a valid value, | | Invalid input for Dossier.changeVisualizationSize(props): data.resizeButtonVisible should be boolean | +| `microstrategy.dossier.create(props)` `Dossier.changeVisualizationSize(props)` | `visualizationKey` is missing | | Error when valid parameter for microstrategy.dossier.create: data.visualizationAppearances[0] should have required property 'visualizationKey' | +| | `size` is not a valid value. | | Error when valid parameter for microstrategy.dossier.create: data.visualizationAppearances[0].size should match pattern "(^(maximized\|normal)$)" | +| | `resizeButtonVisible` isn’t a valid value. | | Error when valid parameter for microstrategy.dossier.create: data.visualizationAppearances[0].resizeButtonVisible should be boolean | +| | The value of `visualizationKey` is not a valid visualization key or it is not in the current page or panel stack . | | There isn’t a visualization whose key is `"${vizAppearance.visualizationKey}"` in the current page. Please check whether your input 'visualizationKey' is correct. | diff --git a/docs/embed-bot-consumption-page/embed-bot-consumption-page.md b/docs/embed-bot-consumption-page/embed-bot-consumption-page.md new file mode 100644 index 0000000..14f9e57 --- /dev/null +++ b/docs/embed-bot-consumption-page/embed-bot-consumption-page.md @@ -0,0 +1,39 @@ +--- +title: Embed MicroStrategy bot consumption page +description: The Embedding SDK allows you to quickly integrate a MicroStrategy bot consumption page into a web application in a responsive manner. +--- + +The Embedding SDK allows you to quickly integrate a MicroStrategy bot consumption page into a web application in a responsive manner. + +There are three basic steps for embedding a MicroStrategy bot consumption page. + +1. In the initial page of your web application, add a link to the MicroStrategy JavaScript Embedding SDK. + + ```html + + ``` + + Replace `{YOUR_LIBRARY_SERVER_URL}` with your actual MicroStrategy Library Server URL, e.g.,
visualizationKey: "K52",
size: "maximized"
}