20 March, 2012

Date Classes Conversion in ADF


In ADF we can use three data types classes of Date
oracle.jbo.domain.Date
java.util.Date
java.sql.Date

Note oracle.jbo.domain.Date class extends  java.sql.Date class 

Many ADF developers sometimes face exception when assigning or casting different Date classes to another, It will raise exception ClassCastException

So I will present a methods to convert between different Date classes
I add main method to test Date Conversion between different class.
I add an object for every class and assign it to current date of system.

15 March, 2012

Get Rows count in Whole Schema


Today I will produce function which returns count of rows in whole schema.

I can do this task using two solutions

12 March, 2012

Log DDL Changes in Your Schema


A lot of developers or DBA do a lot of  DDL operations on same schema
So we should create logging for this DDL operations in database table.

At first this post depends on my previous post Oracle System Events and Client Events


I should store all below data in logging
I will create table to store data of logging and I suggested below attributes 
1- DDL operation date
2- DB Username
3- Operating System Username
4- Machine that command executed from it.
5- Terminal that command executed from it.
6- DDL Operation Type (Create,Drop,Alter,...)
7- Database Object Type (Table, View, ......)
8- Database Object Name

Oracle Forms 11g Release 2 (11.1.2) New Features

I will list important  new features that are supported in Oracle Forms 11g release 2 (11.1.2)

#1 Integration with Oracle Access Manager
Oracle Access Manager is an identity management solution that provides centralized
authentication, policy based authorizations and auditing. With Oracle Forms 11g Release 2
you can use Oracle Access Manager for authentication and authorization of your Oracle Forms
application.

#2 Reduced Installation Footprint
In order to reduce the resource requirements on development machines, you can perform an
installation specifically tailored for development. This will limit the number of software products
and servers installed on the machine whilst still allowing a developer to build, run and test their
Forms application.

#3 Performance and Monitoring
Oracle Forms 11g Release 2 provides more dynamic capabilities to pre-start Forms runtime
processing. For example, an administrator can define a set number of runtime engines to be
started at 9am if it is known that most users log onto the system at that time. This will result in
improved start up times for users.

#4 Real User Experience Interaction
Oracle Real User Experience Interaction (RUEI) is a feature of Oracle Fusion Middleware that
provides non-intrusive monitoring, giving insight into how a user is interacting with an
application.

#5 Forms menu bar and window decoration to be turned of
which allows Forms to be more seamlessly integrated into other technology pages such as HTML pages.

Thanks
Mahmoud Ahmed El-Sayed

10 March, 2012

Oracle System Events and Client Events

Oracle Events are the events that are executed in oracle instance or user schema (DDL ,DCL Operations)

There are two types of events
A- Oracle System Events
   STARTUP, SHUTDOWN and SERVERERROR

B- Client Events
    LOGON, LOGOFF, DB_ROLE_CHANGE, SUSPEND, ALTER, DROP, CREATE, ANALYZE, AUDIT, NONAUDIT, DDL, GRANT, REVOKE and TRUNCATE.

In any of previous events I can develop database triggers on database or schema  for tracking, monitoring, logging or do any action.

For example( Trigger after startup database)
CREATE OR REPLACE TRIGGER XXX_TRG
   AFTER STARTUP
   ON DATABASE
BEGIN
   NULL;
--Write your code here
END; 

08 March, 2012

Add UI Components at Runtime In ADF

Sometimes we need to add UI components to page at run-time.
So I developed generic method that we can use it for adding components to page at run-time

Method Code 

    public void addComponent(UIComponent parentUIComponent, UIComponent childUIComponent){
        parentUIComponent.getChildren().add(childUIComponent);
        AdfFacesContext.getCurrentInstance().addPartialTarget(parentUIComponent);
    }


Call Method From Anywhere

    public void addUI(ActionEvent actionEvent) {
        // Add event code here...
        RichInputText ui = new RichInputText();
        ui.setId("rit1");
        ui.setLabel("Label of RichInputText");
        ui.setValue("Value of RichInputText");
        
        addComponent(getPgl1(), ui);
    } 

Note that getPgl1() return component of PanelGroupLayout component
I created ui object of RichInputText, You can create object of any UIComponents subclass like RichInputDate, RichSelectOneChoice, RichDecorativeBox, ...............

Mahmoud Ahmed El-Sayed

06 March, 2012

Java Decompiler in Jdeveloper

Java Decompiler  is a standalone graphical utility that displays Java source codes of “.class” files.
Below is snapshot of Java Decompiler program

 You can download this program from here

I will illustrate how to use this program as External Tool in Jdeveloper

ADF : Scope Variables

Oracle ADF uses many variables and each variable has a scope. There are five scopes in ADF (Application, Request, Session, View and PageFl...