Scroll

Multiple Data Models

In some cases a user may want the same Data Objects to be joined together differently. To accomplish this, Data Objects and Joins can be placed into Categories to create multiple data models. When an end user selects a Data Object from a Category it indicates which joins to use.

The following steps detail how to create multiple data models.

  1. In the Administration Console open Other Settings and set ‘Limit Report to One Category’ to True.
  2. Open the configuration file (WebReports.xml) in the Config folder.
  3. In the <webreports> section, begin by creating a <category> for each data model.
NOTE. Each xml tag must be closed (ex. <category> must be closed with </category>).
  1. For each data model:
  2. Specify an ID with the <category_id> The ID should be a unique identifier for the data model and will be utilized by the Data Objects and Joins.
  3. Give the model a name that will be displayed to the end user using the <category_name>
NOTE. The <category_name> tag - acts as a ‘folder’ to group Data Objects. Sub-‘folders’ can be created by entering the category name followed by a backslash then the sub-category name. Ex. ‘Sales\Clients’.

E.g.: 

<category>
<category_name>Exago University\Advisors</category_name>
<category_id>advisorModel</category_id>
</category>
  • For each Data Object (<entity> tag ):
    • With the <category> tag, create a comma separated list of IDs for each data model in which you want the Object to be available. In the example below two data models are specified by their IDs (advisorModel & classesModel).

E.g.:

<entity>
   <entity_name>Professors</entity_name>
   <db_name>Professor</db_name>
   <category> advisorModel,classesModel</category>
   <datasource_id>7</datasource_id>
   <object_type>xmltable</object_type>
   <key>
      <col_name>ID</col_name>
   </key>
</entity>
  • For each Join (<join> tag):
    • With the <category> tag, create a comma separated list of IDs for each data model in which you want the Join to be utilized. In the example below a Join between two Data Objects is being set to one data model (advisorModel).

E.g.:

<join>
 <entity_from_name>Professor</entity_from_name>
 <entity_to_name>Student</entity_to_name>
 <join_type>rightouter</join_type>
 <relation_type>1M</relation_type>
 <weight>0</weight>
 <category>advisorModel</category>
 <joincol>
   <col_from_name>ID</col_from_name>
   <col_to_name>Advisor</col_to_name>
 </joincol>
</join>

Example

The following configuration example demonstrates how three Data Objects are made available in two different relational models. In the advisor Model model Students are joined directly to Professors, while in the classes Model model Students are joined to Professors indirectly through Classes.

Models:

<category>
   <category_name>Exago University\Advisors</category_name>
   <category_id>advisorModel</category_id>
</category>
<category>
   <category_name>Exago University\Classes</category_name>
   <category_id>classesModel</category_id>
</category>

Data Objects:

<entity>
   <entity_name>Classes</entity_name>
   <db_name>Class</db_name>
   <category>advisorModel,classesModel</category>
   <datasource_id>7</datasource_id>
   <object_type>xmltable</object_type>
   <key>
      <col_name>ID</col_name>
   </key>
</entity>
<entity>
   <entity_name>Students</entity_name>
   <db_name>Student</db_name>
   <category> advisorModel,classesModel </category>
   <datasource_id>7</datasource_id>
   <object_type>xmltable</object_type>
   <key>
      <col_name>ID</col_name>
   </key>
</entity>

Joins:

NOTE. The Professors => Classes join is utilized by both Data Models because no <category> is set. 
<join>
   <entity_from_name>Professor</entity_from_name>
   <entity_to_name>Student</entity_to_name>
   <join_type>rightouter</join_type>
   <relation_type>1M</relation_type>
   <weight>0</weight>
   <category>advisorModel</category>
   <joincol>
      <col_from_name>ID</col_from_name>
      <col_to_name>Advisor</col_to_name>
   </joincol>
</join>
<join>
   <entity_from_name>Professor</entity_from_name>
   <entity_to_name>Class</entity_to_name>
   <join_type>inner</join_type>
   <relation_type>1M</relation_type>
   <weight>0</weight>
   <joincol>
<col_from_name>ID</col_from_name>
<col_to_name>ID</col_to_name>
</joincol>
</join>

 


Hidden Article Information

Article Author
Alex Agoado
created 2015-12-15 18:20:50 UTC
updated 2017-07-18 19:07:32 UTC

Labels
data joins, custom joins,
Have more questions? Submit a request