Inspired by a question about LOV reusability from one of my readers, I decided to post one more blog in integration series. Today I will refactor application and extract shared entity into common Model project, I will create shared LOV component as well. You can read my previous postings for the same topic from this blog - Building and Integrating Oracle ADF 11g Applications with OjDeploy Utility. I will describe how you can reuse your Model components from shared projects using ADF BC Import functionality (Import Functionality in Oracle ADF BC).
Download updated application - ADFIntegration6.zip. This sample contains one more project - CommonModel. It contains shared EO for Department and one LOV VO.
Originally, I had following Model structure for LocalApp application:
And following Model for RemoteApp application:
Let's say I got a requirement to join Employees VO in RemoteApp with Department table and declare LOV component on DepartmentName attribute. This means I need to have Departments EO available in RemoteApp. However, I already have this EO in another LocalApp application, if I will create again in RemoteApp it will be duplicate. This means I should extract Departments EO from LocalApp into common project and use it through ADF Library JAR import. I have created common Model project and declared Department EO there along with LOV component for Departments:
I deploy CommonModel project into ADF Library JAR as it is described in my post above and import it into LocalApp through Business Components Imports:
Now I can remove Departments EO from LocalApp Model and use it through imported library. You can see that Departments EO is included now from com.redsamurai.model package:
The same for RemoteApp project, I have included there same ADF Library JAR:
And I can use shared Departments EO in Association relationship between Departments and Employees EO's:
Probably you already noticed that LOV component is imported together with EO:
Then I can use it while declaring LOV for DepartmentName attribute:
Finally, before running my application, I will update its skin setting to fusion. My original application was developed with previous JDeveloper release, however I want to use new skin, I can change it trinidad-config.xml file:
On runtime I can see Employees table joined with Departments and DepartmentName LOV column rendered: