Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
visionx:data_modeling_and_representation [2020/06/08 12:20]
cduncan [Full text search]
visionx:data_modeling_and_representation [2020/06/12 13:57]
cduncan [Full Text Search]
Line 92: Line 92:
 Just in case you want to know how this works: [[:​jvx:​client:​model:​databook:​autolistboxes|JVX offers a a simple solution for linking tables]] called "​Automatic Link Reference"​. For every database table (or view) you access from within your screen, a so-called "​Storage"​ is created in the screen'​s server-class. Just in case you want to know how this works: [[:​jvx:​client:​model:​databook:​autolistboxes|JVX offers a a simple solution for linking tables]] called "​Automatic Link Reference"​. For every database table (or view) you access from within your screen, a so-called "​Storage"​ is created in the screen'​s server-class.
  
-With our [[:​visionx:​eplug_guide|EPlug Plugin]], you can jump to the storage'​s source code in Eclipse by opening the "Configure ​server-side Data storages"​ wizard ​(1) and pressing "Show Source code" (2).+With our [[:​visionx:​eplug_guide|EPlug Plugin]], you can jump to the storage'​s source code in Eclipse by opening the Configure ​Server-Side Data Storages Wizard ​(1) and pressing "Show Source code" (2).
  
 {{:​visionx:​data_modeling_and_representation:​drop_down_eplug_storage.png?​nolink|Drop-down no foreign-key relation: Eplug jump to storage}} {{:​visionx:​data_modeling_and_representation:​drop_down_eplug_storage.png?​nolink|Drop-down no foreign-key relation: Eplug jump to storage}}
Line 221: Line 221:
         // link databook to the server storage "​assets"​         // link databook to the server storage "​assets"​
         rdbAssets.setName("​assets"​);​         rdbAssets.setName("​assets"​);​
-        // specify the datasource ​to use(default)+        // specify the data source ​to use(default)
         rdbAssets.setDataSource(getDataSource());​         rdbAssets.setDataSource(getDataSource());​
         // ASSETS is a subtable of EMPLOYEES: available ASSETS rows depend on the currently selected EMPLOYEES row         // ASSETS is a subtable of EMPLOYEES: available ASSETS rows depend on the currently selected EMPLOYEES row
Line 295: Line 295:
 ====== Views and Storages ====== ====== Views and Storages ======
  
-Until now, to keep it simple, we have been working with database tables. Of course, we are in no way limited to tables as datasources! We can use database views and queries of any complexity. We will investigate some of that more advanced features with the help of a concrete example:+Until now, to keep it simple, we have been working with database tables. Of course, we are in no way limited to tables as data sources! We can use database views and queries of any complexity. We will investigate some of that more advanced features with the help of a concrete example:
  
-Let's create a screen "​Assets"​ that shows all available assets by their locations. In my mental concept, the location information of my assets is redundant: the asset is assigned to a location (after acquisition) and optionally to an employee (when it becomes issued). But what if the employee changes their department or the employee'​s department changes its location? Let's assume that the employee (and the department) take their stuff along. That means the employee'​s location overrides the asset'​s location. I need a datasource ​that provides me the current location of all assets according to that rule.+Let's create a screen "​Assets"​ that shows all available assets by their locations. In my mental concept, the location information of my assets is redundant: the asset is assigned to a location (after acquisition) and optionally to an employee (when it becomes issued). But what if the employee changes their department or the employee'​s department changes its location? Let's assume that the employee (and the department) take their stuff along. That means the employee'​s location overrides the asset'​s location. I need a data source ​that provides me the current location of all assets according to that rule.
  
-===== Manipulate the Server-Side Storage of Your Datasource ​=====+===== Manipulate the Server-Side Storage of Your Data Source ​=====
  
 Adapting the data provided by a table is straightforward with VisionX. Remember that for every data object, a server-side storage is created. We can manipulate that storage to contain the required information. Adapting the data provided by a table is straightforward with VisionX. Remember that for every data object, a server-side storage is created. We can manipulate that storage to contain the required information.
Line 305: Line 305:
 Open the editor for the server-side storage that VisionX created for the data object by pressing the "Edit storages"​ icon on the right side of the lower pane: Open the editor for the server-side storage that VisionX created for the data object by pressing the "Edit storages"​ icon on the right side of the lower pane:
  
-{{:​visionx:​data_modeling_and_representation:​views_storages_step0.png?​nolink|View as datasource: Edit storage}}+{{:​visionx:​data_modeling_and_representation:​views_storages_step0.png?​nolink|View as data source: Edit storage}}
  
 On the left, we have a list of available storages for the screen. We select the storage "​assets"​ (1) and specify the query that shall be used for the storage: On the left, we have a list of available storages for the screen. We select the storage "​assets"​ (1) and specify the query that shall be used for the storage:
Line 334: Line 334:
 We can verify the generated SQL query by pressing the "Show SQL Query" button (4). We can verify the generated SQL query by pressing the "Show SQL Query" button (4).
  
-{{:​visionx:​data_modeling_and_representation:​views_storages_step4.png?​nolink|Storage as datasource: Create Storage}}+{{:​visionx:​data_modeling_and_representation:​views_storages_step4.png?​nolink|Storage as data source: Create Storage}}
  
 As a foreign-key-relation exists between the table ASSETS and EMPLOYEES, the automatic link reference between the corresponding data objects is created automatically. In the case of ASSETS and LOCATIONS, we have to create the automatic link reference manually (as described in [[#​create_drop-down_without_foreign-key_relation|Create Dropdown Without Foreign-Key Relation]]). The generated code for this server-side looks like this: As a foreign-key-relation exists between the table ASSETS and EMPLOYEES, the automatic link reference between the corresponding data objects is created automatically. In the case of ASSETS and LOCATIONS, we have to create the automatic link reference manually (as described in [[#​create_drop-down_without_foreign-key_relation|Create Dropdown Without Foreign-Key Relation]]). The generated code for this server-side looks like this:
Line 380: Line 380:
 That's it. The data object "​assets"​ will now reference the department'​s location instead of the asset'​s location. That's it. The data object "​assets"​ will now reference the department'​s location instead of the asset'​s location.
  
-===== Use a View as Datasource ​=====+===== Use a View as Data Source ​=====
  
 If necessary, we could have alternatively created a database view like this: If necessary, we could have alternatively created a database view like this:
Line 408: Line 408:
 ; ;
 </​code>​ </​code>​
-We can use a view in the VisionX data object wizard just like any table.+We can use a view in the VisionX data-object wizard just like any table.
  
-In the VisionX lower pane, select the "NEW table" tab and press the (+) button to open the wizard. In the wizard, select "Use existing data from database tables"​ and confirm with "Next >", keep the selection "Use Application Database User" and, again, confirm with "Next >". You can now select the view as datasource. Note that views have a different icon:+In the VisionX lower pane, select the "NEW table" tab and press the (+) button to open the wizard. In the wizard, select "Use existing data from database tables"​ and confirm with "Next >", keep the selection "Use Application Database User" and, again, confirm with "Next >". You can now select the view as data source. Note that views have a different icon:
  
-{{:​visionx:​data_modeling_and_representation:​views_storages_step1.png?​nolink|View as datasource: Select view}}+{{:​visionx:​data_modeling_and_representation:​views_storages_step1.png?​nolink|View as data source: Select view}}
  
 Let's verify the server-side storage that VisionX created for the data object by pressing the "Edit storages"​ icon on the right side of the lower pane: Let's verify the server-side storage that VisionX created for the data object by pressing the "Edit storages"​ icon on the right side of the lower pane:
  
-{{:​visionx:​data_modeling_and_representation:​views_storages_step2.png?​nolink|View as datasource: Edit storage}}+{{:​visionx:​data_modeling_and_representation:​views_storages_step2.png?​nolink|View as data source: Edit storage}}
  
 On the left, we have the list of available storages for the screen. Remember that for every data object, a server-side storage is created. We select the storage "​vAssetsLocalized",​ which is the storage of our currently created view, to review its settings. On the left, we have the list of available storages for the screen. Remember that for every data object, a server-side storage is created. We select the storage "​vAssetsLocalized",​ which is the storage of our currently created view, to review its settings.
Line 426: Line 426:
 Of course, we can name another table or view as the target relation for an INSERT, UPDATE, or DELETE. Let's choose the table "​assets"​. Change the "​Writeback Table" to "​assets"​ (1), the "​from"​ clause to "​v_assets_localized"​ (2), and confirm your changes with "​Finish"​. Of course, we can name another table or view as the target relation for an INSERT, UPDATE, or DELETE. Let's choose the table "​assets"​. Change the "​Writeback Table" to "​assets"​ (1), the "​from"​ clause to "​v_assets_localized"​ (2), and confirm your changes with "​Finish"​.
  
-{{:​visionx:​data_modeling_and_representation:​views_storages_step3.png?​nolink|View as datasource: Edit writeback table}}+{{:​visionx:​data_modeling_and_representation:​views_storages_step3.png?​nolink|View as data source: Edit writeback table}}
  
 Whenever we execute an insert or delete on the data object now, the row will actually be inserted into or deleted from the table ASSETS. Given that the columns of the view and the writeback table are named equally, any UPDATES on that columns will also target the ASSETS table. Whenever we execute an insert or delete on the data object now, the row will actually be inserted into or deleted from the table ASSETS. Given that the columns of the view and the writeback table are named equally, any UPDATES on that columns will also target the ASSETS table.
Line 530: Line 530:
 |**Full text search**|Matches all literals that contain the entered value in any column. <​html><​br></​html>​Supports ?, * and % as wildcards.| |**Full text search**|Matches all literals that contain the entered value in any column. <​html><​br></​html>​Supports ?, * and % as wildcards.|
  
-The "full text search filter"​ operates on all columns of the data object.+The "Full text search filter"​ operates on all columns of the data object.
  
-===== Specify a BETWEEN ​filter ​=====+===== Specify a BETWEEN ​Filter ​=====
  
-Let's implement the possibility to filter for assets issued in a specific ​timespan, in other words, between two dates. Simply drag and drop two Search Editors ​and bind them to "​[Localized Assets.Issue Date]" (1). Use "​Greater equals"​ (2) for the first filter and "Less equals"​ for the second filter.+Let's implement the possibility to filter for assets issued in a specific ​time span, in other words, between two dates. Simply drag and drop two search editors ​and bind them to "​[Localized Assets.Issue Date]" (1). Use "​Greater equals"​ (2) for the first filter and "Less equals"​ for the second filter.
  
 {{:​visionx:​data_modeling_and_representation:​filters_step4.png?​nolink|Filters:​ specify between filters}} {{:​visionx:​data_modeling_and_representation:​filters_step4.png?​nolink|Filters:​ specify between filters}}
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information