Bug 533952 - Presentation of all diagnostics of an object in a table
Summary: Presentation of all diagnostics of an object in a table
Status: CLOSED FIXED
Alias: None
Product: ECP
Classification: Modeling
Component: EMF Forms (show other bugs)
Version: 1.16.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.18.0   Edit
Assignee: Eugen Neufeld CLA
QA Contact: Eugen Neufeld CLA
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2018-04-23 13:54 EDT by Christian Damus CLA
Modified: 2018-08-22 09:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2018-04-23 13:54:41 EDT
EMF Forms 1.16 release

The TableValidationInitiator presents Diagnostics (validation problems) for the objects in the rows of a table view by proactively creating a child view-model context for every object in the table and letting the problems that each child context would present be aggregated in the corresponding object's row, in the 'validation status' column.

This works for applications that only want to show that objects in the table have problems that can also be shown in the detail panel.  But other applications need to be able to present problems even if the user cannot fix address them directly in the editor, and still other applications cannot afford the up-front cost of creating the child contexts because it just doesn't scale to the number of objects presented in a table.

For these applications, we should add an alternative service that simply aggregates all of the Diagnostics calculated by the Validation Service for each object in the table to present in its row, regardless of any details panel.  This addresses both the need to present all validation problems (the Validation Service has them all anyways) and does so without the cost of creating child contexts.

This new service should be packaged separately in its own bundle, as the TableValidationInitiator is, and not included in the run-time feature by default, so that developers and/or users can choose which service to install, if any.
Comment 1 Eclipse Genie CLA 2018-06-05 11:58:45 EDT
New Gerrit change created: https://git.eclipse.org/r/124038
Comment 2 Eclipse Genie CLA 2018-06-06 07:56:22 EDT
New Gerrit change created: https://git.eclipse.org/r/124105
Comment 3 Eugen Neufeld CLA 2018-06-07 04:28:28 EDT
The idea of the final solution is the following:
Instead of using a service which creates a ViewModelContextfor each element in the table we use a less invasive method.
The validation process is a two step process. The first step is the actual validation. This is straightforward.
The second step is to map the validation results on the actual controls.
This is easy for 'normal' controls like strings.
For tables we have to decide which settings belong to the table control. 
This is done by an EMFFormsMappingProvider. The current implementation only adds the setting of the table reference and the settings of the columns.
The solution is now to also add all other settings of the entries to the list of settings which belong to the control.
Comment 5 Eclipse Genie CLA 2018-06-12 08:57:59 EDT
New Gerrit change created: https://git.eclipse.org/r/124417
Comment 7 Eclipse Genie CLA 2018-07-27 13:25:45 EDT
New Gerrit change created: https://git.eclipse.org/r/126718
Comment 9 Eugen Neufeld CLA 2018-07-27 15:10:00 EDT
TEST INFORMATION

Summary of the critical part of the change

There is now a second plugin which is able to provide the necessary information to show validation messages for tables with detail (org.eclipse.emfforms.core.services.mappingprovider.table.panel).
The old plugin  org.eclipse.emf.ecp.view.table.validation is not part of the org.eclipse.emf.ecp.view.validation.initial.feature anymore, but can be found on the target update site directly (EMF Forms Table Detail Validation (Legacy)).


Potential regressions

As we don't create childcontexts anymore, implementations which rely on this may be broken due to missing ViewModelContexts.


Affected areas / use cases

Validation on tables with detail.


Things that shall be tested

Validation behavior on tables with detail.
Comment 10 Johannes Faltermeier CLA 2018-08-09 07:39:20 EDT
Reopening because commit 49121870 causes the development build including the slow tests to fail. 
Verified with: https://git.eclipse.org/r/#/c/127220/
Comment 11 Eclipse Genie CLA 2018-08-13 11:14:17 EDT
New Gerrit change created: https://git.eclipse.org/r/127355
Comment 13 Eugen Neufeld CLA 2018-08-22 09:35:45 EDT
Mass Move due to time constraints