(sv) Integration with 3rd party websites
Translation needed
The content of this page was copied from another page tree and needs to be translated or updated.
When you finish translation, make sure to
-
Replace the label NEEDS-TRANSLATING with TRANSLATED
-
Remove this macro from the page
Since 3.4
Introduction
HDC can be integrated with 3rd party websites and provide both static and interactive view on the data.
A static images can be delivered through a dedicated API interface that takes object information and other configuration parameters. To find out more please refer to (sv) HOPAGetView4Object manual.
For interactive integrations please start with reviewing a sample integration page provided for each application
https://myserver.bim.cloud/client/messageTester.html
Embedding
HDC Application can be loaded in anonymous mode (see (sv) Anonym åtkomst).
To load the application, design an iframe location on your webpage that can look like this:
<div> <iframe width="800px" height="800px" class="hdcFrame"></iframe> </div>
Application Parameters
To load the application in a proper state, several important URL parameters must be used.
If the parameters are not provided, the application will load in it's normal state.
Parameter | Recommended Value for Embedded scenario | Possible Values |
---|---|---|
Viewport | EmbeddedViewer | EmbededViewer |
ViewerProperties | false |
|
Toolbar | true |
|
ToolbarStyle | simple |
|
ViewerSidePanel | false |
|
Sample URL with requried parameters:
var hdcUrl = hdcHost + '/AnonClient/?viewport=EmbeddedViewer&viewerProperties=true&toolbar=true&toolbarStyle=simple&ViewerSidePanel=false';
Communication
Direct communication with an application running within an iframe is not allowed. To achieve a bi-directional communication HDC is using a Window.postMessage() mechanism (Link)
All functions exposed by (sv) Viewerns inbyggda-API are available through this method as well.
Please check the source of a sample page messageTester.html for samples on how to call and receive notifications from HDC Embedded application.
Sending requests to Embedded application
Sample request to show specific object:
Receiving requests from an Embedded application
Events
Events available through Message controller:
*.*.user.spot.select
*.*.user.spot.update
ui.system.ready
ui.docview.document.load
ui.system.messageapi.ready