More and more often in an OBIEE you need a custom folder where to place javascript and CSS files like drawing/charting libraries (D3js, Oracle JET etc.), a custom style for OBIEE or just any file (business documentation for example) you want to make available in the browser. This is known as the AnalyticsRes folder from the OBIEE 11g world.
This approach is extremely useful mainly when using JS/CSS charting API/libraries because having them locally available protect you against the risk the remote file is corrupted by hackers adding code to steal your data or simply the file being deleted, moved or updated and breaking your code.
The second benefit of deploying JS/CSS files locally by this approach is that you don’t have to configure the Content Security Policy in the OBIEE Presentation Server config file (as covered in this post about Google Map) to allow the usage of remote files as the folder will be deployed with the same domain/IP and port as OBIEE.
The official documentation cover the deployment of an “analyticsRes” folder as the second approach for deploying a custom style in OBIEE.
In a coming post I will highlight why I don’t like this approach for OBIEE custom style/skin as it seems to have few more bugs compared to the option of deploying a bicustom.ear file. If you are interested into OBIEE custom style process stay tuned.
Steps to deploy a custom folder in OBIEE 12c Weblogic
It takes 10 steps and not longer than 5 minutes.
1) First you must create a folder on the OBIEE server filesystem (or at least a place OBIEE can access, can also be on a mounted shared folder). This is the folder where you place the content you want to make available via your browser.
The minimum required structure is a subfolder named WEB-INF and inside that folder a web.xml file (maybe it’s also possible without the web.xml file or with an empty web.xml file but … it’s already simple enough, so I preferred to avoid issues).
The content of the web.xml file is some definition of mime types based on files extensions. For example this is the one provided by OBIEE in the bicustom.war (contained in bicustom-template.ear, the template for developing custom styles/skins in OBIEE).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <mime-mapping> <extension>xsd</extension> <mime-type>text/xml</mime-type> </mime-mapping> <mime-mapping> <extension>xml</extension> <mime-type>text/xml</mime-type> </mime-mapping> <mime-mapping> <extension>js</extension> <mime-type>text/javascript</mime-type> </mime-mapping> <mime-mapping> <extension>css</extension> <mime-type>text/css</mime-type> </mime-mapping> <mime-mapping> <extension>png</extension> <mime-type>image/png</mime-type> </mime-mapping> <mime-mapping> <extension>swf</extension> <mime-type>application/x-shockwave-flash</mime-type> </mime-mapping> </web-app> |
In my folder I already added a test file named “hello_world.txt”, this is the one I will use to test if the deployment works at the end.
2) Open the Weblogic Server Administration Console, by default http://<your IP/domain>:9500/console in OBIEE 12c, and navigate to the “Deployments” screen using the domain structure view on the left. To install a new deployment you first need to enable the edit mode by clicking on “Lock & Edit” and then you can start the install wizard with the “Install” button.
3) The first thing to do is navigate in the filesystem to point to the folder you want to deploy, mine is /opt/oracle/analyticsRes. Thanks to the WEB-INF folder Weblogic knows it can deploy that folder and make it visible on screen with a different icon in front of the folder and a radio button to select the location. Select the folder and move to the next step.
4) It’s important to set the correct type of installation, in your case “Install this deployment as an application” before to move to the next step.
5) Time to define where you want to deploy the folder. I recommend to avoid the AdminServer and to prefer the managed server running OBIEE. In your case you can simply select the “bi_cluster” and “All servers in the cluster” to keep it simple. It’s the same as explicitly select “bi_server1” in a normal setup.
6) In the option settings a very important step is to select “I will make the deployment accessible from the following location” under the Source Accessibility section of the page. In this way you can easily add new files and edit existing ones and the changes are directly valid and visible.
7) The deployment install steps are over, everything is set correctly and you can double check the settings in the summary. Time to move to the configuration screen for the newly installed deployment.
8) At this point you can check the configuration and modify attributes if you need, after you must “Activate Changes” with the button on the top-left to commit the changes in the Weblogic configuration.
9) Last step left is to start servicing queries. In the Control screen of the deployment you can select it and in the “Start” button you select “Servicing all requests”.
10) Cross your fingers and test! By default the URL is the name of the folder (you can change it by changing the Context Root in the deployment configuration screen).
Done! Any file you place into the folder (/opt/oracle/analyticsRes in my case) on the filesystem will be directly available through your browser. It can be JS / CSS charting libraries or also pictures, PDF or any other kind of file you can then link or display into OBIEE dashboard and analysis.
In a future post I will use this folder to deploy some JS charting libraries to add missing chart types in an OBIEE analysis.
I followed your instructions to expose directory on WLS for storing custom charts, generated by R scripts as pictures. Applied on Windows environment and it worked for me.
Thanks and BR
Good to hear it also works on Windows as it’s not something I generally test (a lot easier to have linux environments). Thanks for the feedback.
Hello – we want to place custom scrolling message on Obiee landing page and all other pages
Appreciate your inputs
It also worked like a charm under RedHat Linux 6 and Oracle 12.1. As well as, after finishing the procedure, any new file updated to the specified server’s directory is immediately accesible through the web browser.
Together with the procedure to change the home page in Analytics (maybe via PORTALPATH variable) this could become the definitive guide for OBIEE home page replacement!
Thanks a lot!
Great job.
thx
Gianni,
Thanks for writing up this helpful document.
Do you have any advice on how to protect the analyticsRes URL using the application roles/policies/groups available in the BI domain. I would like to limit access to only BIAuthor role. Any advice you can offer is greatly appreciated. Thx.
Honestly? No idea …
That’s a weblogic question, try to look in that direction. There are maybe some options in the deployment (if you check the deployment steps there are security options to pick from, but I never looked at what the other options are). But you maybe have to code something or add extra files/settings (I guess the security options are more for a Java app and not just a folder with static content).
Thanks. Worked like a charm. 🙂
Great Gianni!!
Work very weel, I spend three days to do it by Samba on one server, mount point on OBIEE server2, and FMW server3 to deploy shared folder!!
Just now I create for BI Publisher, so my rep in shared dir to will be directly available through FMW browser to my users!!
Your is better and more simply!
Thanks
Hello Gianni
Thanks for this post !
I would like to add a folder (for internal use) but on the OAS server not on the OBI12.
As far as I can see, it looks a bit different and I was not able to do the above on OAS.
Am I missing something ? is there another way to do on OAS ?
Thanks in advanced.
Yossi
Is is possible deply folder form network location?
Never tried, it is possible that WebLogic has some checks to prevent it, but if your network folder is mounted in the OS locally it could also probably just be like any other folder.