Finding Code Artifacts for Customization (Part 2)
By Jani Rautiainen on Apr 29, 2013
This series of blog posts is intended to illustrate the options that we have to map UIs to code artifacts to be used for customization projects. In the previous article we covered the process for finding code artifacts for customizations using the page composer. In this article we will look at finding ADFbc objects related to the page using the JDeveloper.
Using JDeveloper to inspect code artifacts
We can search for the ADFbc code artifacts directly in the EAR archive; however it is easier to use JDeveloper to navigate the code hierarchy. The UI is coupled to the ADFbc objects using ADF Data Bindings. The bindings used by the components on the UI are described in the page definition file. The details of the related data controls are described in the data bindings file. For details on how binding works and how objects are related refer to the ADF Data Binding documentation.
To illustrate the process this document will cover an example case where we want to customize content on a setup page. In previous article we identified the page and region to be customized. In the example case we want to identify the ADFbc objects related to the “Name” column on the “Implementation Projects” UI (Figure 1):
Figure 1 Page to be customizedThe starting point is the region identified in the previous article; “ImplementationProjectOverview.jsff”. First we navigate in the structure window to the node for the “Name” column; this will automatically highlight the code in the source window. On context menu (right click over the code) you have option “Go to Page Definition” (Figure 2):
Figure 2 ”Go to Page Definition” context menu
When “Go to Page Definition” option is selected we are presented with the bindings for the region. On the context menu for the data control we have option “Edit Definition” which will open the related View Object (Figure 3):
Figure 3 Data control binding
On the View Object opened you can find the location of the related file in the title of the JDeveloper window or alternatively by hovering over the View Object tab (Figure 4):
Figure 4 Location of the ADFbc object
From the View Object definition you can find out the details of the query, entities used etc. The View Object is accessed through an Application Module by the UI. In order to find out details of the Application Module used we need to go back to the Page Definition, select iterator and from the context menu (right click) select “Go to Source” (Figure 5):
Figure 5 Context Menu for iterator
Page definition file defines the binding objects that populate the data in UI components at runtime. For more information refer to the Page definition documentation. On the source code we can see the definition for the iterator which includes the reference to the Data Control. On the Data Control definition we can choose “Go to Declaration” from the context menu (right click) (Figure 6):
Figure 6 Iterator definition
The iterator binding manages the data to be displayed in the text field; on the source code we can see the definition for the Data Control which includes the reference to the Application Module. For more information on iterator see Executable Binding Objects documentation. On the Application Module definition we can choose “Go to Declaration” from the context menu (right click) (Figure 7):
Figure 7 Data Control definition
The data controls are used by the binding objects defined in the page definition files. For more information on Data Bindings refer to the Data bindings documentation. The bc4j.xcfg file contains connection and metadata information for the Application Module. For more information refer to the bc4j.xcfg documentation. From the Application Module definition we can find out the full reference to the Application module (Figure 8):
Figure 8 Application Module definition
To view the content of the Application Module we need to find it from the archive. Navigate to the archive definition under the Application Resources and choose Filter from the context menu (right click on the archive). We use the full reference obtained in previous step, replace the periods (“.”) in the reference with forward slashes (“/”) and execute query (Figure 9):
Figure 9 Filter Customizable Archive
The XML file for the Application Module found can be opened and the definitions for it observed. The same method of filtering the customizable archive can be used with any reference for an ADFbc object e.g. if we want to view Entity Object referred in the View Object.
In order for us to create customizations using JDeveloper we will need to be able to identify the code artifacts related to the customizations. For ADFbc objects the easiest method is to use JDeveloper to identify the related code artifacts.
In future articles other methods of finding code artifacts such as finding mapping security permissions to roles and users will be covered.