Execute a PL/SQL stored procedure when starting an ADF application

How to execute a PL/SQL stored procedure when starting an ADF application?


This topic is discussed already in few other blogs, where they addressed this scenario with phaseListener and  Invoke Method of task flow.

Here I am addressing the same, calling a PLSQL procedure or some relevant methods that needs to called during the ADF application start up using AM method.

Application Module has a  secure method called Create which gets called during the ADF Application start-up, so I overridden the method create in Application module. 

Detail Steps below:

  • Open the AM by double click on its icon in the Application Navigator panel.
  • Open the "Java" tab in the AM.
  • Click the "Edit Java Options" button (pencil icon in the upper-right corner)
  • Check the "Generate Application Module Class:" option and click OK


    • Open the generated java class in the editor, and on the right mouse button popup menu on the source, select "Source" -> "Override Methods" , and select the "create" method.

    • Inside the generated method body and below the super.create(); insert the code to call the stored procedure.

        @Override
        protected void create() {
            System.out.println("Inside Application Module Create");
            super.create();
            
        }


    During the ADF application start up - you can check the log for the message.



    For more information on how exactly to call your stored procedure, please select the appropriate code pattern depending on the in/out parameters, as per ADF documentation: 

    Invoking Stored Procedures and Functions



    ADF - Date picker (Using Jquery)

    DatePicker in ADF


    In recent Java One / Oracle develop conf - One of key note is Jquery is used in 56.87% of Top 10,000 sites.

    Though we have all ease components to leverage our development in ADF equalising Jquery stuff, thought of using some Jquery stuffs with ADF.


     DatePicker - http://jqueryui.com/demos/datepicker/
    Jquery Datepicker - The moment you click on the input, the date gets displayed.


    ADF Input date - User need to click the icon  next to the Date input and then need to select the date.
    ADF Date -
    User need to click the icon to get the Date displayed and then select the date.

    with Jquery ADF Date component looks like normal input box -

    when user click on the input box , the date gets displayed automatically;

    The user will able to select the date immediately, and also since this is achieved through Jquery we can add any animations like slide out ,in etc that Jquery support.







    I also request you to bring some good uses cases, so that we can incorporate more of Jquery to ADF.



    To-do Code - 

    Import all the Jquery lib as javascript resource- 

     <af:resource type="javascript" source="/lib/jquery/jquery-1.3.2.min.js"/>
     <af:resource type="javascript" source="/lib/jquery//jquery-1.7.2.js"/>
     <af:resource type="javascript" source="/lib/jquery/jquery.ui.core.js"/>
     <af:resource type="javascript" source="/lib/jquery/jquery.ui.widget.js"/>
     <af:resource type="javascript" source="/lib/jquery/jquery.ui.datepicker.js"/>

    And then call the JQuery Function similar to calling Javascript

    <af:resource type="javascript">
              function datepick() {
                  $("input[name=datepicker]").datepicker( {
                      beforeShow : function (input, inst) {
                          inst.dpDiv.css( {
                              marginTop :  - input.offsetHeight + 'px', marginLeft : input.offsetWidth + 'px'
                          });
                      }
                  });
                  $("input[name=datepicker]").css("color", "blue");
              }
            </af:resource>


    This function needs to associated to the input text

     <af:inputText label="Jquery Date" id="datepicker">
                      <af:clientListener method="datepick" type="mouseOver"/>
                    </af:inputText>


    You can also add any CSS to have a rich populated datapicker








    Oracle Fusion

    I will take this forum discussing topics on,
    1. Oracle ADF integration
    2. Oracle SOA
    3. Oracle Apps Tech with integration part.