Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for 11.3.12 release #19

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
#yarn lint-staged
222 changes: 76 additions & 146 deletions docs/add-functionality/add-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/add-functionality/authoring-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
Loading
Loading