Sunday, January 26, 2014

ADF Sample Applications

https://code.google.com/p/adfsampleslist/downloads/list

Tuesday, January 21, 2014

Entity java classes

Small description for the three entity java classes:

In addition to XML files, entity object definitions comprise up to three Java classes:
  • The entity object class - an instance of this class (an entity object instance) represents a single row from the datasource
  • The entity collection class - an instance of this class represents the collection of rows currently in memory for a single user
  • The entity definition class - the singleton instance of this class represents represents the entire datasource object

Monday, January 13, 2014

Metadata XML files In ADF

The following metadata XML files are generated once the Fusion web application generation wizard is finished:
1. adf-settings.xml: The adf-settings.xml file keeps the UI project configurations.
2. faces-config.xml: The faces-config.xml file contains the configurations for a web application built using JSF. This file allows to configure managed beans, data convertors, and validators used in the UI, navigation cases, global resource bundles, view handlers, page lifecycle phase listeners, and custom lifecycle factory implementation for the application.
3. adfc-config.xml: ADF Faces is built on the top of the JSF with a lot of extra features, which are not covered by the core JSF. ADF Faces uses adfc-config.xml to keep its configurations. We use adfc-config.xml to keep the navigation cases and managed bean definitions. To run a fusion web application we need both faces-config.xml and adfc-config.xml files- which is true even if we dont have any custom congif entries in faces-config.xml.
4. trinidad-config.xml: The generated trinidad-config.xml files contain only the skin family name. trinidad-config.xml can be used to override the default configurations for accessibility settings, locale settings, state management and so on.
5. web.xml: The web.xml file acts as a deployment descriptor for a java-based web application. A default web.xml file will be created with default settings. The default entries include context parameters for configuring the runtime state of the system, security files, data binding filters for web pages, and resource look up filters. It also includes servlet context listeners for initializing the management and monitoring services for view and model layers.
6. adf-config.xml: The adf-config.xml file contains application-level settings, which manage the run time infrastructure-such as failover behavior for the application modules, global fetch limit for all the view objects, caching of resource bundles, automated refresh of page page bindings and so on.
7. weblogic-application.xml: This file is the Weblogic server-specific deployment descriptor.

Data Base related XML files:
1. Connections.xml : This file contains the database connection detail that we create for development. If the application consumes web services, the corresponding connection uniform resource locator (URL) will also be present in this file.
2. jps-config.xml: The jps-config.xml file is used to store the Oracle platform security configurations. The location of this file is configured in the adf-config.xml. 

Monday, December 30, 2013

PL/SQL Queries:

Query to get the body of a package:

select text

from   dba_source

where    NAME = 'GME_RESCHEDULE_BATCH_PVT'
;

Query to alter a session/ change the time and date format:

alter session set nls_date_format='mm/dd/yy hh24:mi:ss';

Query to insert multiple records:

INSERT ALL
  INTO LINE_DETAILS (Line_Number, Line_Name, Work_Start_time , Work_End_time, Working_Days) VALUES (1, 'Green', null,null,null)
  INTO LINE_DETAILS (Line_Number, Line_Name, Work_Start_time , Work_End_time, Working_Days) VALUES (2, 'Red', null,null,null)
  INTO LINE_DETAILS (Line_Number, Line_Name, Work_Start_time , Work_End_time, Working_Days) VALUES (3, 'Yellow', null,null,null)
  INTO LINE_DETAILS (Line_Number, Line_Name, Work_Start_time , Work_End_time, Working_Days) VALUES (4, 'Blue', null,null,null)
  INTO LINE_DETAILS (Line_Number, Line_Name, Work_Start_time , Work_End_time, Working_Days) VALUES (5, 'Voilet', null,null,null)
  --INTO LINE_DETAILS (column1, column2, column3) VALUES ('val2.1', 'val2.2', 'val2.3')
  --INTO LINE_DETAILS (column1, column2, column3) VALUES ('val3.1', 'val3.2', 'val3.3')
SELECT * FROM dual;

Query to delete the table records/ delete the table(Drop):

truncate table LINE_DETAILS;

Query to change the column name in table:

UPDATE LINE_DETAILS

   SET column = REPLACE(hr.Line_Details.Line_Name, 'Line1', 'Green');

Query to add a column in table:

ALTER TABLE LINE_DETAILS
ADD Line_Name Varchar2(100);

Query to change a value in table:

UPDATE LINE_DETAILS
SET Line_Name='Voilet'
WHERE Line_Number=5;




Thursday, December 26, 2013

Oracle ADF Task Flow concepts: Bounded and Unbounded Task Flows

ADF controller is an extension of java surfaces.
Bounded Task Flows:
-> They are reusable "whiteboxes" which provide navigation and processing.
-> Well defined boundary
-> Single point of entry
-> Can invoke code at the beginning of the task flow or at the end of the task flow allowing roll back or committing the changes accordingly.
-> Declarative transaction management.
-> Declarative back button support.
-> Bounded task flows communicate with the input/output parameters.

Unbounded Task Flows:
-> There are no well defined bounderies. There is no entry point or an exit point from an unbounded task     flow.
-> Usually used as a top level entry point.
-> They are used to declaratively use menu models.
-> Declarative bookmarking of the view activities. 

Programmatic Partial Page Refresh in ADF for a gantt component

My requirement:
Give the user the ease to schedule the products on a production line.
Use of PPR:
In the production scheduling gantt chart component i am unable to select the task bar component to set the PPR on it. Thats why i have gone for Programmatic PPR.

In the pseudo code:
       -> Get the ADF Faces context
       -> Get access to the UI component instance
       -> Make that component target for PPR.


-> First step bind the gantt component so that the UI component is accessible in the bean.
-> Using the ADFFacesContext get the current instance.
-> Add the component to the current instance partial target.

                    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
                    adfFacesContext.addPartialTarget(getGetGantt());
         NOTE: here its a gantt component and i get getGetGantt() after i set the binding to the gantt       component. Like wise we can have what ever component we want to have.

add this code to the data change listener after you change the start date, resource_Id and other details in the back end. So that you are refreshing the gantt component after the changes are made.

Tuesday, November 19, 2013

ADF Naming Standards

Naming Standards are very important to organize the code, especially when you are working with large scale applications. Below are the naming conventions based on JUST my past experience


Business Components

  Entity                                  - Suffix with 'EO' - example : EmployeeEO
  Updateable View Object      - Suffix with 'VO' - example : EmployeeVO
  Programmatic View Object  - Suffix with 'TRVO' example : EmployeeTRVO
  ReadOnly View Object        -  Suffix with 'ROVO' example : EmployeeROVO
  List of Values View Object  -  Suffix with 'LOV' example : GenderLOV
  View Link                            - Suffix with 'VL' example : EmployeeDepartmentVL
   Association                         - Suffix with 'Assoc' Example : EmployeeDepartmentAssoc
  View Accessor                    - Suffix with 'VA' Example :  EmployeeNameVA
  Application Module               - Suffix with 'Service' example : EmployeeService

Packaging

Entities                            :     com.<application>.<project>.model.entities
Updateable View Object :     com.<application>.<project>.model.queries    
Application Module         :      com.<application>.<project>.model.services           
Programmatic View Object :     com.<application>.<project>.model.trvo
View Link                          :    com.<application>.<project>.model.vl
Association                        :    com.<application>.<project>.model.assoc
Read only View Object      :    com.<application>.<project>.model.readonly

Application Naming 
- Giver proper name to application , For eg : EmployeeMgmt, CustomerMgmt, VendorMgmt, etc.. The name of the application should be meaningful with respect to the functionality

Project Naming
 - Give meaningful name to each project you create in any application
 - Model Project :
   Example : EmployeeModel, CustomerModel,VendorModel - All the model projects suffix with 'Model'
- View Controller Project : 
 Example : EmployeeUI, CustomerUI, VendorUI - This project holds all the User Interface related components such as .jsff, jspx, xml, etc..

- Web Service Projects
 Example : EmployeeWSService, CustomerWSService, VendorWSService - All these projects contains the web services related.

- Web Service Proxies
Example : EmployeeWSProxies, VendorWSProxies, CustomerWSProxies - All these projects contains the web service proxy related files.