Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0007019Openbravo ERPA. Platformpublic2009-01-20 10:252009-03-06 12:34
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
pi 
pi 
No
Core
No
0007019: Implement batch validation of application dictionary and module
Batch Validation:
A separate ant task which can be run from the command line with the following checks. The check task will print warnings and errors.

1: ad columns = bd columns: (so there are no physical columns not mapped nor logical columns not in the bd)

2: tables withou primary key

3: Datatype mismatch as per reference: physical type of the column does not match the ad.
eg: reflist should be varchar2(60), or amount should be number...

4: Foreign keys not declared (as per reference). It should just be a warning, and audit info should be excluded (we don't declare foreing key for updatedby and createdby columns)

5: Code in a module should be within the declared javaPackage of the module

6: all modules should finally depend on core

7. Industry templates (module of type "Industry Template") should include core as a module
Extra info:
[09:32:37] iciordia: for the last two (modules depend on core and IT include core), all you need to know is:
[09:34:19] … ad_module_dependency is the table where dependencies and includes are stored
[09:35:06] … the column "isincluded" is a boolean to define if it is a dependency or an include
[09:35:31] … standard modules depend on other modules, and all of them should finally depend on core

8: licensetype and license should not be null. If they are null the validation will send a warning or an error depending on when are we validating (always a warning but when executing package.module)

The above tasks should be done also during module export and when building the system.

Things to take into account for the implementation:
- the validation should be callable for a single module
- the errors/warnings are returned in a result object, so that the caller can decide to print the errors/warnings or throw exceptions
Modularity
related to defect 0007132pi closed alostale AD/DB clean up 
Issue History
2009-01-20 10:25mtaalNew Issue
2009-01-20 10:25mtaalAssigned To => mtaal
2009-01-20 10:25mtaalsf_bug_id0 => 2523096
2009-01-20 10:25mtaalOBNetwork customer => No
2009-01-20 10:25mtaalRegression testing => No
2009-01-20 10:42rafarodaTag Attached: Modularity
2009-01-21 06:21pjuvaraNote Added: 0012420
2009-01-21 06:21pjuvaraStatusnew => feedback
2009-01-21 07:25mtaalNote Added: 0012422
2009-01-21 10:08iciordiaNote Added: 0012426
2009-01-21 10:15iciordiaStatusfeedback => scheduled
2009-01-21 10:15iciordiafix_in_branch => trunk
2009-01-22 09:56svnbotCheckin
2009-01-22 09:56svnbotNote Added: 0012503
2009-01-22 09:56svnbotStatusscheduled => resolved
2009-01-22 09:56svnbotResolutionopen => fixed
2009-01-22 09:56svnbotsvn_revision => 12131
2009-01-22 09:56svnbotCheckin
2009-01-22 09:56svnbotNote Added: 0012504
2009-01-22 09:56svnbotsvn_revision12131 => 213
2009-01-26 13:11alostaleRelationship addedrelated to 0007132
2009-03-06 12:34psarobeStatusresolved => closed

Notes
(0012420)
pjuvara   
2009-01-21 06:21   
This does not seem to be a defect but a feature request. Does it need to be implemented now? Can it wait for the next release?
(0012422)
mtaal   
2009-01-21 07:25   
Hi Paolo,
This topic was entered by Ismael on the product backlog of the scrum team and was listed as important for this sprint (by Ismael). I have been assigned to implement this functionality. Therefore I entered an issue for this to document the progress and the commit of the source code to svn.

I have no strong opinion on the validity of this functionality for the phase of the project in which we are. Can you discuss with Ismael if this is indeed functionality which needs to be done now?

I started the implementation of this yesterday and I am about half way.

gr. Martin
(0012426)
iciordia   
2009-01-21 10:08   
Martin,

I've just talked to Paolo and clarified it. All these validations are needed to avoid the effort to support badly built modules. The more validations we implement at this stage the less support effort we will do in the future.

So go ahead with this as described.

Ismael
(0012503)
svnbot   
2009-01-22 09:56   
Repository: openbravo
Revision: 12131
Author: mtaal
Date: 2009-01-22 09:56:05 +0100 (Thu, 22 Jan 2009)

Fixes issue 7019, added database and module validation at the end of install.source, validates the database against the application dictionary and checks modules for filled license text/type and correct module dependencies.
Fixed dataset test so that it uses a more detailed api, made an extra method in DataSetService public.
REST: Repaired support for paging parameters in url
REST: added better error message when root tag is missing
Updated DBSourceManager to allow control over which part of the database schema is read in-memory, this to improve performance of the database validation logic.

---
U trunk/build.xml
U trunk/config/eclipse/Openbravo-eclipse-prefs.epf
U trunk/src/build.xml
U trunk/src/org/openbravo/dal/service/OBQuery.java
U trunk/src/org/openbravo/dal/xml/XMLEntityConverter.java
U trunk/src/org/openbravo/service/db/DataExportService.java
U trunk/src/org/openbravo/service/db/DataSetService.java
U trunk/src/org/openbravo/service/rest/DalWebService.java
A trunk/src/org/openbravo/service/system/ApplicationDictionaryValidator.java
A trunk/src/org/openbravo/service/system/DatabaseValidator.java
A trunk/src/org/openbravo/service/system/ModuleValidator.java
A trunk/src/org/openbravo/service/system/SystemValidationResult.java
A trunk/src/org/openbravo/service/system/SystemValidationTask.java
A trunk/src/org/openbravo/service/system/SystemValidator.java
U trunk/src-db/database/lib/dbsourcemanager.jar
U trunk/src-test/org/openbravo/test/modularity/DatasetServiceTest.java
A trunk/src-test/org/openbravo/test/system/
A trunk/src-test/org/openbravo/test/system/SystemValidatorTest.java
U trunk/src-test/org/openbravo/test/webservice/WSReadTest.java
U trunk/src-test/org/openbravo/test/webservice/WSUpdateTest.java
---

https://dev.openbravo.com/websvn/openbravo/?rev=12131&sc=1 [^]
(0012504)
svnbot   
2009-01-22 09:56   
Repository: dbsourcemanager
Revision: 213
Author: mtaal
Date: 2009-01-22 09:56:14 +0100 (Thu, 22 Jan 2009)

Fixes issue 7019, added database and module validation at the end of install.source, validates the database against the application dictionary and checks modules for filled license text/type and correct module dependencies.
Fixed dataset test so that it uses a more detailed api, made an extra method in DataSetService public.
REST: Repaired support for paging parameters in url
REST: added better error message when root tag is missing
Updated DBSourceManager to allow control over which part of the database schema is read in-memory, this to improve performance of the database validation logic.

---
U trunk/src/org/apache/ddlutils/Platform.java
U trunk/src/org/apache/ddlutils/platform/ModelLoader.java
U trunk/src/org/apache/ddlutils/platform/ModelLoaderBase.java
---

https://dev.openbravo.com/websvn/dbsourcemanager/?rev=213&sc=1 [^]