Part 3: Adding Other Complex Graphical Presentations to the Page
In this section you add new tabs to your page and use geographic component to display the stock locations, you also create a Gantt chart and a Pivot table.
show more or lessRead more...

An ADF geographic map is an ADF Data Visualization component that provides the functionality of Oracle Spatial within Oracle ADF. This component allows users to represent business data on a geographic map and to superimpose multiple layers of information (known as themes) on a single map.

Step 1: Create a Geographic Map
In this section you work on the same view previously used for warehouses located in the US. Using the spatial functionality of Oracle, you add a map to a new tab in the existing page, indicating the geographical location of the related warehouses.
  1. Back to JDeveloper, in the OrdersAndStocks page, right click within the StockLevels tab and select Insert after Show Detail Item --> Show Detail Item.

    Context menu
  2. In the Property Inspector using the Common group, change the Text to Location.

    The Property Inspector
  3. In the Style group click the Layout tab Layout iconand set the Height to 600 Pixels.

    The Property Inspector
  4. Click the Location tab, then in the Data Controls panel, expand the OrdersView1 | OrderItemsView2 nodes. Select the WarehouseStockLevelsView1 node and drop it on the page in the Location tab. From the Create context menu, select Geographic Map -> ADF Map and Point Theme.

    Dropping a Data Control onto the page
  5. In the Create Geographic Map dialog, click New New icon to create a new Map configuration..

    The Create Geographic Map dialog
  6. If needed type mapConfig1 as the Id, then for the MapViewer URL field select tapViewer from the list and click the Edit button Edit icon.

    The Create Geographic Map Configuration dialog
  7. In the Create URL Connection dialog, enter the following URL information: http://elocation.oracle.com/mapviewer, then click the Test Connection button. The connection should be successful.

    The Edit URL Connection dialog

    Click OK.

    The MapViewer URL points to the URL for the Oracle Application Server MapViewer Service.
  8. Repeat the previous step for the Geocoder URL field using the geo value and click Edit Edit icon.

    The Create Geographic Map Configuration dialog
  9. Provide the following URL information: http://elocation.oracle.com/geocoder/gcserver, then click the Test Connection button. The connection should be successful.

    The Edit URL Connection dialog
    The Geocoder Web service converts street addresses into latitude and longitude coordinates for mapping.
  10. Click OK. Then, back on the Edit Geographic Map Configuration dialog, click OK.

    The Create Geographic Map dialog
  11. The world map displays.

    World Map
  12. Enter '-100' as Starting X and '40' as Starting Y to focus on north America. Click Refresh.

    World Map

    Click OK.

  13. The Create Map Point Theme Binding dialog comes up. For Address, pick US (street, city, state, zip) and choose the following fields:

    Property Value
    Street Address1
    City City
    State StateProvince
    Zip Code PostalCode
    Label WarehouseName

    Under Point Data specify:·

    Property Value
    Data Quantity on Hand
    Label Quantity
    The Create Map Point Theme Binding dialog

    Click OK to insert the map.

    Geographical mapping conversion is made based on the address fields. Show more or less Read more...

    However, using x and y coordinates is a more efficient way to present data on the map rather than using the Address controls, which must be converted by a Geocoder to x and y coordinates. If the data collection has more than 100 rows, then to ensure adequate performance, use x and y coordinates.
  14. In the Structure window, select the dvt:map component. In the Property Inspector, on the Behavior group, set the PartialTriggers property to ::OrdItem (the id of the table).

    The Property Inspector

    Note: you could use the Edit option from the dropdown arrow and select the OrderItem in the .

  15. Within the Appearance group, set the MapZoom to 3 to focus on North America.

    The Property Inspector
  16. To add a toolbar to the map, allowing zooming, area selection, and other functionalities, from the Component Palette, from the ADF Data Visualizations | Map library, select the Toolbar component then drag and drop it within the dvt:map component.

    The Structure pane and Property Inspector
  17. In the Create Map Toolbar dialog, select map as the map id (the name of the map component).

    The Create Map Toolbar dialog

    Click OK.

  18. The page should look like the following:

    The page rendering in the design editor
  19. Click Save All Save All icon icon on the JDeveloper menu bar, or select File | Save All.

  20. Click the Run button Run icon to run the OrdersAndStocks.jspx page. Select an Order with an Order Item for which the product is stored in several locations. Click the Location tab.

    The page in the browser
  21. The red dots on the map indicate the warehouses location for this product. Notice the Incrustation window at the bottom right.

    The page in the browser
    By default, mapPointThemes are displayed as 'Orange balls'. Show more or lessRead more...

    You can change the display to other predefined values, using the BuiltInImage property of the Point Theme component.

  22. Move the window in the incrustation to select another area on the map.

    The page in the browser
  23. Click the upper left corner of the incrustation window to hide it.

    The page in the browser
  24. Try the toolbar buttons for example click the Zoom in Zoom in button and click within the map to zoom in.

    The page in the browser
  25. Click the Hand icon Hand icon in the toolbar and then click on any red spot to pop up a window showing the location name and the quantity in stock.

    The page in the browser

    Close the popup window.

  26. Experiment other functions like selecting the Area Area icon button and click the Rectangular Rectangular icon selection button, then click within the map to select a rectangular area on the map. The surface of the selected area is calculated and displayed.

    The page in the browser
  27. In the toolbar, click View and select Information Panel.

    The Menu option in the browser
  28. Position your mouse over any location on the map to get the geographical coordinates, in terms of longitude/latitude.

    The page in the browser
  29. In the toolbar, click the distance icon Distance icon.

    Selecting the distance icon
  30. Double click on a first spot on the map, then double click on another spot of the map to get the distance between both locations.

    The page in the browser measuring distance
  31. Close the Browser window.

Step 2: Create a Pivot Table

Based on a new View in the Model project, you create a Pivot Table within a new tab of the existing page.

  1. Back to JDeveloper, expand the Model | Application Sources | oracle.fod.model and double click the SalesPivotTable view to open it in the editor.

    The Model project in the Application Navigator
  2. In the editor click the Query tab, to display the SQL statement. Notice that the view summarizes the Sales done by product category, product name and States within the US.


    The View object query details
  3. Click the OrdersAndStocks tab to open the page, right-click within the Location tab and select Insert after Show Detail Item --> Show Detail Item.

    Context menu from tab selection
  4. In the Property Inspector within the Common group, change the Text to PivotTable.

    The Property Inspector
  5. Click the Pivot Table tab, then In the Data Controls panel drag the SalesPivotTable1 data control onto the page. From the Create context menu, choose Tables -> ADF Pivot Table.

    Dropping a Data Control onto the page
    An ADF pivot table displays a grid of data with rows and columns and optionally, a pivot filter bar to filter data not displayed in the rows or columns.Show more or lessRead more...

    The pivot table has the following structure:
    Column edge: The horizontal axis above the pivot table containing one or more layers of information in the pivot table.
    Row edge: The vertical axis to the left of the pivot table containing one or more layers of information in the pivot table.
    Page edge: The optional pivot filter bar containing zero or more layers of information for filtering the display of data in the pivot table.
    Data body: One or more measures, or data values, displayed in the cells of the pivot table.
  6. The Create Pivot Table Binding dialog comes up. Drag Category and Product to the row edge.

    The Create Pivot Table Binding dialog
  7. Drag State to the column edge.

    The Create Pivot Table Binding dialog
  8. Finally, drag Sales to the data area at the intersection row/column.

    The Create Pivot Table Binding dialog

    Click Next.

  9. in the Data Values section, for the Sales attribute, enter the label Sales, In the Categories section, select the following Attribute Display Values from the drop down lists:

    Attribute Attribute Display Value
    State State
    Category Category
    Product Product
    Step 2 of the Create Pivot Table Binding dialog

    Click Next.

  10. In the Configure Drilling pane, select the Insert Drilling option, the Before Children choice and Enable the drill path Category to Product.

    Step 2 of the Create Pivot Table Binding dialog

    Click Next.

  11. In the Configure Aggregation pane, click the New button Add icon. The Sales Attribute is added to the Attribute-level Overrides with the Sum function.:

    the Configure Aggregation pane
  12. Select the Category Totals tab. Select the Add button Add icon then select the attribute Category and enter the Total Label – Total Category.

    the Configure Aggregation pane

    Click Next.

  13. In the Configure Sorting pane, select the Add button Add icon, then select the Attribute: Category and Sort Attribute: Product.

    the Configure Sorting pane

    Click Next.

  14. The Preview pane displays the sample design.

    The Preview for the Pivot Table
  15. Click Finish to insert the PivotTable into the page.

    The page rendering in the design editor
  16. In the Structure window, select the dvt:pivotTable component. In the Property Inspector, within the Style group, click the Layout iconic tab Layout icon, and set the Width property to 600 Pixels.

    The Property Inspector
  17. Click Save All Save All icon icon on the JDeveloper menu bar, or select File | Save All.

  18. Click the Run button Run icon to run the page.

  19. The OrdersAndStocks page opens up in the browser, click the PivotTable tab.

    The page in the browser
  20. The Pivot Table displays.

    The Pivot Table page in the browser

    Notice the Total Category row.

  21. Expand a Category to view the Product details:

    The Pivot Table page in the browser
  22. Test the Pivot functionality, for example, select the Product column and move it underneath the State row.

    The Pivot Table page in the browser
  23. The new table displays state sales per product. Notice the new recalculated totals.

    The Pivot Table page in the browser
  24. You can experiment other column/row moves. For example pick the State row and move it next to the Product column to display product sales per states.

    The Pivot Table page in the browser

    The Pivot Table page in the browser

    Notice that you can also swap layers - e.g. swap Category with State, by dropping one layer on top of the other.

  25. Close your browser window.

Step 3: Create a Gantt Chart

In this section, you add a new tab to the page, for a Gantt Chart. Based on two existing views, OrderShippingSummary and OrderShippingDetails linked with a master detail relationship, you add a new tab to the page and then create the Gantt diagram within the new page.

A Gantt chart is a type of bar graph (with time on the horizontal axis).Show more or lessRead more...
It is used in planning and tracking projects to show tasks or resources in a time frame with a distinct beginning and end. When you create a Gantt chart, you can choose from the following types:


A 'Project' Gantt chart lists tasks vertically and shows the duration of each task as a bar on a horizontal time line.

A 'Resource Utilization' Gantt chart shows graphically whether resources are over or under allocated. It shows resources vertically while showing their allocation and, optionally, capacity on the horizontal time axis.

A 'Scheduling' Gantt chart is based on manual scheduling boards and shows resources vertically with corresponding activities on the horizontal time axis. Examples of resources include people, machines, or rooms.

  1. Back to JDeveloper, expand the Model | Application Sources | oracle.fod.model node and select the OrderShippingSummary View Object.

    The Model project in the Application Navigator
  2. In the Editor, click the Query tab to see the SQL statement. This query retrieves for each person amongst all orders, the oldest order date and the most recent shipped date. The query looks like the following:


    The View object query details
  3. Expand the Model | Application Sources | oracle.fod.model node and select the OrderShippingDetails View Object.

    
The Model project in the Application Navigator
  4. In the Editor, click the Query tab to see the SQL statement. This query retrieves for each person all of the orders, giving the detail information of the OrderShippingSummary. The query looks like the following:



    The View object query details
  5. In the Application Navigator, double-click the FODModule and using the Data Model tab, visualize the existing relationship between OrderShippingSummary and OrderShippingDetails.

    The Data Model of the Application Module
  6. Back to the OrdersAndStocks page, right click within the PivotTable tab and select Insert after Show Detail Item --> Show Detail Item.

    Context menu from tab selection
  7. In the Property Inspector using the Common group, change the Text to OrdersPlanning.

    The Property Inspector
  8. Click the OrdersPlanning tab, then In the Data Controls panel select OrderShippingSummary2 and drop it onto the page. From the menu select Gantt --> Project.

    Dropping a Data Control onto the page
  9. In the Create Project Gantt dialog, in the Tasks tab select the following values from the drop down lists:

    Property Value
    Task Id PersonId
    Task Type TaskType
    Start Time OrderDate
    End Time ShippedDate
    The Tasks tab of the Create Project Gantt dialog
    The Task tab values. Show more or lessRead more...

    These values specify that a summary task duration is created for each person (customer), going from the earliest ordering date up to the latest shipped date, amongst all individual orders.

  10. Select the PersonId attribute and click the Delete button .

    The Tasks tab of the Create Project Gantt dialog
  11. Click the Subtasks tab in the dialog and select the following values from the drop down lists:

    Property Value
    Subtasks Accessor OrderShippingDetails
    Sub Task Id OrderId
    Sub Task Type TaskType
    Start Time OrderDate
    End Time ShippedDate
    The Subtasks tab of the Create Project Gantt dialog

    The Subtasks values. Show more or lessRead more...

    These subtasks based on the OrderShippingDetails accessor displays the duration of each specific order, between the date of the order and the date of the shipment.

    Click OK.

  12. In the Property Inspector, for the Common group change the Start Time and End Time values to be two months before and one month after the current date (or the date you've installed the FOD schema).
    Notice that the dates indicated in the example won't probably match with the ones stored in your database.

    The Property Inspector
  13. Your page should look like the following:

    The page rendering in the design editor
  14. Click the Run button Run icon to run the page.

  15. The page loads up in the browser. Click the OrdersPlanning tab.

    The page in the browser
  16. The Gantt chart shows for each person/customer the total duration for all their orders.

    The Gantt page in the browser
  17. Click on one person + icon to expand the order details and visualize the state of each individual order.

    The Gantt page in the browser
  18. Enlarge the left pane to view more columns and then discover the ordering and shipping dates for every order. Then Resize it to its initial position.

    The Gantt page in the browser
  19. Notice the toolbar created by default for Gantt charts. Click the Zoom out icon Zoom out icon and notice the change in the legend above the tasks, substituting the column label from days to weeks and months.

    The Gantt page in the browser
    Zoom In and Zoom out. Show more or lessRead more...

    Zooming out one more time will substitute the actual weeks and months display to months and quarters. Users can also zoom in and out on the time scale of a Gantt chart by holding the Ctrl key and using the mouse scroll wheel. A tooltip displays to allow the user to keep track of the current level when zooming through multiple levels at a time. This is especially useful for users with a scrollwheel without a click function.
  20. In the Menu click the View | Time Scale. You can choose the unit for the timing scale.

    Menu options
  21. The new gantt graph is displayed.

    The Gantt page in the browser
  22. Close your browser window.

  23. You've successfully performed this tutorial.

Bookmark Print Expand all | Hide all
Back to top
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.