ADF for beginners

Monday, 1 September 2014

Parent action activity in a task flow - Oracle ADF

The parent action activity allows an ADF bounded task flow to generate outcomes that are passed to its parent. The outcomes are used to navigate the ADF task flow containing the enclosing view'rather than navigating the ADF task flow of the ADF region.
  • Parent outcome: Specifies a value passed to the parent viewport to navigate t he enclosing view's task flow rather than navigating the region's task flow where the parent action activity is defined.

    In this post am going to show how the parent activity used to navigate from the enclosed parent view to different regions.

    STEP 1:
    I have created a task-flow-defintion-parent.xml a bounded task flow. I have dragged and dropped a view activity as parent.jsff, From parent.jsff it navigates to the taskFlowCallLocations.xml a bounded task flow and locaReadOnly.jsff. 








    STEP 2:
    Now am creating task-flow-defintion-child.xml a bounded task flow which has countries.jsff with 2 parent action activity as parentaction and parentaction1. Countries has the outcome callParent and callp

     
    STEP 3:
    Now drag and drop countries table to the countries.jsff with 2 command buttons Location ReadOnly and Location.

     
    In the parent action property set the outcome as child

     

    In the parent action1 propert set the parent outcome as child1.








     

    STEP 4:

    Now drag and drop the task-flow-defintion-child.xml to parent.jsff.

    <af:panelBox text="ParentJSFF" id="pb1">
        <f:facet name="toolbar"/>
        <af:region value="#{bindings.taskflowdefinitionchild1.regionModel}"
                   id="r1"/>
      </af:panelBox>

    STEP 5:

    Create a taskFlowCalllocations.xml with Locations.jsff and taskFlowReturn.

     
    In the locations.jsff drag and drop as locations vo as af:table with countrie as af:button so that it navigates to parent.jsff 

     
     STEP 6:

    In the LocaReadOnly.jsff which is in task-flow-definition-parent.xml bounded taskflow drag and drop Locations VO from data control as af:readonly table.

    Back af:button will be  back to parent.jsff view activity.

    STEP 7:
    Now drag and drop the task-flow-defintion-parent.jsff to the Main.jspx and run the jspx page

    Initial Page View

    Now click the location ReadOnly it will navigates to LocaReadOnly.jsff

    Click the back button to navigate the mail page now press location button it navigates to the Location.jsff page.

    Hope this post might be usefull
    Kindly revert me back if have any questions.

Monday, 25 August 2014

Change the graph type dynamically at Run Time

This post is means to change the graph type dynamically during run time.

In this tutorial i have used the below read only VO query using below sql statement.

select count(department_id),department_id from employees group by department_id order by department_id desc;

Step 1 :

Drag and drop the dvt:graph from component palette and provide the following values so finally it should be look like.

<dvt:graph id="graph1" value="#{bindings.GrpahRunTime1.graphModel}"
                     graphType="#{pageFlowScope.sampleGraph.grpahType}"
                     partialTriggers="::graphTypeChoice" shortDesc="Test"/>

sampleGraph is a bean which has pasgeflow scope.

Step 2:

Drag and drop af:selectone choice component so that the user can choose the graph he needs to display. Provide the values listed below in the item list.

 <af:selectOneChoice label="Graph Type" id="graphTypeChoice"
                            autoSubmit="true" value="#{pageFlowScope.sampleGraph.grpahType}">
          <af:selectItem label="Vertical Bar" value="BAR_VERT_CLUST"/>
          <af:selectItem label="Line" value="LINE_VERT_ABS"/>
          <af:selectItem label="Area" value="AREA_VERT_ABS"/>
          <af:selectItem label="Horizontal Bar" value="BAR_HORIZ_CLUST"
                         />
        </af:selectOneChoice>

Step 3 :

sampleGrpah bean should be like

public class sampleGraph {
    String grpahType = null;

    public void setGrpahType(String grpahType) {
        this.grpahType = grpahType;
    }

    public String getGrpahType() {
        return grpahType;
    }
}

Step 4:

Now run the jspx page.
We can see the initial page after running the jspx

Now the user selects line from select one choice now the graph turns back into the line graph dynamically.

 While the user selects Area graph the graph turns into Area graph.


Sunday, 10 November 2013

Adding Execute,Upload,Delete action to my Excel using ADF Desktop integeration

Most of our clients are familiar with Excel. So what happens when our ADF communicates with Excel. Yes our ADF can also be used with Excel using ADF Desktop Integration.
This link helped me to have a basic understanding of our interactivity with Excel.

http://docs.oracle.com/cd/E37975_01/web.111240/e16180/interactiv_app.htm#sthref87

In this blog i will be adding upload,execute and Delete as a button which helps my users to upload their data to database,Delete the data,Execute and see the result.

First we will be creating a Fusion web app having Model and View Controller. Right click the view Controller in All Features Tab ----> Client tier -----> ADF Desktop Integration. Click the Excel workbook which creates a workbook.









This workbook will be added in the View Controller and Excel folder.
Before that create a page definition file as shown below.




I have used the employee table to be shown in my Excel. If you double click the Excel which we have created it will ask for the page definition to be added.




Choose the page Definition file it will be appeared on the left side of work book in Bindings tab.
Click the EmployyesView1(tree) and press Insert Binding a table format will be formed in the Excel workbook. In select component click an ADF Table and press ok.

As soon as Insert component dialog appears go to Batch options CommitBatchActionID should be commit.


Similarly we need to change the following properties as shown  below.

Now our table should like as below.

Click the execute action in the Binding and after pressing Insert Binding a popup will be appearing asking for ADF Button and ADF Ribbon Command.

After pressing ADF Button another insert component dialog will appear in that expand Click Action set within that expand Actions if we click the Actions(3) an button will be appearing when we click that Edit Actions dialog is opened. In the Add click the down arrow select component action an extra member is added. From the action of newly added member select download and annotation will be query.

Click ok to close all the dialog. Now the Execute button has been created in my Excel.
Insert a ADF Button from the component Dialog,insert component expand Click Action Set --> Actions--> Edit Action dialog will be open. From Add choose component action in the action field select upload.



Click ok to close the window and upload button has been created.

Select the delete action from binding click insert binding. As we did for Execute action we will providing action set for Delete. In the command action form action we will be selecting DeletFlaggedRows.

Click ok to close the window.
Now Run the Excel sheet. First click the Execute button it will populate the data's in your excel columns.

Right click and insert a new row a changed column will be populated with upper arrow symbol which defines the new row is ready as shown below.

Now insert the date and press upload button the data will be uploaded. Double click the flagged column a dot symbol will be appeared if we click the Delete button the row will get delete from the database.


This can also be achieved via ADF Ribbon command Button.

Saturday, 2 November 2013

Simple adf authorization by passing the parameter in task flows

This is the simple authorization for my jspx pages by passing the parameter to my task flows using adf security.

This demo have been developed using jdeveloper 11.1.1.6.0.

In this demo i will show how to provide adf authentication by using paramter in Task flow.

Create a simple login page and validate the credentials using adf security.
Refer the link for adf security enabled login page

http://docs.oracle.com/cd/E14571_01/web.1111/b31974/adding_security.htm#BABDEICH

I have created 2 users.

=> testuser1 ---> Manager Role
=> testuser2 ---> user Role.

In my adfc-config.xml has welcome.jspx which calls a bounded task flow.

The task flow definition contains EmpDept.jspx in which i have dragged and dropped EmployeeVO as af:form.






In which the salary attribute should be shown for Manager Role users (testuser1 in our case).



i have created a bounded task flow in which i will be residing employees.jspx page. I have passed a parameter for this task flow.

Here am having the variable mode in which i will get the role of my user.

<af:commandButton text="Validate" id="cb2" action="go">
        <af:setPropertyListener from="#{securityContext.userInRole['ManagerApplicationRole']==true}" to="#{pageFlowScope.mode}" type="action"/>
        </af:commandButton>

In my command button i have set property listener which store the users tole to the mode variable.

Set the salary field rendered property #{pageFlowScope.mode}.


Now if we run our page

For testuser1

The welcome.jspx page renders after clicking Validate button the EmpDept.jspx page renders in which we can see Salary attribute in af:form






For testuser2




Now the salary attribute is hidden since the testuser2 doesnt contain ManagerRole.

Note:

This scenario can also be done in better way by passing #{securityContext.userInRole['ManagerApplicationRole']==true} directly to the rendered property of the salary attribute in af:form.
I just tried them passing through parameter and thought to share in blog.


Tuesday, 29 October 2013

Oracle ADF Mobile - Emailing


Today I got a chance to blog it.,

Sending, Email through out oracle ADF mobile using Emulator as well Android device.
By using Emulator just we can deploy the application in Emulator. But we can't perform this email functionality.
By using Andriod device we can test the same.

Here following step by step figure illustrate sending email using Andriod device.

After deploying on ADF mobile application on android device.
Initially, it will be like following figure. there you can see the EmailOnADF application.




While hitting the EmailOnADF. you can able to see the following Figure1.



Then after you can able to fill the fields as show in figure2.



After giving the email id,subject and body of your email in figure3.




While pressing sendEmail button it will lead to lauch local app which you have install in the android device for Gmail it is shown in figure4.



Default message will appear on that box. as you entered earlier. it is shown in figure5.




After composing you can see in figure6.


Finally,
Email is delivered resultant mail id shown in figure7.a(check it in laptop)..




Email is delivered resultant mail id shown in figure7.b(check it in mobile).


No. Need to write any code to perform this functionality.Just DnD(Drag and Drop).

I would like to thank Subramanian Meyyappan for guiding me.

Download here