<script type="text/javascript">
/*
* setup some basic informations in order to invoke Knowage server's services
*/
var user = 'biuser';
var password = 'biuser';
Sbi.sdk.services.setBaseUrl({
protocol: 'http'
, host: 'localhost'
, port: '8080'
, contextPath: 'knowage'
, controllerPath: 'servlet/AdapterHTTP'
});
execTest2 = function() {
var html = Sbi.sdk.api.getDocumentHtml({
documentLabel: 'par_document_label'
, executionRole: '/spagobi/user'
, parameters: {ELAB_ID: 'ELA_T_ANVOPOD_1', TIPO_AN_ID: 'ANVOFATT'}
, displayToolbar: true
, canResetParameters: false
, iframe: {
height: '500px'
, width: '100%'
, style: 'border: 0px;'
}
});
document.getElementById('targetDiv').innerHTML = html;
};
/*
* the callback invoked uppon request termination
*
* @param result the server response
* @param args parameters sent to the server with the original request
* @param seccess true if the service has been executed by the server in a succesfull
way
*/
var cb = function(result, args, success) {
if(success === true) {
execTest2();
} else {
alert('ERROR: Wrong username or password');
}
};
doLoginAndExecute = function() {
Sbi.sdk.api.authenticate({
params : {
user : user,
password : password
}
,
callback : {
fn : cb,
scope : this
}
});
};
</script>