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.