Monday, September 10, 2012

Oracle ADF BI Integration

This blog post will guide through the process of embedding OBIEE analytics (reports/dashboards) on an ADF application. Also hoping that this resource will act as a reference material for future.

There are multiple ways in which we can achieve BI integration with ADF. The illustrated version on this post is one that I found very sophisticated.

The reasons for OBIEE integration could be manifold. The default DVT features available within ADF can be used to build reports however not as sophisticated as BI does. In such cases, it would be a great time-saver plus a great way to show analytics to the user on a jspx page.

In a more interesting use case, I have used this feature within a BPM process user task - where the reviewer/approver can see the BI analytics on the UI along with process parameters before taking an action.

Products/Versions:

JDeveloper/ADF: 11.1.1.6
OBIEE: 11.1.1.5

Step 1: Download the following JDev extensions

1
bi-adf_bundle
Provides the ability to browse the BI Catalog through the JDeveloper resource catalog and add BI objects to an ADF page.
2
bi-adf-taskflow-extension_bundle
Provides the ability to browse the BI Catalog through the WebCenter resource catalog and add BI objects to a webCenter page.
3
bi-soap-cn_bundle
Provides the ability to create a BI Soap Connection.
4
bi-vo_bundle
Provides the ability to create a View Object that can query Oracle BI using logical SQL.
5
oracle.webcenter.customization_bundle
Provides design time capabilities for the WebCenter Customization Framework.
6
oracle.webcenter.framework_bundle
Provides design time capabilities for the WebCenter Framework and Services.

Links for download:

http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/131167.xml
http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/156082.xml

I know it is a quite a list - but can't get away from this :)

Step 2: Install these extensions to your JDeveloper

Help -> Check for Updates... -> Choose "Install From Local File" option, select the extensions one-by-one and let JDeveloper install them. JDeveloper will prompt for restarts for every extension install.

Step 3: After installing all the BI extensions, under the "Application Resources" panel of the ADF application (where you want to integrate the OBIEE reports), right click on the "Connections" -> "New Connection" -> "BI Presentation Services..."

Step 4: Provide the OBIEE analytics environment information in the wizard and proceed to complete connection creation. If you have not enable 'impersonation' in BI, change this option to 'false' in the following screen. Ensure that the connection is successfully established to the BI server.
Step 5: Now, this connection should appear automatically in the "IDE Connections" panel under the "Resource Pallete". This can be used to browse through the BI analytics for available dashboards/reports.
Now that the BI presentation services is available, all that remains is integrating the available BI reports into the ADF page

Step 6: First step towards ensuring that the ADF project is BI technology enabled. To do this, right click on the ADF project -> Project Properties

Under "Technology Scope" option ensure that the "Business Intelligence ADF View Components" is selected.
Step 7: We are almost there! Browse through the BI presentation services catalog from under the "Resource Pallete", drag & drop the required reports on to the ADF page.

Common Impediments & Resolutions:

I1: Unable to drag & drop the reports to ADF page

Resolution: Initially I was not able to drag and drop the BI reports on to the ADF page successfully. I had to manually include the following element to my ADF page source to force ADF to recognize the BI reports;

<adfbi:content id="content1" value="#{bindings.biExecBinding1}"/>

After doing this the BI technology binding was enabled on my ADF project. Then I removed the element which I added manually.

I2: At runtime, OBIEE reports were not displayed. The following error was reported on the ADF page;

Unable to connect to the BI Presentation Server. Please ensure that it is running, configured properly, and that the connection details within this application are correct.Please check the log file for more details.

The server logs reported the following error;

Cannot lookup the connection, BI using fallbacks[[
oracle.bi.presentation.soap.connection.BISoapException: No credentials found for this connection - please check that your connection credentials were deployed properly.
at oracle.bi.presentation.soap.connection.impl.BaseBISoapConnection.setReference(BaseBISoapConnection.java:216)
at oracle.bi.presentation.soap.connection.impl.RTBISoapConnection.(RTBISoapConnection.java:58)
at oracle.bi.presentation.soap.connection.BISoapConnectionFactory.getObjectInstance(BISoapConnectionFactory.java:715)
at oracle.adf.share.jndi.ReferenceStoreHelper.getObjectForReference(ReferenceStoreHelper.java:295)

................................................................................................
................................................................................................
................................................................................................
................................................................................................
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

Resolution: To resolve this error, ensure that the "Credentials" option is unchecked under the "Security Deployment Options" of the "Application Properties".
This config ensured that the credentials are not overwritten and are picked up from the cwallet.sso file under the EAR package. The issue was resolved and the BI reports were displayed on the ADF page as expected.

Write back if you have any thoughts/suggestions/clarifications :)

Monday, September 3, 2012

Extending WebCenter 11g with BPM Process Spaces

I recently extended my WebCenter Spaces with BPM process spaces. Since there has been lot of speculation & issues in successfully getting this done, this post attempts to act as a reference guide and detail the step-by-step process for extending the WebCenter Spaces with BPM process spaces.

Firstly ensure that all your managed servers are down (including AdminServer).

Step 1: Run the config.sh from the WebCenter home ($Middleware_Home/Oracle_WC/common/bin)

Step 2: Choose 'Extend an existing WebLogic domain' option

Step 3: Select the domain directory

Step 4: In the 'Select Extension Source' window, choose 'Extend my domain using an existing extension template' option

Step 5: Browse for 'oracle.bpm.spaces_template_11.1.1.jar' template. This can be found under '$Middleware_Home/Oracle_WC/common/templates/applications' folder

Step 6: On next, ensure that the domain is extended with WebCenter process spaces. This will now allow you to embed and use BPM 11g features from within the WebCenter spaces portal

Now that we have completed the first part by extending the domain with process space, we have to perform some configuration in Oracle UCM (Unified Content Management) server.

Step 7: Login to ECM as weblogic - Default URL would be http://<hostname>:16200/cs

Note: At the time of first login to Oracle ECM, make sure to configure the server socket port to 4444. This is very important for external applications (like WebCenter spaces) to communicate with content server via the RIDC - Intra Doc Communication protocol


Step 8: Here we should enable the following options (if not already enabled)

Administration -> AdminServer

Under Component Manager enable the following;

  • WebCenterConfigure
  • DynamicConverter
  • Folders_g (You will have to click on 'advanced component manager' link at the top of the page to enable this).

It will be important to note that "FrameworkFolders" option description under the component manager page states that it is a replacement for the 'Folders_g' option. But process spaces will work only if 'Folders_g' is enable and will not work with 'FrameworkFolders'

Now that the options are enabled in ECM, the UCM_server 1 managed server has to be restarted for changes to take effect. After restart ensure that all managed servers are up and running.

Step 9: Login to EM console (http://<hostname>:7001/em) and ensure that the Intradoc Server Port is configured properly;


Now, try and access the WebCenter spaces portal (http://hostname:port/webcenter/spaces)
If there is an issue with access, check whether mds-soa datasource (JNDI: jdbc/mds/MDS_LocalTxDataSource) is targeted on WC_Spaces managed server. If not, please target the data source on the WC_Spaces server.

Configuring the process spaces in WebCenter:

Step 10: Configure the following properties in the process-portal-install.properties file which is available under $MIDDLEWARE_HOME/Oracle_SOA1/bpm/process_spaces
The description is available against every property within the properties file. I am stating it here with sample values just for convenience;
Property
Description
Sample Value
extendSoa
Flag to decide whether to extend existing BPM domain or create a new one. Set extendSoa to true, if the webcenter space and the SOA server are running in the same domain. Set extendSoa to false, if the webcenter space and the SOA server are running in different domains.
true
promptForPasswords
Flag to decide whether install will prompt for passwords or read them from this file.
false
Setting up Domain Global Trust
wcSetDomainRealmPassword
Flag to control whether to set domain realm password or not, set to true if extendSoa is false.
false
wcDomainRealmPassword
This is the password to setup trusted domains. Same password should be set on BPM domain as well.
welcome1
wc.server.port
WebCenter server port.
8888
BPM Schema and MDS Details
bpmDBUser
SOA DB Schema name
DEV_SOAINFRA
bpmDBPassword
SOA schema password
welcome1
bpmDBType
Type of DB
ORACLE
bpmDBDriver
DB Driver class
oracle.jdbc.OracleDriver
bpmDBUrl
SOA DB connect string
jdbc:oracle:thin:@localhost:1521:orcl
bpmMDSUser
BPM MDS username
DEV_MDS
bpmMDSPassword
BPM MDS password
welcome1
BPM Runtime Details
bpmServerURL
Specify the BPM server URL (t3://<bpmHost>:<bpmRuntimePort>) in the case of a single
t3://localhost:8001
bpmAdminUser
Admin username
weblogic
bpmAdminPassword
Admin password
welcome1
Webcenter Spaces Installation Details
wcOracleHome
Provide the oracle home location of the webcenter install.
/oracle/ofm/11g/wc_home
wcDomainName
Provide the Webcenter domain name. If extendSoa flag has been set to true, Webcenter domain name should be the same as SOA domain name. If extendSoa flag has been to false, Webcenter domain name will be different from SOA domain name.
fmw_domain
isWebcenterClusterConfig
Pass 'true' if in cluster mode, 'false' otherwise.
false
wcSpacesClusterName
Specify the name of the webcenter spaces cluster.

wcHost
WebCenter hostname
localhost
wcAdminPort
WebCenter port
7001
wcAdminUser
WebCenter Admin username
weblogic
wcAdminPwd
WebCenter Admin password
welcome1
wcManagedServerName
In the case of a single server environment, specify the name of the Webcenter Spaces Managed server. In a clustered environment, specify the name of any one of the Spaces managed servers that is part of the Cluster.
WC_Spaces
wcConfigServices
Flag to control whether to configure services
true
Content Server Details
wcContentServerName
Content Server hostname
localhost
wcContentServerPort
Content Server port
4444
wcContentSpacesRoot
Content Server spaces root
/WebCenter0809
wcContentAdminUser
Content Server Admin username
weblogic
Discussion Server Details
wcDiscussionServerUrl
Discussions Server URL
http://localhost:8890/owc_discussions
wcDiscussionAdminUser
Admin username
weblogic

Step 11: Now, execute the following Ant script from the following location $MIDDLEWARE_HOME/Oracle_SOA1/bpm/process_spaces. This will configure the BPM process spaces in WebCenter spaces.

$MIDDLEWARE_HOME/modules/org.apache.ant_1.7.1/bin/ant –f install.xml

Ensure that the script ran without any errors. In case of errors, please correct them before proceeding further. More often than not, the property values could cause issues if not set properly.

Sample Output should be something like below;

Buildfile: install.xml

readPasswords:

validate-env:
     [echo] Validating the environment..
     [echo] Successfully contacted discussion server running at http://localhost:8890/owc_discussions.
     [echo] Successfully contacted content server running at localhost:4444.

post-install:
     [echo] This target can also be called by setting 'piArgs' property for fine grained operations.
     [echo]         Possible values are:
     [echo]           -importRCOnly -- Imports only resource catalogs and exits.
     [echo]           -importGSOnly -- Imports only group spaces and exits.
     [echo]           -configDSOnly -- Configures data sources when SOA domain is not extended
     [echo]           -foreignJndiOnly -- Configures foreign JNDI links
     [echo]           -deploySTCOnly -- deploys server test case ejb
     [echo]           -all (default) -- Does all post install activies including all above
     [echo] Invoking post install script with args: -all
     .......................
     .......................
     .......................
     [exec] Initializing WebLogic Scripting Tool (WLST) ...
     [exec]
     [exec]
     [exec] Welcome to WebLogic Server Administration Scripting Shell
     [exec]
     [exec] Type help() for help on available commands
     [exec]
     [exec] Connecting to t3://localhost:7001 with userid weblogic ...
     [exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'ofmdomain'.
     [exec]
     [exec] Warning: An insecure protocol was used to connect to the
     [exec] server. To ensure on-the-wire security, the SSL port or
     [exec] Admin port should be used instead.
     [exec]
     [exec] Location changed to edit tree. This is a writable tree with
     [exec] DomainMBean as the root. To make changes you will need to start
     [exec] an edit session via startEdit().
     [exec]
     [exec] For more help, use help(edit)
     [exec]
     [exec] Starting an edit session ...
     [exec] Started edit session, please be sure to save and activate your
     [exec] changes once you are done.
     [exec] Creating Foreign JNDI links to BPM Runtime...
     [exec] Updating deployment targets for the datasources...
     [exec] Activating all your changes, this may take a while ...
     [exec] The edit lock associated with this edit session is released
     [exec] once the activation is completed.
     [exec] Activation completed
     [exec] Importing Resource Catalogs...
     [exec] Importing resource catalog: $Middleware_Home\Oracle_WC1\bpm\process_spaces\resourceCatalog\ProcessSpacesCatalog.ear
     [exec] Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
     [exec] For more help, use help(domainRuntime)
     [exec]
     [exec] Imported $Middleware_Home\Oracle_WC1\bpm\process_spaces\resourceCatalog\ProcessSpacesCatalog.ear
     [exec]
     [exec] Configuring webcenter services...
     [exec] Configuring webcenter to point to content server: localhost Port: 4444
     [exec]
     [exec] The Documents primary connection is "portal-content-server"
     [exec] Created connection "portal-content-server".
     [exec] To effect connection changes, you must restart the managed server on which the WebCenter application is deployed.
     [exec]
     [exec] Setting the spaces root on content server to :/WebCenter0809
     [exec]
     [exec]
     [exec]
     [exec] To effect connection changes, you must restart the managed server on which the WebCenter application is deployed.
     [exec]
     [exec] Configuring webcenter to point to the discussions server: http://localhost:8890/owc_discussions
     [exec]
     [exec] Created connection "portal-discussions".
     [exec] To effect connection changes, you must restart the managed server on which the WebCenter application is depl
oyed.
     [exec] Property "selected.connection" with value "portal-discussions" successfully added to service with id "oracle.webcenter.collab.forum"
     [exec] To effect connection changes, you must restart the managed server on which the WebCenter application is deployed.
     [exec] Property "selected.connection" with value "portal-discussions" successfully added to service with id "oracle.webcenter.collab.announcement"
     [exec] To effect connection changes, you must restart the managed server on which the WebCenter application is deployed.
     [exec]
     [exec] Services are configured. You need to restart webcenter to import BPM Process Portal group spaces. Call this script with '-importGSOnly' to import group spaces
     [exec] Grant PolicyStoreAccessPermission to oracle.bpm.pml.security.jar .....
     [exec]
     [exec] oracle.security.jps.service.policystore.PolicyStoreAccessPermission Granted to file:${wc.oracle.home}/soa/modules/oracle.bpm.runtime_11.1.1/oracle.bpm.pml.security.jar.

stop-webcenter:
    [mkdir] Created dir: C:\Users\satannam\AppData\Local\Temp\pp
    [touch] Creating C:\Users\satannam\AppData\Local\Temp\pp\shutdown.py
     [java]
     [java] Initializing WebLogic Scripting Tool (WLST) ...
     [java]
     [java] Welcome to WebLogic Server Administration Scripting Shell
     [java]
     [java] Type help() for help on available commands
     [java]
     [java] Connecting to t3://localhost:7001 with userid weblogic ...
     [java] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'ofmdomain'.
     [java]
     [java] Warning: An insecure protocol was used to connect to the
     [java] server. To ensure on-the-wire security, the SSL port or
     [java] Admin port should be used instead.
     [java]
     [java] Shutting down the server WC_Spaces with force=true while connected to AdminServer ...
     [java] .

install-spaces:
     [echo] process portal installation completed. Please start the managed server now.

install:

BUILD SUCCESSFUL
Total time: 53 seconds


Step 12: Start the WebCenter managed server back as this script will shutdown the managed server. Check all other managed servers are running okay. If not restart them.

Step 13: Execution of above script will result in creation of couple of connections in the WC_Spaces portal. Now,  login to EM console -> Expand WebCenter -> Portal -> Spaces -> WebCenter Portal (11.1.1)(WC_Spaces). Choose WebCenter Portal -> Settings -> Service Configuration.

Under the WebCenter Portal Service Configuration, choose "Content Repository" from Service Name and edit the portal-content-server connection.

In the Edit Content Repository Connection screen, change the Administrator User Name from sysadmin to weblogic.

You will be required to restart the WC_Spaces server after the connection update. Restart the WC_Spaces managed server.

Step 14: Change the following property values in the process-portal-install.properties file

extendSoa=false

Step 15: Now, execute the Ant script again with the following flag/option. This will import the group spaces into the WebCenter spaces.

$MIDDLEWARE_HOME/modules/org.apache.ant_1.7.1/bin/ant –f install.xml -DpiArgs="-importGSOnly"

Step 16: Ensure that the script ran without errors. If any errors are encountered at this stage, rectify them and re-run the Ant script before proceeding further.

Output of the above script will be something like below;

Buildfile: install.xml

readPasswords:

post-install:
     [echo] This target can also be called by setting 'piArgs' property for fine grained operations.
     [echo]         Possible values are:
     [echo]           -importRCOnly -- Imports only resource catalogs and exits.
     [echo]           -importGSOnly -- Imports only group spaces and exits.
     [echo]           -configDSOnly -- Configures data sources when SOA domain is not extended
     [echo]           -foreignJndiOnly -- Configures foreign JNDI links
     [echo]           -deploySTCOnly -- deploys server test case ejb
     [echo]           -all (default) -- Does all post install activies including all above
     [echo] Invoking post install script with args: -importGSOnly
     .........................
     .........................
     .........................
     [exec] Initializing WebLogic Scripting Tool (WLST) ...
     [exec]
     [exec]
     [exec] Welcome to WebLogic Server Administration Scripting Shell
     [exec]
     [exec] Type help() for help on available commands
     [exec]
     [exec] Connecting to t3://localhost:7001 with userid weblogic ...
     [exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'ofmdomain'.
     [exec]
     [exec] Warning: An insecure protocol was used to connect to the
     [exec] server. To ensure on-the-wire security, the SSL port or
     [exec] Admin port should be used instead.
     [exec]
     [exec] Importing group spaces into webcenter...
     [exec] Importing group space: $Middleware_Home\Oracle_WC1\bpm\process_spaces\groupspaces\default-modeling-workspace-gs.ear
     [exec] Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
     [exec] For more help, use help(domainRuntime)
     [exec]
     [exec] Imported $Middleware_Home\Oracle_WC1\bpm\process_spaces\groupspaces\default-modeling-workspace-gs.ear
     [exec]
     [exec] Importing group space: $Middleware_Home\Oracle_WC1\bpm\process_spaces\groupspaces\default-modeling-workspace-gst.ear
     [exec]
     [exec] Imported $Middleware_Home\Oracle_WC1\bpm\process_spaces\groupspaces\default-modeling-workspace-gst.ear
     [exec]
     [exec] Importing group space: $Middleware_Home\Oracle_WC1\bpm\process_spaces\groupspaces\default-process-workspace-gs.ear

     [exec]
     [exec] Imported $Middleware_Home\Oracle_WC1\bpm\process_spaces\groupspaces\default-process-workspace-gs.ear
     [exec]
     [exec] Importing group space: $Middleware_Home\Oracle_WC1\bpm\process_spaces\groupspaces\default-process-workspace-gst.ear
     [exec]
     [exec] Imported $Middleware_Home\Oracle_WC1\bpm\process_spaces\groupspaces\default-process-workspace-gst.ear
     [exec]
     [exec] Importing group space: $Middleware_Home\Oracle_WC1\bpm\process_spaces\groupspaces\process-instance-gst.ear
     [exec]
     [exec] Imported $Middleware_Home\Oracle_WC1\bpm\process_spaces\groupspaces\process-instance-gst.ear
     [exec]
     [exec]
     [exec]
     [exec] Exiting WebLogic Scripting Tool.
     [exec]

BUILD SUCCESSFUL
Total time: 32 seconds


Step 17: This script will shutdown the WebCenter managed server and the Admin server. Restart the Admin server and WebCenter managed servers.

Step 18: Check whether the following users are already provisioned in ECM. If not create them manually.
Login to ECM http://<hostname>:16200/cs
Choose Administration -> Admin Applets

Click on User Admin and add the following users and grant all roles to these users
PersonalSpaces
ProcessPortal



Step 19: All set! Login to WebCenter spaces and verify that the BPM group spaces are available. That is a good sign that the WebCenter spaces portal has been extended successfully with BPM process spaces.