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.

The Excell worksheet

Step 1: Creating the List of Departments Workbook
Based on the DepartmentPage page definition, you create 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, click the All Features tab, 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.

    New Gallery
  2. Name the workbook DepartmentsList_src.xlsx

    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.

    Create Excel integration

    Click OK.

  3. This is the visible part of an expanding note. It should include one or two sentences. Show more or lessRead more...

    This is the second paragraph of a note, which is initially hidden.

    This is the third paragraph of a long note, which is initially hidden.

    This is the fourth paragraph of a long note, which is initially hidden.
  4. The new workbook appears in the Navigator.
    You start adding content to it in the steps that follow.

    Application Navigator
  5. Double-click DepartmentsList_src.xlsx in the Navigator to open it with Microsoft Excel.

    Application Navigator
  6. Excel opens, loading Oracle ADF Desktop Integration. In the Page Definition dialog, select the ADFdi_view_DepartmentPagePageDef page definition.

    Page definition dialog
  7. Page definition files define the bindings that populate the data in the Oracle ADF components at runtime. Page definition files also define the action bindings and method action bindings that can be invoked from the worksheet.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 right-click DepartmentPage.jspx in the Application Navigator and select Go to Page Definition from context.

    The .jspx page definition

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

    Oracle ADF 11g Desktop Integration

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

  9. Select a cell in the worksheet, then in the Bindings tab, select DepartmentsView1 and click Insert Binding. Notice the new Oracle ADF menu option.

    the worksheet
  10. In the Select Component dialog, select ADF Read-only Table and click OK.

    Select Component dialog
  11. In the Insert Component: ADF Read-only Table dialog, click OK to accept default values.

    Insert Component: ADF Read-only Table dialog
  12. The Excel worksheet displays. Your worksheet should look like this:

    Excel worksheet
  13. Click the Save icon Save Icon to save the worksheet.

    Save option
  14. 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.

    Project Properties dialog

    Click OK.

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

    Oracle ADF 11g Desktop Integration
  16. 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.

    Edit Workbook Properties
  17. Click the Oracle ADF tab in the Excel ribbon, and then choose the Worksheet Properties menu item.

    Oracle ADF tab in the Excel ribbon
  18. Click the Events field, and then click the more button More Icon.

    Edit Worksheet Properties

  19. In the Edit Events dialog, click the Add button to add a Startup event.

    Edit Events dialog
  20. Expand the ActionSet node and click the more button More Icon next to the Actions field to open an Edit Actions dialog.

    Edit Events dialog
  21. 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.
  22. In the Edit Action dialog, click the Add button and select ComponentAction from the drop down list.

    Edit Actions dialog
  23. Click the more button More Icon next to the Action field.

    Edit Actions dialog
  24. In the Choose Component Action dialog, select Download. (Notice that the Table ID, ROT1522191937 will be different in your case).
    Click OK.

    Choose Component Action dialog
  25. 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.

  26. In the Edit Actions dialog, in the Design | Annotation field, type Download Data.

    Edit Actions dialog
  27. 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 Events, click OK, and back in the Edit Worksheet Properties dialog, click OK.

  28. You have finished the design of this simple Desktop Integration-enabled worksheet. In the next step you will test it.

Step 2: Testing the DepartmentsList Workbook
To be able to test your workbook, the application needs to run in Wenlogic server.
  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.)

    Application Navigator
    Typing a weblogic password. Show more or lessRead more...

    The first time you run a page after a fresh install of JDeveloper, you will be required to type a Passowrd for Weblogic server. Enter a value of your choice for the password and click OK.

    Create Default Domain dialog

  2. The DepartmentPage loads, displaying department information.

    DepartmentPage in the browser
  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.

    Application Navigator
  4. The workbook loads. Click the Oracle ADF tab in the Excel ribbon.

    Oracle ADF tab in the Excel ribbon
  5. In the Test group, click the Validate button Validate icon for validating the workbook. Click Close on positive validation.

    Validation dialog
  6. Click Run Run Icon to start loading data.

    Run button
  7. The list of departments is returned in the worksheet.

    list of departments in the worksheet
  8. Adjust the columns widths to achieve the desired look.

    list of departments in the worksheet
  9. Click the Stop button in the Test group of the Oracle ADF tab in the Excel ribbon.

    Stop button
  10. 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.