Integration of BIRT Report with Oracle ADF

Requirement -Using BIRT Report with Oracle ADF

Solution –
Environment:
Jdev 11.1.0.2
JDK 1.6
Weblogic 10
Birt runtime 2.6.2

-> Download birt_runtime_2_6_2 from eclipse.org
-> Extract the content to a folder
-> From the WebViewerExample sub folder, copy lib, platform, tlds folders and server-config.wsdd to WEB-INF of the ViewController project of your ADF application
-> From the WebViewerExample sub folder, copy webcontent, scriptlib, report and logs folders to public_html folder of the ViewController project of the ADF application
-> Create a folder named reports in public_html folder of the project. This will contain all the rptdesign files.
-> Edit web.xml of your project to reflect all the contents of the web.xml of WebViewerExample of birt runtime
-> Because weblogic has an older version of js.jar of rhino, download rhino.jar from www.mozilla.org to WEB-INF\lib folder of ViewController project and add it in your project library classpath.
-> In order to have this rhino take precedence over the older version, edit weblogic-application.xml to include the following in the Application Preferred Packages under Class Loading tab;
org.mozilla.javascript.* and
org.mozilla.classfile.*
-> At this point, you can run your reports from a backing bean as follows;

 
 public void call_report() 
{

FacesContext ctx = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
 
// Redirect browser
url = request.getContextPath()+"/frameset?__report=reports/test.rptdesign";
try {
//url = ctx.getExternalContext().encodeResourceURL(url);
ctx.getExternalContext().redirect(url);
} catch (IOException e) {
e.printStackTrace();
message = new FacesMessage(
FacesMessage.SEVERITY_FATAL, e.getMessage(), "");
FacesContext.getCurrentInstance().addMessage(null, message);
}
}
 

If you get “Error: Java code in jsp source files is not allowed in ojsp.next mode” when running jspx applications, you need to enable user customizations.
In Jdeveloper workspace,
1. Go to Project Property
2. Go to ADF View
3. Enable User Customizations
4. check on Across Sessions using MDS
Also you need to either adapt your code to remove the scriptlets in your JSP page,
or you can use the following Java option to disable OJSP:
-Dadfvdt.disableOjspDeployment=true
You can add this option -Dadfvdt.disableOjspDeployment=true in your file “ide.conf” in the directory “\jdeveloper\ide\bin”
For your Production environment, you can have your Managed WLS ignoring the OJSP mode by adding the Java Option -Dadfvdt.disableOjspDeployment=true
* in the “startManagedWebLogic” (if you want to limit it to a specific Managed Server)
* or “setDomainEnv” (for all managed servers in a domain).

NOTE:
-> Ensure that you have the same version of birt_runtime corresponding to the version of rpt design files
-> birt 2.6.2 is not compatible with google chrome. (works well with ie and firefox)

I found this information in OTN. Special thanks to -Michael Ekeagbara

Happy coding with Vinay Kumar in techartifact.

Jdev installation set up for running Webcenter Spaces instance

JDeveloper installation for running webcenter 11.1.1.5

Download JDeveloper 11.1.1.5 for your OS from this location:
http://www.oracle.com/technetwork/developer-tools/jdev/downloads/jdeveloper11116-1377208.html

Install JDeveloper to your local development machine, perform a typical installation.

After JDeveloper is installed, open up „Check for Updates“ dialog under the „Help“ menu.

1

Check that the following update centers are activated:

2

Check the two WebCenter updates:

3
We have to further extend JDeveloper for working with a running WebCenter: Spaces instance.

Download the following package and unzip it:
http://download.oracle.com/otndocs/tech/webcenter/files/DesignWebCenterSpaces_PS5.zip

There you will find three directories, two of them starting with „copy_to_….“.

„copy_to_common“ includes a common directory that contains WebCenter Portal WLST commands. WebCenter Portal’s WLST commands are required to upload customized resources directly to the Spaces application from DesignWebCenterSpaces.jws.

The content (!) of the „copy_to_common“ directory (not the whole directory itself) must be copied to \oracle_common\
„copy_to_jdev_ext“ includes oracle.webcenter.portal.jar. Required update to Oracle JDeveloper WebCenter Portal Framework and Services Design Time Extensions
.

The .jar file in the „copy_to_jdev_ext“ directory must be copied to \jdeveloper\jdev\extensions\

Deploy Custom ADF Application to WebCenter Spaces

Requirement- How to deploy custom ADF task flow to Webcenter spaces

Solutions-You can extend or alter the look and feel and functionality of Oracle WebCenter Spaces task flows using the Oracle JDeveloper Customization Developer role. If you want to build custom task flow application to spaces.If you want 100% customization then you can use custom task flow.see this Portal vs Spaces. When you want to deploy 100% task flow, its bit trickt.Please follow the steps

Steps-

ADF application with custom task flow-

-> Create a new deployment profile (“ADF Library JAR file”) for the View Controller project
-> Delete the existing WAR deployment profile from View Controller -> Project Properties
-> Deploy the View Controller to ADF Library JAR (Right Click on ViewController -> Deploy)
-> Note the location of the JAR file

Create a wrapper project which will be deployed as WAR file and will include the taskflow JAR file

-> Create a new Generic Project
-> Create a WAR deployment Profile
-> Add task flow JAR file to WAR deployment.
-> Right click on the new project -> Project Properties
-> Select library and classpath
. Click ‘Add JAR/directory’
. Add the JAR created in step (4)
-> Edit web.xml for the wrapper project and remove all entries
. Note: FAILURE to do this will result in errors
-> Deploy the Wrapper project to Webcenter spaces (Right Click wrapper project -> Deploy)
. Create connection to Server
. Select WC_Spaces Managed Server
. Ensure to select radio button “Deploy as shared library”
. After Deployment, Ensure Library is displayed by logging into the WLS Console (Admin server)
Extend Spaces and reference the library that contains the custom task flow
1. Download and install Oracle JDeveloper WebCenter Framework and Services Design Time Extensions:
. In JDeveloper, select Help > Check for Updates.
. Click Next, and then Next again to display all available updates.
. Use the search field to filter the list, for example, enter ‘webcenter framework’.
. Select WebCenter Framework and Services Design Time.
. Click Finish.
2. Download the WebCenter Spaces development ZIP file (DesignWebCenterSpaces_ps4.zip) from Oracle Technology Network:
http://download.oracle.com/otndocs/tech/webcenter/files/DesignWebCenterSpaces_ps4.zip
3. Copy WebCenter’s WLST (WebLogic Scripting Tool) commands to the Oracle home directory where JDeveloper is installed:
. Navigate to \copy_to_common
. Make a copy of the common directory.
. The common directory is located under \copy_to_common.
. Navigate to: \oracle_common
. Copy the content of the common directory here.
. Copy new version of oracle.webcenter.portal.jar to the Oracle JDeveloper extensions directory:
a. Navigate to \copy_to_jdev_ext
b. Make a copy of oracle.webcenter.portal.jar.
c. The oracle.webcenter.portal.jar file is located under
\copy_to_jdev_ext.
d. Navigate to: \jdeveloper\jdev\extensions\
e. Copy the oracle.webcenter.portal.jar file here.
4. Restart JDeveloper if it is open.
5. Edit weblogic.xml and add your library
6. Modify the config.properties files

Before you can build the shared library list and deploy extend.spaces.webapp.war to the WebCenter Spaces managed server, you must provide some information about your environment and your WebCenter Spaces installation in the configuration file config.properties

. To set build and deployment properties for the extend.spaces.webapp shared library
. Open DesignWebCenterSpaces.jws.
. Expand the WebCenterSpacesExtensionLibrary project.
. Open config.properties.
. Enter information about your JDeveloper environment and WebCenter Spaces installation, as shown in
. The config.properties file describes each property and offers examples. The defaults provided are only samples and must be replaced with your own, installation-specific values.
7. Save your updates to config.properties
8. Select WebCenterSpacesExtensionLibrary project and deploy to WC_Spaces using ANT
. Clean stage
. Deploy-shared-lib
. After Deployment, Ensure Library is displayed in WLS Console

Register the taskflow in Resource Catalog
1. Login to Webcenter spaces
2. Click on ‘Administration’
3. Create a new catalog and copy it from the default catalog
4. Select the newly created catalog and click on ‘Edit’ -> ‘Edit’
5. In the ‘Edit’ popup, select Add -> Add from library
6. In the search box, enter the name of your taskflow
7. Select your taskflow and give it a ‘Name’ and click ‘Add’. This adds the taskflow to the resource catalog
8. Select the newly created catalog and click Edit -> show
9. Click on ‘Configuratiions’ tab
10. Change the ‘Resource Catalog for Home spaces’ to the newly created catalog and click ‘Apply’
11. Now go back to webcenter spaces and to test the newly created taskflow:
. Create a new page
. Click on ‘Add Content’
. Select the taskflow from the catalog and click ‘Add’. The taskflow should
appear on the page
. Click ‘Save’ and ‘Close’