5 Steps to Exporting OBIEE Contents to a File System

5 Steps to Exporting OBIEE Contents to a File System

I recently received a client requirement in which they wanted to store OBIEE (Oracle Business Intelligence Enterprise Edition) contents to a file system like SharePoint. This would enable users who are not familiar with OBI or trained on report building to be able to consume reports stored on SharePoint.

OBIEE 11g doesn’t provide any built-in method to allow agents to automatically export/archive content into a physical file location. This can be done by linking an action to the agent which invokes server scripts, like EJBs, VBs etc., which physically move the OBIEE 11g content to the file system.

OBIEE 11g Action Framework opens up direct integration with Java so any process that can be called via Java can be directly called from OBIEE 11g as well.

In this blog, we will archive/export OBIEE 11g content by Invoking a Java Method from actions.

Below are the steps that we will perform:

1. Create an EJB application for exporting reports to file system.

2. Deploy “OBIEEContentExportApp.ear” file into WebLogic managed server.

3. Update “ActionFrameworkConfig.xml” file to enable Java Method calls from OBIEE 11g.

4. Create a credential map and key for oracle.bi.actions.

5. Create an agent to export/archive OBIEE 11g content to file system.

STEP 1: Create an EJB Application Using JDeveloper:

1. Create the application by going to JDeveloper -> File -> New… -> General -> Generic Application and click “OK”:

2. Provide an application name:

3. Click on “Next”. Provide a project name: OBIEEContentExportApp. Then, click on “Finish”:

4. Next, create the Session Bean by right clicking on OBIEEContentExportApp -> New… -> Business Tier -> EJB and select “Session Bean” on the right pane and click “OK”:

5. Accept the default and click “Next”:

6. Provide the following and click “Next”:

– EJB Name: OBIEEContentExportApp
– Session Type: Stateless
– Transaction Type: Bean

Accept the defaults on steps 3 and 4 and click “Finish”.

7. Get the needed libraries from the server to execute this code. Transfer the file to the machine where JDeveloper is running. The libraries are under:

– <FMW_HOME>/user_projects/domains/bifoundation_domain/servers/bi_server1/tmp/_WL_user/bimiddleware_11.1.1/udy1lp/lib/actionframework-common.jar

8. Import the needed libraries to execute this code. Right click on “MyEJBProject” -> Project Properties… Libraries and Classpath -> click on “Add JAR Directory”… -> Navigate to the directory where you put the actionframework-common.jar and scheduler/schedulerrpccalls.jar files and add them. Then click “Select”.

9. The following is the code that needs to be implemented in the EJB:

a) EJB Bean Code: OBIEEContentExportAppBean.class

package OBIEEContentExportApp;

import java.io.*;

import javax.activation.DataHandler;

// Referenced classes of package OBIEEContentExportApp:

//            OBIEEContentExportApp, OBIEEContentExportAppLocal

public class OBIEEContentExportAppBean

implements OBIEEContentExportApp, OBIEEContentExportAppLocal

{

public OBIEEContentExportAppBean()

{

}

public String ArchiveReport(String filename, DataHandler report)

throws FileNotFoundException, IOException

{

File f = new File(filename);

FileOutputStream outputStream = new FileOutputStream(f);

report.writeTo(outputStream);

outputStream.close();

return “Report Archived”;

}

}

b) EJB Remote Interface Java code: OBIEEContentExportApp.class

package OBIEEContentExportApp;

import java.io.FileNotFoundException;

import java.io.IOException;

import javax.activation.DataHandler;

public interface OBIEEContentExportApp

{

public abstract String ArchiveReport(String s, DataHandler datahandler)

throws FileNotFoundException, IOException;

}

c) EJB Local Interface Code: OBIEEContentExportAppLocal.class

package OBIEEContentExportApp;

public interface OBIEEContentExportAppLocal

{

}

STEP 2: Deploy EAR file to WebLogic managed server:

  • Click “Lock & Edit” from Change Center as shown below:

  • Click “Install” from Summary of Deployments tab as shown below:

  • Select Path: < Middleware>\OBIEEContentExportApp.ear (refer below screen for example path) and click “Next”:

  • Select “Install this deployment as an application” radio button and click “Next”:

  • Select bi_server1 as target and click “Next”:

  • Leave the default settings in the below window and click “Next”:

  • Select the “No, I will review the configuration later,” radio button and click “Finish” as shown below:

  • Click “Activate Changes” as shown below:

  • You will see the message highlighted below once Activate Changes are successful:

  • By default, the deployed application will be in prepared state. Here, select the application and start it as shown below:

  • The deployed application should be in Active mode as shown below:

STEP 3: Update “ActionFrameworkConfig.xml” file to enable Java Method calls from OBIEE 11g:

We need to update the ActionFrameworkConfig.xml to enable Java Method calls from OBIEE 11g.

Navigate to…

<MiddlewareHome\user_projects\domains\bifoundation_domain\config\fmwconfig\biinstances\coreapplication\ActionFrameworkConfig.xml”

And update file as shown below (note that your t3:port could be different)…

<?xml version=”1.0″ encoding=”UTF-8″?>

<obi-action-config xsi:noNamespaceSchemaLocation=”afconfig.xsd” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>

<aliases>

<location-alias>

<alias>biserver</alias>

<actual>http://localhost:9704/analytics/saw.dll?WSDL </actual>

</location-alias>

</aliases>

<registries>

<registry>

<id>reg01</id>

<name>Sample Test</name>

<content-type>java</content-type>

<provider-class>oracle.bi.action.registry.java.EJBRegistry</provider-class>

<description>Custom Java for Financial Reports</description>

<location>

<path />

</location>

<custom-config>

<ejb-targets>

<appserver>

<context-factory>weblogic.jndi.WLInitialContextFactory</context-factory>

<jndi-url>t3://localhost:9704</jndi-url>

<server-name>localhost</server-name>

<account>WLSJNDI</account>

<ejb-exclude>mgmt</ejb-exclude>

<ejb-exclude>PopulationServiceBean</ejb-exclude>

</appserver>

<ejb-app>

<server>localhost</server>

<app-context>ArchiveReportsToPdf</app-context>

</ejb-app>

</ejb-targets>

</custom-config>

</registry>

</registries>

<content-types>

<content-type>

<typename>webservices</typename>

<displayname>Web Services and BPEL Processes</displayname>

<actionType>WebServiceActionType</actionType>

</content-type>

<content-type>

<typename>epm</typename>

<displayname>Hyperion Applications</displayname>

<actionType>URLActionType</actionType>

</content-type>

<content-type>

<typename>misc</typename>

<displayname>Mixed Services</displayname>

<actionType>URLActionType</actionType>

</content-type>

<content-type>

<typename>java</typename>

<displayname>Java Actions</displayname>

<actionType>JavaActionType</actionType>

</content-type>

</content-types>

<accounts>

<account>

<name>WLSJNDI</name>

<description>Account used to access WLS JNDI.</description>

<adminonly>false</adminonly>

<credentialkey>JNDIuser</credentialkey>

</account>

</accounts>

</obi-action-config>

STEP 4: Create a credential map and key for oracle.bi.actions:

  • Login to OBIEE enterprise manager -> goto Weblogic Domain -> Security -> Credentials

  • Create a new credential map named “oracle.bi.actions”:

  • Create a new credential key for JNDIUser using your WebLogic username/pass:

  • Restart all the OBIEE 11g services.

STEP 5: Create an agent to export/archive OBIEE 11g content to file system:

  • Login to OBIEE 11g and create an agent as shown below:

  • Navigate to Delivery Content tab and select content as “Dashboard Page” or any analysis shown below and click “OK”:

  • Navigate to the Recipients tab and select any “Role” as recipient. Here, I selected the “biadmin” role for example. Refer the below screenshot:

  • Select User Destinations as “Home Page and Dashboard” as shown below:

  • Navigate to Actions tab and from Add New Action -> Invoke a Java Method as shown below:

  • From Select Java Method pop-up window, select “ArchiveOBIEEContent” method as shown below and Click OK:

  • You will get New Action window as shown below:

  • Enter path as “/common/app/temp” and your file name along with extensions. Below is an example on UNIX:

Enter Location to Archive: /common/app/temp/New Joiners.pdf

Content to Archive: Delivery Content

And click “OK”.

  • Save the agent and run it.

SaveToFile_1

SaveToFile_2

Now, you can see your delivery content overview dashboard page or analysis saved under given path as shown below:

Once the reports are exported to a file system, build a Cron job to copy them to a SharePoint destination.

Useful links:

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=568161697704698&id=1610118.1&_afrWindowMode=0&_adf.ctrl-state=ri9dfmqhy_4

Tags:

Write a Comment

x

Contact Us Close