Thursday, July 29, 2010

Accessing Runtime metadata for ViewObject and EntityObject

In Oracle ADF, ViewObject and EntityObject are two basic concepts and whole application revolves around these two type of objects. EntityObject corresponds to database table while ViewObject corresponds to Database View. ViewObject can be based on EntityObject, SQL or on transient attributes. Normally you create and design these two objects throug drag and drop in JDeveloper but sometimes you need some meta information about these two objects in business logic. In order to get metainfo, some understanding of underlying structure of these two objects should be.
Figure shown above illustrates the three primary interfaces ADF provides for accessing runtime metadata about view objects and entity objects. The ViewObject interface extends the StructureDef interface. The class representing the entity definition (EntityDefImpl) also implements this interface. As its name implies, the StructureDef defines the structure and the component and provides access to a collection of AttributeDef objects that offer runtime metadata about each attribute in the view object row or entity row. Using an AttributeDef, you can access its companion AttributeHints object to reference hints like the display label, format mask, tooltip, etc.
Now you can use this understanding to get runtime meta info about view object or entity object e.g. if i want to find whether a ViewObject is readonly non entity based object or not. i can find it by:

  • isFullSql() is true

    This method returns true if the view object's SQL query is completely specified by the developer, as opposed to having the select list derived automatically based on the participating entity usages.

  • getEntityDefs() is null

    This method returns an array of EntityDefImpl objects representing the view object's entity usages. If it returns null, then the view object has no entity usages.

Wednesday, May 19, 2010

Integrated Weblogic Server Domain

I was developing an application on JDeveloper 11g and deploying it on intergrated weblogic server. In my application i was authenticating using my own authentication provider but when i configured it on weblogic, weblogic failed to start. I was not finding any configuration file where i can revert security settings of weblogic but after some try i found it and thought to share it with others. When you install JDeveloper on windows, it places configuration files under "C:\Documents and Settings\user_name\Application Data\JDeveloper". Here you can find all settings for jdeveloper and integrated weblogic. Under this directory there is a folder with something "system11.....". Now to change weblogic related settings, open "defaultDomain/config.xml" and change it accordingly.