ADF for beginners

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

Oracle ADF Mobile - SMS


Today I got a chance to blog it.,

Sending, Short Message Service on 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 sms functionality.
By using Andriod device we can test the same.

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

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



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


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


After giving the mobile number and body of your sms in figure3.


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


Default message will appear on that box. as you entered earlier. By pressing send option you can send sms. it is shown in figure5.


After pressing send option it make it as 'Sending' you can see in figure6.


Finally,
SMS is delivered resultant number shown in figure7.

                                                 

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

Saturday, 12 January 2013

JDeveloper - Integerated Developer free application tool

Monday, 19 December 2011

Simple Detail Stamp in af:Table

In this Post i am going to do a Simple DetailStamp in af:Table
I had created a EmployeeVO and DepartmentVO I had also created a ViewLink between these two VO's Such as

Employee.deptid = Department.deptid

Drag and drop departmentVO in jspx page as a af:table. In the Structure if you expand af:table there would be a table facet Now drag and drop DepartmentVO as af::form in Detailstamp So that for particular department if we expand the node we would get the employees list of that department





Thus the simple detail stamp had been emerged




Thursday, 15 December 2011

Navigating from af:Quick Query To af:query

This was my first post regarding the navigation of af:quickQuery panel to af:query panel
Initially i had created my ViewCriteria in my VO namely GlJrnlHdVOCriteriaQuery.I had dragged and dropped my ViewCriteria as my af:query in my jspx page and add a command button in that tool bar such that if user press the command button it can be navigates to af:quick query.

 <af:query id="qryId1" headerText="Search" disclosed="true"
                  value="#{bindings.GlJrnlHdVOCriteriaQuery.queryDescriptor}"
                  model="#{bindings.GlJrnlHdVOCriteriaQuery.queryModel}"
                  queryListener="#{bindings.GlJrnlHdVOCriteriaQuery.processQuery}"
                  queryOperationListener="#{bindings.GlJrnlHdVOCriteriaQuery.processQueryOperation}"
                  binding="#{backingBeanScope.GeneralJournal.qryId1}"
                      rendered="#{backingBeanScope.GeneralJournal.queryVisible}"
                      modeChangeVisible="false" rows="1" maxColumns="5">
                      <f:facet name="toolbar">
        <af:commandButton text="Basic"
                          binding="#{backingBeanScope.GeneralJournal.cb2}"
                          id="cb2"
                          actionListener="#{backingBeanScope.GeneralJournal.advanced2Quick}"/>
                          </f:facet>

Now Drag and drop an adf:quickQuery to your jspx page and provide value,model,querylistner and query operation listner ., In this i simply copied and pasted all this from af:query.Initially the command link advance property will be false make it as true so it will be visible in the UI.

<af:quickQuery label="Search"
      value="#{bindings.GlJrnlHdVOCriteriaQuery.queryDescriptor}"
                    model="#{bindings.GlJrnlHdVOCriteriaQuery.queryModel}"
                    queryListener="#{bindings.GlJrnlHdVOCriteriaQuery.processQuery}"
                    queryOperationListener="#{bindings.GlJrnlHdVOCriteriaQuery.processQueryOperation}"
                     binding="#{backingBeanScope.GeneralJournal.qq1}" id="qq1"
                     rendered="#{backingBeanScope.GeneralJournal.quickQueryVisible}">
        <f:facet name="end">
          <af:group binding="#{backingBeanScope.GeneralJournal.g1}" id="g1">
            <af:commandLink text="Advanced" visible="true"
                            binding="#{backingBeanScope.GeneralJournal.cl1}"
                            actionListener="#{backingBeanScope.GeneralJournal.quick2Advanced}"
                            id="cl1"/>
</af:group>
      </f:facet>

Here i had two methods quick2advanced and advance2quick which provides the render property in the UI
Here is the following methods that had been used in the Managed Bean

public boolean isQuickQueryVisible()
                {
                  return _quickQueryVisible;
                }
             
                public boolean isQueryVisible()
                {
                  return !_quickQueryVisible;
                }
                 
                public String getVisibleComponent()
                {
                  if(_quickQueryVisible)
                    return "quick";
                  else
                    return "advanced";
                }
             
        private boolean _quickQueryVisible = true;
            public void quick2Advanced(ActionEvent actionEvent) {
            // Add event code here...
            _quickQueryVisible = !_quickQueryVisible;
    }
        public void advanced2Quick(ActionEvent actionEvent) {
            // Add event code here...
            _quickQueryVisible = !_quickQueryVisible;
    }

Initially the rendering property of af:quickQuery  quickQueryVisible is true such that it would be visible in the UI Now when the user clicks the advance button the rendering property of af:quickquery will get false such that it enables the af:query to be visible in UI. Now we are using Switcher Component to switch from af:quickquery to af:query

<af:switcher facetName="#{demoQueryToggle.visibleComponent}" defaultFacet="quick"
                         id="s4">
              <f:facet name="advanced">
                <af:outputText id="resultTextId"
                               value="Query statement is as folows: #{demoQuery.sqlString}"/>
              </f:facet>
              <f:facet name="quick">
                <af:outputText value="#{demoQuickQuery.sqlString}" partialTriggers="search"
                               id="ot5"/>
              </f:facet>
            </af:switcher>

Thus the following result is obtained

Now if the user clicks the Advance button it navigates from af:quickquery to af:query Then if the user clicks Basic button it navigates from af:query to af:quickQuery