Part 2: Developing a Simple ADF Desktop Integration-enabled Excel Workbook
Having set up the environment for ADF Desktop Integration, you are now ready to start creating workbooks that will integrate with the Fusion Web application that you installed in the previous part of this tutorial.
show more or lessRead more...

In this part of the tutorial you create the List of Departments workbook, a basic workbook that contains a read-only table.

enter alt text here

Step 1: Creating the List of Departments Workbook
  1. Right-click the ViewController project in the Navigator and select New... from the context menu. In the New Gallery expand the Client Tier node if it is not already expanded, and select ADF Desktop Integration. Microsoft Excel Workbook should be automatically highlighted in the Items pane, so click OK to select it.

    alt text
  2. Name the workbook DepartmentsList_src.xlsx and click OK.

    The published version of the workbook must have a different name from that of the source file. It is a good idea to establish a standard naming convention to differentiate between the source and published workbooks. Show more or lessRead more...

    For example you might add the suffix _src to the name of the source file - DepartmentsList_src.xlsx as here, and retain the more meaningful name for the published workbook - DepartmentsList.xlsx.

    alt text
  3. The new workbook appears in the Navigator.
    You start adding content to it in the steps that follow.

    alt text
  4. Double-click DepartmentsList_src.xlsx in the Navigator to open it with Microsoft Excel.

    alt text
  5. Excel opens, loading Oracle ADF Desktop Integration. In the Page Definition dialog, select the ADFdi_view_DepartmentPagePageDef page definition.

    alt text
  6. Page definition files define the bindings that populate the data in the Oracle ADF components at runtime. Page definition files also reference the action bindings and method action bindings that define the operations or actions to use on this data.Show more or lessRead more... You define a separate page definition file for each Excel worksheet that you want to integrate with a Fusion Web application. The Page Definition dialog lists all available page definition files in the application. In this tutorial there are just two page definition files that were already created in the startup application. To view the data bindings in the ADFdi_view_DepartmentPagePageDef page definition click DepartmentPage.jspx in the Application Navigator to open the JSF page. Then click the Bindings tab at the bottom of the page.

    alt text


  7. The Oracle ADF 11g Desktop Integration task pane appears in Excel, presenting the available bindings from the page definition.

    alt text

    You can learn more about the role of bindings in ADF here.

  8. Select a cell in the worksheet, then in the Bindings tab, select DepartmentsView1 and click Insert Binding.

    alt text
  9. In the Select Component dialog, select ADF Read-only Table and click OK.

    alt text
  10. In the Insert Component: ADF Read-only Table dialog, click OK to accept default values.

    alt text
  11. The Excel worksheet displays. Your worksheet should look like this:

    alt text
  12. Click the Save icon to save the worksheet.

    alt text
  13. Back in JDeveloper, double-click the ViewController project and in the Project Properties dialog, select the Java EE Application node and check that the fields, Java EE Web Application Name and Java EE Web Context Root, are both set to ADFdi_BC. These values will be used by the integrated Weblogic server.

    alt text
  14. Return to Excel and click the Workbook Properties link in the Oracle ADF 11g Desktop Integration pane.

    alt text
  15. In the Edit Workbook Properties, next to the WebAppRoot field, enter http://127.0.0.1:7101/ADFdi_BC. This URL represents the URL of the Fusion Web application with which the workbook is integrated. Click OK.

    alt text
  16. Click the Oracle ADF tab in the Excel ribbon, and then choose the Worksheet Properties menu item.

    alt text
  17. Click the Events field, and then click the more button .

    alt text

  18. In the WorksheetEvent Collection Editor dialog, click the Add button to add a Startup event. Expand the ActionSet node and click the more button next to the Actions field.

    alt text
  19. The Oracle ADF Desktop Integration add-in provides a number of worksheet events that, when triggered, can invoke an action set. Startup is one such event. Show more or lessRead more...

    In this step you have added a Startup event, and in the steps that follow you go on to define the action set that the event should invoke i.e what the worksheet should do when the Startup event occurs.

  20. In the Action Collection Editor dialog, click the Add button and select ComponentAction from the drop down list.

    alt text
  21. Click the more button next to the Action field.

    alt text
  22. In the Choose Component Action dialog, select Download. (Notice that the Table ID, ROT1702018601 will be different in your case).
    Click OK.

    alt text
  23. The ADF Read-only Table component and the ADF Table component in the Oracle ADF Desktop Integration add-in expose actions that are used to manage the transfer of data between Excel worksheets and an integrated Fusion web application.Show more or lessRead more...
    The ADF Read-only Table component exposes only one component action, Download, while the ADF Table component exposes a number of other actions. In this part of the tutorial you added a read-only table to the worksheet, and so this is why Download is the only component action offered as available by the Choose Component Action dialog.

    The Download component action causes the table to be automatically downloaded to the worksheet when the Startup event is triggered.

  24. In the WorksheetEvent Collection Editor dialog, in the Actions | Annotation field, type Download_Data.

    alt text
  25. You can use the Annotation field to enter a comment about the component's use in the worksheet.Show more or lessRead more...

    Comments you enter in the field have no effect on the behavior of the worksheet. They are the equivalent of code comments.

    Click OK. Back in the Edit Worksheet Properties dialog, click OK.

  26. You have finished the design of this simple Desktop Integration-enabled worksheet. In the next step you will test it.
    Save
    the worksheet and then close Excel.

Step 2: Testing the DepartmentsList Workbook
  1. In JDeveloper right-click the DepartmentPage.jspx node and select Run from the context menu. (This step may take a while if WLS has not yet been set up on this computer.)

    alt text
  2. The DepartmentPage loads, displaying department information.

    alt text
  3. Now that the page has been deployed in the Weblogic server, you can run the Excel workbook. In the Application Navigator double-click DepartmentsList_src.xlsx to open Microsoft Excel.

    alt text
  4. The workbook loads. Click the Oracle ADF tab in the Excel ribbon.

    alt text
  5. Click the Run button in the Test group.

    alt text
  6. The list of departments is returned in the worksheet.

    alt text
  7. You may need to rearrange the worksheet cells for a better layout.

    alt text
  8. Click the Stop button in the Test group of the Oracle ADF tab in the Excel ribbon.

    alt text
  9. Close the Excel application without saving. You've successfully created a basic Excel workbook that is integrated with a Fusion Web application, and that automatically downloads data from a database table.

Bookmark Print Expand all | Hide all
Back to top
Copyright © 2011, Oracle. All rights reserved.