Tuesday, March 29, 2011

Customizing Jdeveloper to your need

 

First thing need to be done before any ADF or any other project is to define the project structure , file naming convention , package structure , common business component suffix etc.

Jdeveloper has very nice way of doing all this using Tool –> Prefrences

1.Override the ADF BC impl file.

Most common practive I have seen in last five year of application development using OAF , ADF is to have ViewImpl and EntityImpl , AppmoduleImpl extension for generic requirement.

image

This is place in jdeveloper where we can specify that files.

2.Class naming

This is good naming convention given by oracle for default ,so I am not interested in changing this.

3.Creating new history type

By default when we create Entity Object we can five history type for each attribute in jdeveloper. If we want to create any business specific history type that applies to all entity object , here is the place to go.

image

image

4.Object Naming

I like this feature very much as it simplifies object naming throughout our application.

So when we create ADF BC component it will suffix following characters to the business component name to differentiate between different object type.

image

5.Packages

This is also very nice feature which will place the ADF BC files automatically in corresponding package after doing this setting.

image

6.Extensions

This is nice feature to check what extension is currently installed on your jdeveloper i.e. good during working with webcenter.

image

7.Code Templates

This feature reduce the typing while writing stuff in managed bean or jsf file.

Example :- I have use sop feature too much , so when I write sop and press ctrl enter it write System.out.println.

This is based on following setting

image

So we can have our own custom template for other stuff here.

Here is SQL Editor code template

image

8.CSS Editor

For style sheet person ,this is great feature for selecting CSS style sheet.

one can specify custom too.

image

9.Deployment

You might have noticed while create ear that it save the file in deploy folder inside application. If we want some other folder , here is place to set.

image

10.File Type

When we open jsff or jspx file in jdeveloper ,it open it in design view by default and it take some time to open since it renders the GUI.

To save some time you can set the GUI file to open in source view.

image

11.Short Cut Keys

If we want to define short cut keys for our jdeveloper related daily task then this is way to go.

image

There are many other feature in preference ,however described one is used mostly in most of development places by developer for ease of work.

Resetting Jdeveloper Window Positioning

I have seen sometime I want to go back to old jdeveloper view after messing around jdeveloper and re-arranging lot of development related window.

Simple level of component position back to original can be achieve by going to

Window –> Reset Window to Factory Settings.

image

However  it will not change the sizing of window and few other stuff.

To completely wipe off GUI Setting for jdeveloper go to following directory in

Document Setting or C:/User folder and delete file “windowinglayout.xml” and restart the jdeveloper.

AppData\Roaming\JDeveloper\system11.1.1.4.******\o.ide

Friday, March 25, 2011

ADF Entity Object Synchronize do not work in many cases

 

As you might have noticed that entity object in oracle adf provide you with great feature of synchronizing the entity object. However , synchronize do not work in few cases and I have listed all cases where it work and where it does not.

Synchronize Works

When we alter the table by adding column.

Synchronize Do Not Work

When we drop the column from DB table.

It do not handle change data type like precision change and other.

For this we need to manually change this in EO and any other reference in project using Find Usage feature of jdeveloper.

ADF with DB2 SQL Server Oracle

 

If we want to use one ADF application with multiple database then we have to select SQL92 Flavor when building an application. This makes application portable to both Oracle DB and Non Oracle DB.

Explanation :-

When we create first business component for fusion web application.

Jdeveloper prompt the dialog for database connection that we can choose.

There are two more important selection that are

SQL Flavor

SQL flavor will be use by view objects  to formulate SQL statements. Although the default for an Oracle database connection is always the Oracle SQL flavor, other SQL flavors you can choose include OLite (for the Oracle Lite database), SQLServer for a Microsoft SQLServer database, DB2 for an IBM DB2 database, and SQL92 for any other supported SQL92- compliant database.

image

Once SQL Flavour is selected it cannot be changed later on using project properties, but can be overidden in adf-config.xml overiew.

image

When we overide it adds following lines in adf-config.xml

When Specified database type in the adf-config.xml file supports generating SQL statements during runtime which can require the actual database type

image

image

There is more imporant setting of Type Map that that data model project will use. If JDeveloper detects you are using an Oracle database driver, it defaults the Type Map setting to the Oracle type map and will use the optimized types in the oracle.jbo.domain package.

We can also change to use Java type map.

Also , One cannot change the type map after it is initialized a data model project.

Wednesday, March 23, 2011

ADF Fusion Project Library ViewController and Model

 

Some time even experience developer do not focus about which libraries are added to which project in ADF Fusion standard project.

JDeveloper adds the following libraries Model:

  • ADF Model Runtime
  • BC4J Oracle Domains
  • BC4J Runtime
  • BC4J Security
  • BC4J Tester
  • MDS Runtime
  • MDS Runtime Dependencies
  • Oracle JDBC

JDeveloper add the following libraries to ViewController project:

  • JSP Runtime
  • JSF 1.2
  • JSTL 1.2
  • ADF Page Flow Runtime
  • ADF Controller Runtime
  • ADF Controller Schema
  • ADF Faces Runtime 11
  • ADF Common Runtime
  • ADF Web Runtime
  • MDS Runtime
  • MDS Runtime Dependencies
  • Commons Beautils 1.6
  • Commons Logging 1.0.4
  • Commons Collections 3.1
  • ADF DVT Faces Runtime
  • ADF DVT Faces Databinding Runtime

When we add a JSF page, JDeveloper adds the Oracle JEWT library.

Tuesday, March 15, 2011

Double Click ADF Table Row Selection

I came across requirement where I need to write complex adf taskflow and show end result in af :table component in adf popup component.

However , when popup is displayed in adf user has habit to double click to select row. that led me to make my complex task flow to handle double click for row selection.

1.Develop simple ADF BC

2. Drag/Drop as table

3.Insert clientlistener inside table component and set client listener type to dblClick and give any method name that will be written in javascript

<af:clientListener method="takedblclk" type="dblClick"/>

So client listener will respond to double click on table component.

When user click double click on table component , row will set as current by table selection listener.

Moreover , java script is queuing server listener event using

AdfCustomEvent.queue(table, "TableDblClk",{},true);

that is calling server listener managed bean method where we can get the value of current row using iterator.

image

image

image

Now we can use this value for any purpose.

Jdev PS3–Increase memory Increase Performance

 

How to set higher memory in jdeveloper to increase performance.

I have 64 Bit Machine with 64 bit JDK as you can see in window task manager

image

Open Ide.conf located at MiddlewareJdev\jdeveloper\ide\bin

Set

AddVMOption  -Xmx1250M

AddVMOption  -Xms512M

Open jdev.conf located at MiddlewareJdev\jdeveloper\jdev\bin

Set

AddVMOption  -XX:MaxPermSize=1024M

You can increase the size of AddVMoption to 2048 MB ,if you have more RAM.

Exception :- When you see message like “Jdev cannot create an instance of JVM” then you have 32 bit jvm , try to change your jvm to 64 bit.

Friday, March 4, 2011

Installing Webcenter PS3 11.1.1.1.4 with ECM UCM

 

Oracle XE Database

Install Oracle XE

Before installing RCU for webcenter and UCM/ECM make sure you have following server parameter set.

image

RCU for Webcenter and UCM

Run RCU on Oracle XE and Create Schema for WebCenter and UCM

image

64 bit JDK for 64 Bit Installation

I have 64 bit Window OS ,so I am planning to have weblogic , jdev 64 installation.

So I installed Java SE Development JDK update 24 for window 64 bit.

First verify the java version on window command line as below.

image

Install Jdeveloper PS3

Install jdeveloper and when it asks for JDK path please choose the path for 64 bit jdk.

Installing Weblogic

Go to weblogic directory and run the following command.

java –jar wls1034_generic.jar

It will open the installer for weblogic installation and you just have to follow next step until it ask for JDK location where you can give you 64 bit jdk location

So we have Oracle XE , Jdeveloper , RCU for Webcenter , UCM and Weblogic server installed successfully.

If you feeling boring about installation you can start playing with Oracle ADF which is awesome in 11.4 before you start installing rest of webcenter and ucm.

Installation of Webcenter

Go to following directory of extracted webcenter.

Since we are installing on 64bit JDK and 64 Bit OS go to following directory

ofm_wc_generic_11.1.1.4.0_disk1_1of1\Disk1\install\win64

it will ask for the JDK path ,please provide 64 bit path.

Let the home be Oracle_WC1 for webcenter inside Oracle\Middleware

image

It is easy installation steps and after installation you will see following component installed.

Webcenter Spaces
Webcenter Framework
Webcenter portlets
Webcenter Wiki and Blog Server
Oracle Discussion Server
Oracle Enterprise Manager

Moreover , Oracle_WC1 and oracle_common folder is created.

Configure Oracle Webcenter

Run

Oracle_WC1/common/bin/config.cmd

Create new weblogic domain and select the following for webcenter

image

I configured following component

image

Installing the ECM

This is pretty easy five step to install ,but remember to give 64 bit jdk path .

Middleware/Oracle_ECM1 folder is created after installation.

Configuring ECM

Go to Middleware\Oracle_ECM1\common\bin\config.cmd

Please remember to select extend the weblogic server domain and then select only “Content Management”

This is disabled because I forget to take screen shot before.

image

Then select UCM Schema in next step.

image

Please restart your machine because initially when I tried to start UCM and open the URL it was giving 404 exception.

Start Managed UCM server

We are starting manually because we have not configured node manager for UCM which I will do it later on and update the document.

startManagedWeblogic –UCM_server1 http://hostname:portname

This will start the UCM_server1

http://hostname:16200/cs

use weblogic console password to login to cs.

first time it will bring configuration screen , so click the submit button without changing any setting

when you login first time , you will see this error.

Alert

  • The weblayout directory is on a filesystem with 8dot3 semantics. Legacy 16-bit 8dot3 filenames conflict with revision labels and will cause file loss. Disable 8dot3 semantics by running "Installer DisableNtfs8dot3" and then restarting Windows.

image

To get rid of this error you need to update registry key in window registry.

To change the Windows registry, go to the following key:

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/FileSystem

Then, set the value of the NtfsDisable8dot3NameCreation key to 1.

You must restart Windows for the new setting to take effect.

Right this key and set it to 1.

image

Restart windows.


Login again to ECM and you will not see weblayout error any more.


http://hostname:16200/cs


Missing Contribution Folder


If you have worked with previous version of content server you would have used “Contribution Folder”. However we don’t see it here.


image


To see “Contribution Folder” you need to do following setting


Login to content server using weblogic em userid/password


image


Click “Admin Server” which will open consequence admin server page.


Click “Component Manager” and scroll to folder section.


image


Click “folder_g” checkbox to true and update at the end of page


image


image


Restart the UCM_server1 and log back in to content server.


image


Now you can see “Contribution Folder”


Connect to ECM from Jdeveloper


 


 


Start Webcenter Spaces


startManagedWeblogic WC_Spaces http://hostname:post


you will notice one error


image


go to Database navigator in jdeveloper


Create new db connection “DEV_MDS” and open package and compile MDS_INTERNAL_SHREDDED.


image


to resolve this error open jdeveloper and compile the package and restart the server.


Login to UCM and Webcenter Spaces


Start AdminServer


Start UCM_server1


Start WC_Spaces


http://hostname:16200/cs


http://hostname:8888/webcenter

Thursday, March 3, 2011

Installing Oracle Webcenter VM - Life Made Easy

I remember the days when i use to install oracle xe , jdeveloper , weblogic , rcu , webcenter , soa suite , bpm suite. It was taking around 2-3 days for me to install
this bunch of software on my laptop.

I did this installation around seven to eight times in last 4 years.
after every new bunch of software version released every few month.

However , My life is easy now and oracle has saved my lot of time by providing
webcenter virtual box which takes around 2 hour to install all stuff that i
want for my current development.

Just google "wecbcenter virtual box" and enjoy the ride.

Thanks to oracle infrastructure people , few of whom i know very well.


Thanks again,
Simply Hasim

Show Popup from Managed Bean

af:popup id="p1" binding="#{managedbean.bindp1}"
popup child component
af:popup

bindp1 is binding variable for popup in managed bean.

public void showPopup(){
ExtendedRenderKitService erkService =Service.getService(fctx.getRenderKit(),ExtendedRenderKitService.class);
erkService.addScript(fctx,"AdfPage.PAGE.findComponent('" + bindp1 + "').show();");
}


public void hidePopup(){
ExtendedRenderKitService erkService =Service.getService(fctx.getRenderKit(),ExtendedRenderKitService.class);
erkService.addScript(fctx,"AdfPage.PAGE.findComponent('" + bindp1 + "').show();");
}

How to Make Row Current From Managed Bean

If you have scenario when user click the row and you want to get current row value and performt some customized operation then this is best way to do it.

1. go to af:Table component and overide
selectionListener="#{pageFlowScope.ManagedBeanName.methodName}"

2.
public void methodName(){
String MakeCrt= "#{bindings.TableVO1.collectionModel.makeCurrent}";
JSFUtils.invokeMethodExpression(MakeCrt, Object.class, SelectionEvent.class, selectionEvent);
}