Skip to content

Commit 6fa7834

Browse files
author
ziyuhehe
committed
merge main
1 parent 541541f commit 6fa7834

File tree

14 files changed

+593
-18
lines changed

14 files changed

+593
-18
lines changed

.github/pull_request_template.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
<!-- Please mark the relevant options with 'X' like [X] -->
1414

1515
- [ ] My changes rendered as expected by running `yarn start`.
16-
- [ ] My changes followed the [style guide](https://github.com/MicroStrategy/embedding-sdk-docs/blob/public/contributing/content-style-guide.md).
16+
- [ ] My changes followed the
17+
[style guide](https://github.com/MicroStrategy/embedding-sdk-docs/blob/public/contributing/content-style-guide.md).
1718
- [ ] I have self-reviewed this PR.
1819
- [ ] I have performed a syntax validation check to avoid syntax errors.
1920

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
# The GH actions bot is used by default if you didn't specify the two fields.
4242
# You can swap them out with your own user credentials.
4343
# user_name:
44-
# user_email:
44+
# user_email:

.github/workflows/linters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Linters Check
22

33
on:
44
pull_request:
5-
branches: [ "public" ]
5+
branches: ["public"]
66

77
jobs:
88
linting:
@@ -30,4 +30,4 @@ jobs:
3030
- name: Markdownlint Check
3131
uses: borales/[email protected]
3232
with:
33-
cmd: lint:markdownlint # will run `yarn lint:eslint` command
33+
cmd: lint:markdownlint # will run `yarn lint:eslint` command

.github/workflows/test-deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
- name: Install dependencies
2222
run: yarn install --frozen-lockfile
2323
- name: Test build website
24-
run: yarn build:public
24+
run: yarn build:public

docs/add-functionality/add-event.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ specific events.
3131

3232
## Events
3333

34-
Each supported event is described in the table below. You get the EventType from
35-
`microstrategy.dossier.EventType`.
34+
Each supported event is described in the table below. You get the EventType from `microstrategy.dossier.EventType` or `microstrategy.embeddingContexts.EventType`.
3635

3736
### onGraphicsSelected
3837

@@ -409,7 +408,8 @@ embedDossier.registerEventHandler(EventType.ON_LIBRARY_ITEM_SELECTED, libraryIte
409408
"projectId": "B19DEDCC11D4E0EFC000EB9495D0F44F",
410409
"name": "Distribution Center & Brands",
411410
"type": 55,
412-
"subtype": null
411+
"subtype": null,
412+
"isDocument": false
413413
}
414414
]
415415
```
@@ -588,6 +588,40 @@ embedDossier.registerEventHandler(EventType.ON_DOSSIER_INSTANCE_CHANGED, (conten
588588
}
589589
```
590590

591+
### onInstanceChanged
592+
593+
#### Event enumeration
594+
595+
`EventType.ON_INSTANCE_CHANGED`
596+
597+
#### Description
598+
599+
Raised when the a new object instance is created or destroyed. The object type could be a dashboard, document, report or bot.
600+
601+
#### Content
602+
603+
The event callback parameters contain the project id, object id, object type, object name, and the instance id.
604+
605+
#### Code example
606+
607+
```js
608+
embedDossier.registerEventHandler(EventType.ON_INSTANCE_CHANGED, (content) => {
609+
// Use the content here
610+
});
611+
```
612+
613+
#### Content example
614+
615+
```json
616+
{
617+
"projectId": "B19DEDCC11D4E0EFC000EB9495D0F44F",
618+
"objectId": "D9AB379D11EC92C1D9DC0080EFD415BB",
619+
"objectName": "Dashboard Prompted on Category",
620+
"objectType": "dossier",
621+
"instanceId": "EC003BC7A046E75DE83373A254824F20"
622+
}
623+
```
624+
591625
### onComponentSelectionChanged
592626

593627
#### Event enumeration
@@ -616,6 +650,8 @@ embedDossier.registerEventHandler(EventType.ON_COMPONENT_SELECTION_CHANGED, (con
616650
{
617651
"projectId": "B19DEDCC11D4E0EFC000EB9495D0F44F",
618652
"dossierId": "EC5441154009D3C39D5BD6AD75865EF4",
653+
"objectId": "EC5441154009D3C39D5BD6AD75865EF4",
654+
"objectType": "dossier",
619655
"selectedComponents": [
620656
{
621657
"key": "K52",
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Embed Strategy document consumption page
3+
description: The Embedding SDK allows you to quickly integrate a Strategy document consumption page into a web application in a responsive manner. It also provides resources to add functionalities such as selecting components.
4+
---
5+
6+
The Embedding SDK allows you to quickly integrate a Strategy document consumption page into a web application in a responsive manner. It also provides resources to add functionalities such as selecting components.
7+
8+
There are three basic steps for embedding a Strategy document consumption page.
9+
10+
1. In the initial page of your web application, add a link to the Strategy JavaScript Embedding SDK.
11+
12+
```html
13+
<script src="{YOUR_LIBRARY_SERVER_URL}/javascript/embeddinglib.js"></script>
14+
```
15+
16+
Replace `{YOUR_LIBRARY_SERVER_URL}` with your actual Strategy Library Server URL, e.g., [https://demo.microstrategy.com/MicroStrategyLibrary](https://demo.microstrategy.com/MicroStrategyLibrary).
17+
18+
1. Create a `<div>` as the placeholder where you want to embed the dashboard consumption page.
19+
20+
```html
21+
<div id="container"></div>
22+
```
23+
24+
1. Call the `microstrategy.embeddingContexts.embedDocumentConsumptionPage(props)` method to embed the dashboard consumption page in the container.
25+
26+
```js
27+
microstrategy.embeddingContexts.embedDocumentConsumptionPage({
28+
serverUrl: "{YOUR_LIBRARY_SERVER_URL}",
29+
projectId: "{YOUR_PROJECT_ID}",
30+
objectId: "{YOUR_OBJECT_ID}",
31+
placeholder: document.getElementById("container"),
32+
});
33+
```
34+
35+
To help you get started, we have provided a number of simple applications with sample code and explanations.
36+
37+
- [Properties for an embedded Strategy document consumption page](./embed-document-consumption-properties.md)
38+
39+
Describes the properties that can be set for an embedded Strategy document consumption page.

0 commit comments

Comments
 (0)