Monday, January 18, 2010

ADF 11g: Define default UI for MDS user customization

JDeveloper Version:


In this post I want to show how you can enhance the built-in feature “user customization accross sessions using MDS”. If you just activate this feature an define the default UserCC-class to be used, you typically will face the problem that for the first time the end users access your web application they will see the UI, layout, etc. as designed by the developer. Very often default values will be used so at the end someone might end up with fine tuning advises  like “Please expand this column by 5px and put column x in front of the others….” and so on. And in the end you will still be not sure if your layout meet the exact idea of the manager.

What managers actually want is, to define e.g. the width of columns, etc on their own and let that setting be the default for all the other end users. With ADF11g that requirement can be achieved with only a few lines of code + configuration.

How to do

Create a custom Customization Class like the following


import javax.faces.context.FacesContext;

import oracle.adf.share.config.UserCC;

import oracle.mds.core.MetadataObject;
import oracle.mds.core.RestrictedSession;

public class DefaultUserCC extends UserCC {

  private static final String DEFAULT_CC_VALUE_USERNAME =

  public DefaultUserCC() {

   * Overrides the UserCC
   * @param sess
   * @param mo
   * @return
  public String[] getValue(RestrictedSession sess, MetadataObject mo) {

    String[] value = super.getValue(sess, mo);
    if (value == null) {
      return null;

    FacesContext context = FacesContext.getCurrentInstance();
    String valueUsername =
    if (valueUsername == null) {
      return value;

    return new String[] { valueUsername };


and register it in your adf-config.xml file at the following position


It is important, to register the DefaultUserCC-class before UserCC class since that’s the precendence which will be evaluated by the MDS runtime.

Now edit the web.xml and add the following parameter to define the user whose mds runtime customization will be used as default customization for users that have not customized their UI yet.


With that configuration sking will be able to define the default UI  for all the other users.

Further reading

Customizing Applications with MDS

Monday, January 11, 2010

JDeveloper 11g: Know the IDEs coding features to get more productive

JDeveloper Version:


There are a couple of useful IDE features that may not be so obvious because those are not always accessible by the menu but only through shortcuts. So in this post I just want to show some of the cool features that makes one more productive while developing.

Tag-Documentation (Press Ctrl-D on a Tag)


Javadoc-Documentation (Press Ctrl-D on a class or method in java source code)


Javadoc-Documentation (Press Alt and Mouse Over on a class or method in java source code)


Quick Source View (Shift+ Mouse Over Sourcefiles in Application navigator)


Quick View in Sourcecode Mode (Ctrl+Mouse Over on right indicator bar) 0001@1800_1800-412664a6be23a67f

This also works for Java Sourcecode of course:


Block Coloring (new in JDev


Quick Preview in Taskflow (Shift+Mouse Over view-activity)


Quick file switch (Strg+TAB)


Go to Java Type (Ctrl+-)


Alternatively use the search box in the top right corner of the IDE


to quickly find the file you are looking for. In most cases you will be faster than searching manually in the application navigator.

Quick Outline/Method navigation (Ctrl+Shift+O)


Customize and explore

And of course you can customize your IDE shortcuts under Preferences>Shortcut keys


And of course it is good place to explorer new CodeEditor features.


There are still some features I am missing. used from e.g. Eclipse. This is

  • Ctrl+D: Delete current line
  • Alt+Arrow Up/Down: Move current line/block up down. This is really cool once you get used to it!

Friday, January 8, 2010

JDeveloper 11: Incomplete ViewObject information after IDE restart

Status: open
JDeveloper Version:


Last time I often face the following issue:

  1. Have a ViewObject-Definition file in Overview mode openedimage
  2. Close JDeveloper.
  3. Restart JDeveloper
  4. Not every time but somtimes the ViewObject-Definition file seems to be incomplete!
  5. Sometimes information shows up, but the two Overview tabs are confusing…
  6. Any explanations for that behaviour?


First keep cool;-), your ViewObject-Definition content is still there! It just does not show up correctly in Overview Mode. Close the file and reopen it.


Seeems like the two overview tabs show up everytime.

Saturday, January 2, 2010

Oracle TPC: Possible upgrade issue from to

Status: resolved
Oracle Team Productivity Center:
Oracle WebLogic Server: 10.3.2
Environment: TELDE

First of all I wish all my readers out there a HAPPY AND SUCCESSFUL NEW YEAR 2010!

In a previous post I have blogged about setting up (a clean) Oracle Team Productivity Center Server. In this post I want to share my experience if you upgrade an existing OTPC database repository to but want to install the otpc.war on a clean WLS 10.3.2 domain.


Client Start Xming
Putty Login as oracle
{setup your environment}
[oracle@telde ~]$ cd /u01/product/oracle/middleware/11.1.1/tpc/ [oracle@telde tpc]$ java -jar tpcinstaller.jar
Installer 1.Provide the database connection properties to the existing OTPC repository
2.Choose the autodeploy directory of a clean WLS 10.3.2 domain
3.Start installation
  You will encounter the following error

So how to solve the installation error if you want to install on a clean WLS 10.3.2 domain?


Putty Login as oracle
{setup your environment}

OK so now we need to manually install the otpc.war into weblogic domain.

1) We first verify that it is included in the tpcinstaller:

[oracle@telde tmp]$ jar -vft tpcinstaller.jar | grep otpc
16485122 Fri Oct 30 01:33:40 CET 2009 lib/otpc.war

2) Now we extract it and copy otpc.war to the domain home/autodeploy

[oracle@telde tmp]$ jar -xf tpcinstaller.jar lib/otpc.war
[oracle@telde tmp]$ cp -p lib/otpc.war $DOMAIN_HOME/autodeploy

3)Run the tpcinstaller once again!!!!

4)Start the WebLogic server

[oracle@telde tmp]$cd $DH
[oracle@telde fusion_domain]./


Background information

During installation of OTPC the otcp.war is modified so that it contains the correct database connection information.

[oracle@telde autodeploy]$ cd /u01/app/oracle/product/
[oracle@telde autodeploy]$ ls -l
total 24252
-rw-r--r-- 1 oracle oinstall  8309132 Nov  5 07:43 otpc.war
-rw-r--r-- 1 oracle oinstall 16485122 Oct 30 01:33 otpc.war-1257402576730
-rw-r----- 1 oracle oinstall     2131 Nov  4 02:07 readme.txt

Those connection properties are stored in persistence.xml which itself is contained in _wl_cls_gen.jar file.


So if you encounter connection problems persistence.xml in the exploded app directory is the file you should first look to verify the connection properties.