This can be done with javascript and using the element in the dashboard page. This script will output a list of only available dashboards and a user will see only those ones, where he has an access.
Take the following piece of code and put it on the OBIEE dashboard page in the text element with the "Contains HTML Markup" checked:
<img id="loading" src="/res/s_FusionFX/common/page_lev_connected.gif" />
<div id="dash_list"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script type="text/javascript">
$.ajaxSetup({
beforeSend:function(){
$("#loading").show();
},
complete:function(){
$("#loading").hide();
}
});
$.ajax({
url: "saw.dll?getDashboardList"
}).done(function( data ) {
var start = data.indexOf('[');
var end = data.lastIndexOf(']');
var len = end-start+1;
var json_str = data.substr(start,len);
var json_obj = jQuery.parseJSON(json_str);
var str = '<br/><br/><table style="width:100%"><tr>';
$.each(json_obj, function() {
if (this.folderName!=='Home Page'){
str += '<td valign="top"><b><font size=4; color=#CCCC00;>' + ' ' + this.folderName + '</b></font><br/><br/>';
$.each(this.portals, function() {
if (this.portalName=='Management Dashboard'){
str += ' ' + '<img src="res/s_FusionFX/common/page_lev_connected.gif"><font size=3><b><a href="saw.dll?Dashboard&PortalPath=' + this.portalPath + '">' + this.portalName + '</b></font></a><br/>';}
else {
str += ' ' + '<img src="res/s_FusionFX/common/page_lev_connected.gif"><font size=3><a href="saw.dll?Dashboard&PortalPath=' + this.portalPath + '">' + this.portalName + '</font></a><br/>';}
});
str += '</td>';
}
});
str += '</tr></table>'
$('#dash_list').html(str);
});
</script>
The output of the script on the environment I was using:
You can also make some adjustments to the previous code to adjust it to your requirement. I highlighted 4 likely places that you might want and need to adjust.
<img id="loading" src="/res/s_FusionFX/common/page_lev_connected.gif" />
This would be the picture that shows up while the list is being populated (only a second or two though). Here I used the same Oracle logo from OBIEE top right corner, but you could as well add your own picture on the server and make the code point to your picture.
if (this.folderName!=='Home Page'){
This would exclude a particular dashboard from the outputted list. It's pretty useless and you probably wouldn't want to include the same dashboard you're on here. You would need to modify the name according to your particular dashboard name then.
if (this.portalName=='Management Dashboard'){
You might want to highlight a particular dashboard on the list. For such case you can write a separate branch with a special font, picture or something else.
<img src="res/s_FusionFX/common/page_lev_connected.gif">
You can change the image that shows up before the each dashboard. Here I used the same Oracle logo, but you can also customize it to your needs.
Of course, there are a lot of other smaller or bigger adjustments you can do - font colors, sizes etc.
I already did and you probably could use this script for a custom home page and replace the Oracle default home page. In my case I made and added a custom logo of my company, added some custom links to related internal systems on one side, ETL status reports - on the other side and the script in the middle of the page to populate the list of available dashboards in the middle of the page. I also added custom images to the server to use as the bullets for each dashboard. Then I used the PORTALPATH repository variable to direct the user to this page and also modified header.js javascript file to redirect the "home" link from the top of the OBIEE page to this new customized page.
No comments:
Post a Comment