Link to portal page

Link to portal page

 : my cases


            <a href="#" onclick="window.parent.location.hash='?_p=caselistinguser&_f=mycases';return false">my cases</a>

Link to external site

Link to external site

 : Bonitasoft Documentation


            <a href="http://documentation.bonitasoft.com" target="_blank">Bonitasoft Documentation</a>
			

Link to custom page zip resource

Link to simple html page

 : simplepage.html in the zip file. The parameter "custompage_htmlexample" is the "Name for the URL" .

            <a href="#" onclick="window.parent.location='pageResource?page=custompage_htmlexample&location=simplepage.html';return false">simplepage.html</a>

Link to image

            <img src="pageResource?page=custompage_htmlexample&location=img/logo.png">

Other resources

            <link href="pageResource?page=custompage_htmlexample&location=css/layout.css" type="text/css" rel="stylesheet" />
            <script src="pageResource?page=custompage_htmlexample&location=js/script.js"></script>

Call the Bonita Web Rest APIs using the current session

Call the Bonita Web Rest APIs using the current session

Get current user session information:

// jquery example
function getSessionInfo() {
	var request = $.ajax({
		url : '../API/system/session/1',
		type : "GET",
		success : function(data, textStatus, request) {
			// Token needed in every API call as a HTTP Header when the CSRF Protection is enabled
			apiToken = request.getResponseHeader('X-Bonita-API-Token');
			userData = data;
			delete userData.conf;
			$("#getSessionId").text(JSON.stringify(userData));
		},
		error : function() {
		}
	});
}
        					

JSON result:


						

Use the user's locale

Use the user's locale

The user's locale is provided in "locale" query parameter


 : 
            // javascript example
            function getParameterByName(name) {
                  name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
                  var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search);
                  return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
            }
            var userLocale= getParameterByName("locale"));

Use a javascript plugin

Use a javascript plugin

jquery-ui-1.10.4.custom.css is included in the HTML custom page example zip, in the subfolder resources/css


            <link href="pageResource?page=custompage_htmlexample&location=css/jquery-ui-1.10.4.custom.css" rel="stylesheet">