How can you combine data defintions from two schemas into a single Rich Data Definition file?
If you want to add data definitions for multiple schemas to a Rich Data Defintion file, this sample will provide some insight.
Install the WebSphere Portlet Factory Archive that is attached to this article.
This will add 5 files to your project.
There will be two models added under WebContent/WEB-INF/models/RDD.
There will be three RDD files added under WebContent/RDD.
If you run the model "RichDataDefinitionConsumer.model" you will see an employee table and a catalog table displayed.
The model is currently configured to use the CommonRDD.xml RDD file.
This is specified in the ServiceConsumer builder.
Notice that in the employee table, the id column and the type column are both hidden.
Notice that in the catalog table, the quantity table is hidden.
If you substitute the CommonRDD.xml file for the Employee.xml file in the Service Consumer builder and then run the model again, you will see that the catalog table now displays all columns including the quantity column. This is beacuse it is no longer applying data definitions for the catalog table.
If you substitute the CommonRDD.xml file for the Catalog.xml file in the Service Consumer builder and then run the model again, you will see that the employee table now displays all columns including the id and type columns. This is because it is no longer applying data definitions for the employee table.
The Employee.xml and the Catalog.xml files were created using two separate RDD builders. You can see these two RDD builder in the RichDataDefinitionConsumer.model. After creating the files with the RDD builders, the RDD builders were disabled, so that the model would use the RDD file specified in the Service Consumer builder.
The two separate XML files were then combined into a single XML file by copying the data definitions from the two separate files into a common file.