Bug 167972 - EMF Validation standalone Submission
Summary: EMF Validation standalone Submission
Status: RESOLVED FIXED
Alias: None
Product: EMF Services
Classification: Modeling
Component: Validation (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement
Target Milestone: ---   Edit
Assignee: Boris Gruschko CLA
QA Contact:
URL:
Whiteboard: Broader Community
Keywords: plan
Depends on: 240352
Blocks: 245284
  Show dependency tree
 
Reported: 2006-12-13 17:29 EST by Horacio Blanco CLA
Modified: 2019-01-03 02:33 EST (History)
2 users (show)

See Also:


Attachments
Standalone support patch against EMF Validation 1.0.1 (23.11 KB, patch)
2006-12-13 17:30 EST, Horacio Blanco CLA
no flags Details | Diff
EMF Validation with standalone support (Eclipse project) (224.93 KB, application/octet-stream)
2006-12-13 17:31 EST, Horacio Blanco CLA
no flags Details
Standalone support patch against EMF Validation 1.1RC2 (23.08 KB, patch)
2007-06-15 12:48 EDT, Horacio Blanco CLA
no flags Details | Diff
Standalone support patch against EMF Validation 1.2 (22.38 KB, patch)
2008-08-18 14:58 EDT, Horacio Blanco CLA
no flags Details | Diff
Standalone support patch against EMF Validation 1.2 (9.85 KB, patch)
2008-08-19 15:39 EDT, Horacio Blanco CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Horacio Blanco CLA 2006-12-13 17:29:23 EST
EMF Validation 1.0.1 does not run standalone (no Eclipse). EMF Validation standalone would allow a much greater deployment flexibility. 

Our company required using EMF and validation on both standalone and in an Eclipse environment. We have extended EMF Validation 1.0.1 to support standalone deployment. Please review and consider incorporating these changes into future versions of the EMF Validation component. 

A client that wants to initialize the validation framework in standalone mode, would need to specify a set of URLs pointing to XML documents describing parsers, constraint providers, categories and constraint bindings. For example:

// Configure validation framework in standalone mode
URL[] urls = new URL[3];
urls[0] = new URL("jar:file:///c:/mydir/lib/org.eclipse.emf.validation_1.0.1.v200609250852.jar!/plugin.xml");
urls[1] = new URL("jar:file:///c:/mydir/lib/org.eclipse.emf.validation.ocl_1.0.1.v200609250852.jar!/plugin.xml");
urls[2] = new URL("file:///c:/mydir/plugin.xml");

EMFModelValidationPlugin.INSTANCE.configureStandalone(urls);

// Invoke validation framework as usual
IBatchValidator validator = 
            (IBatchValidator) ModelValidationService.getInstance().newValidator(EvaluationMode.BATCH);
validator.setIncludeLiveConstraints(true);
validator.validate(object, monitor);
Comment 1 Horacio Blanco CLA 2006-12-13 17:30:51 EST
Created attachment 55617 [details]
Standalone support patch against EMF Validation 1.0.1
Comment 2 Horacio Blanco CLA 2006-12-13 17:31:56 EST
Created attachment 55618 [details]
EMF Validation with standalone support (Eclipse project)
Comment 3 Christian Damus CLA 2007-05-15 14:30:34 EDT
Deferring examination and consideration of these enhancements to the 1.2 release.
Comment 4 Horacio Blanco CLA 2007-06-15 12:48:43 EDT
Created attachment 71491 [details]
Standalone support patch against EMF Validation 1.1RC2
Comment 5 Horacio Blanco CLA 2008-08-18 14:58:13 EDT
Created attachment 110276 [details]
 Standalone support patch against EMF Validation 1.2
Comment 6 Horacio Blanco CLA 2008-08-19 15:39:04 EDT
Created attachment 110386 [details]
Standalone support patch against EMF Validation 1.2 

Minimalistic set of changes to run standalone
Comment 7 Horacio Blanco CLA 2008-08-19 15:44:43 EDT
Chris,

Please take a minute to review the proposed patch to run in standalone mode. I've minimized the number of changes required and there are no additional steps to use it (plugin descriptors are picked up from the classpath):

// Invoke validation framework as usual
IBatchValidator validator = 
            (IBatchValidator)
ModelValidationService.getInstance().newValidator(EvaluationMode.BATCH);
validator.setIncludeLiveConstraints(true);
validator.validate(object, monitor);

Best Regards,
Horacio
Comment 8 Christian Damus CLA 2008-08-19 15:51:08 EDT
Hi, Horacio,

Thanks (again) for the contribution.  I shall make a concerted effort (at least more so than in the last release) to review this for 1.3.
Comment 9 Christian Damus CLA 2008-09-21 18:04:42 EDT
I've had a look through the patches.  I'm not keen on the idea of reading the constraint metadata from the same plugin.xml files as are used in the Eclipse environment.  And, especially, constructing Equinox registries seems fragile.

I will rather take the approach of the EMF core, defining registries corresponding to the extension points, that can be populated statically in Eclipse or dynamically.  This should work well with the existing dynamic-constraint-provider capability (which is recommended over the plugin.xml provider) as well as bug 240352 which will supersede the plugin.xml as a constraint model.
Comment 10 Christian Damus CLA 2008-11-01 19:41:00 EDT
This can't be completed for M3.  Aiming for M4.
Comment 11 Christian Damus CLA 2008-11-16 08:07:28 EST
Postponing to M5, when we should have the model of constraint meta-data (bug 240352) in hand to provide a unified constraint-provider mechanism.
Comment 12 Christian Damus CLA 2008-11-24 09:55:16 EST
Cleaning up after the milestones were all deranged.
Comment 13 Rudy Gachet CLA 2009-11-27 08:17:42 EST
(In reply to comment #12)
> Cleaning up after the milestones were all deranged.

Hi,

What about a release of the standalone version of EMF Validation Framework???
It is a very useful enhancement !!! Lookink forward to try it !
Comment 14 Boris Gruschko CLA 2009-11-27 08:38:04 EST
Rudy,

the fix is in HEAD. There will be a milestone release at sometime in the near future. Meanwhile you can try out the latest and greatest from Hudson.
Comment 15 Rudy Gachet CLA 2009-11-27 10:57:22 EST
Thanks Boris,

(In reply to comment #14)
> future. Meanwhile you can try out the latest and greatest from Hudson.

Can you be more precise please? I dont understant how to get the good jar from Hudson.
Comment 17 Rudy Gachet CLA 2009-11-27 11:14:03 EST
Many many thanks for replying so fast !
You just saved my afternoon !
Comment 18 Rudy Gachet CLA 2009-12-01 05:57:02 EST
Hi,

I tried this code and i can get ModelValidationService instance :).
But getConstraintProviders() return an empty list. I cannot register constraints defined in the plugin.xml file from MyJarWithConstraints.jar, that is in the classpath.
I tried calling modelValidationService.loadXmlConstraintDeclarations(); but same issue.
I don't know what is wrong... Is there another way to add constraintsProvider in ModelValidationService?
Thanks for help.
Comment 19 Boris Gruschko CLA 2009-12-02 07:52:26 EST
Hi Rudy,

yes.. for the standalone case there is the new so called modeled constraints provider. Have a look at the ModeledConstraintsLoader class. As of now there is not much documentation. You have to provide an URI to a resource with instances of ConstraintsBundle from the new validation meta-model (it is located in org.eclipse.emf.validation plugin).

Sorry about the missing documentation, but this feature is new and you are an early adoptert :).

Hope that helps and cheers,
Boris
Comment 20 Rudy Gachet CLA 2009-12-03 03:33:01 EST
(In reply to comment #19)
> Hi Rudy,
> 
> yes.. for the standalone case there is the new so called modeled constraints
> provider. Have a look at the ModeledConstraintsLoader class. As of now there is
> not much documentation. You have to provide an URI to a resource with instances
> of ConstraintsBundle from the new validation meta-model (it is located in
> org.eclipse.emf.validation plugin).
> 
> Sorry about the missing documentation, but this feature is new and you are an
> early adoptert :).
> 
> Hope that helps and cheers,
> Boris

Thanks Boris for your support :)
Yes I knew that i've to wait for a release and i hope that it will be deliver soon. I'll try to make without :).

Cheers
Rudy
Comment 21 Horacio Blanco CLA 2010-07-12 17:00:25 EDT
I believe this defect can be closed now. The modeled constraints (EMF Validation 1.4.0) approach provide stand alone support.

Thanks for all the good work.
Comment 22 Pierre-Charles David CLA 2019-01-03 02:33:01 EST
Closing based on the reporter's last comment (from 2010!).