Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

OBI 12c : javascript to create a file

Received Response
11
Views
6
Comments
ADB
ADB Rank 2 - Community Beginner

All,

on my dashboard page i would like to create a button that triggers a javascript which is going to create a file in a certain folder.

Anyone who can help me on this how to set this up?

     - where do you have to place a custom javascript in OBI 12c


Alternatives than using a javascript?

Many thanks in advance for all the input.

Kr,

A

Answers

  • ADB wrote:on my dashboard page i would like to create a button that triggers a javascript which is going to create a file in a certain folder.

    You maybe need to define a bit better your requirement ...

    Is the folder a folder on the OBIEE server or is the folder a folder on the workstation of the user using OBIEE ?

    In general I would say javascript has no way to do that (there is an exception is your OBIEE is on a Windows server).

    But before to start going in all the direction with hypothetical define what you look for more in detail! Where the fail is supposed to be and what is it supposed to contain etc.

  • ADB
    ADB Rank 2 - Community Beginner

    Hello Giani,

    txs for your answer!

    Goal is to have a button on a dashboard. When pushing the button a file has to be created somewhere on another server. This file is a triggerfile to start processing another chain.

    I hoped with javascript i could obtain this? But our OBI install is on an ODA, so not windows at all.

    Any suggestion on how to meet this requirement can be helpfull.

    Txs,

    A

  • Based on what you wrote I would say you look for the wrong thing in the wrong tool  ....

    Your requirement isn't an OBIEE job, so let's get OBIEE out of the equation (it will only be a webpage hosting your button).

    Javascript is a client side language, so it's execute by your browser, therefor can't create a file somewhere on another server.

    What you look for is what a webservice is supposed to do. Javascript cal call a webservice or a webpage hosted somewhere and there some code can be executed. Ideally your "start processing another chain" has a webservice interface able to trigger the execution without looking for a file.

    What kind of work is that? ETL? (which ETL?)

    Most of these things have webservices and exposes API which you can call via javascript from a browser. I would explore that direction being you ...

  • ADB
    ADB Rank 2 - Community Beginner

    Txs Gianni,

    i understand your concern...a reporting tool is a reporting tool.

    But we have to deliver a 'quick' solution, may be a bit dirty....the used scheduler works trigger based, that's the reason why we should be able to just put somewhere a file...;

    Kr,

    A

  • Ok, but still ... the problem is that "put somewhere" a file is something that, luckily for all of us, isn't doable by a browser script.

    Imagine just a second if javascript would be able to write files in any random folder: the first time you visit a "friendly website" half of your files are overwritten by a javascript script in the page.

    So javascript can't do it on the client side. What you are left with is the server side.

    OBIEE doesn't write files around by default. If you mount on the OBIEE server the location where you want the file you can setup an action writing a file there (you must write the code yourself, it isn't there by default but SampleApp has an example for that). The action can be triggered by a button / click / link on the dashboard.

    Take the SampleApp 607 or 511 (OBIEE Samples ) and look at "6.30 Actions" > "Actions to Invoke Java Methods deployed in EJBs". The "Archive a Report (EJB Method)" write a report to a file on the OBIEE filesystem (or a shared folder mounted on that server). It uses EJB code (Enterprise Java Bean) which you can also find and copy from SampleApp.

    That's how OBIEE can write a file on his own filesystem.

    Plan B would be to look into Publisher as it can deliver files in more ways.

  • ADB
    ADB Rank 2 - Community Beginner

    Hi Gianni

    txs for the input, already looked at that part of the sample app.

    In the mean I think I found another easier way to implement my requirement. I'll make use of a database function/procedure to write a file to a directory. A nfs-mount is already setup on server level/Db level, so it will be the easiest way without writing/implementing java methods and variants ;-)

    Txs anyway to try to clearify and find a solution, appreciated!

    Kr,

    Andy