...
...
<div style="width:9%; height:80%;"> |
...
<div id="dossierContainer" style ="width:50%; height:50%;"></div> |
...
...
...
<script src="https://demo.microstrategy.com/MicroStrategyLibrary/javascript/embeddinglib.js"></script> |
...
<script type="text/javascript"> |
...
/* These are the parameters necessary for connecting to the Dossier ----------------------------- */ |
...
baseRestURL = "https://demo.microstrategy.com/MicroStrategyLibrary"; |
...
projectID = "EC70648611E7A2F962E90080EFD58751"; |
...
dossierID = "1730E9598F436BF38B0F4589D5E5484A"; |
...
/* since in this case we want dossier to load automatically for everyone we will use a demo user */ |
...
...
...
/* End of configuration parameters ------------------------------------------------------------- */ |
...
/* Generate the complete URL for the Dossier */ |
...
var dossierUrl = baseRestURL + '/app/' + projectID + '/' + dossierID; |
...
/* Populate div with Dossier: */ |
...
microstrategy.dossier.create({ |
...
/* This is the document's <div> container where the Dossier should be placed. */ |
...
placeholder: document.getElementById("dossierContainer"), |
...
...
/* The following parameters define the appearance of the Dossier. |
...
E.g. is the navigation or collaboration bar displayed, do right-click actions work, etc. */ |
...
disableNotification: true, |
...
...
/* And parameters for the user authentication. */ |
...
/* In case we didn't want the dossier to load automatically for everyone */ |
...
/* and wanted the user to log in we would skip that part. */ |
...
enableCustomAuthentication: true, |
...
customAuthenticationType: microstrategy.dossier.CustomAuthenticationType.AUTH_TOKEN, |
...
...
}).then(function(dossier) { |
...
/* Code to execute after the Dossier has finished loading... */ |
...
...
...
/* Prepare some parameters for login request */ |
...
...
...
credentials: 'include', /* include cookie */ |
...
mode: 'cors', /* set as CORS mode for cross origin resource sharing */ |
...
headers: {'Content-Type': 'application/json'}, |
...
...
/* loginMode: 8 */ /* Login as guest user. */ |
...
"loginMode": 1, /* standard login mode */ |
...
...
...
...
...
/* The actual login takes place here */ |
...
return fetch(baseRestURL + '/api/auth/login', options).then(function (response) { |
...
...
return response.headers.get('x-mstr-authToken'); |
...
...
response.json().then(function(json) { |
...
...
...
}
}).catch(function (error) { |
...
...
...
...