Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 129953

Summary: Exploit New Validation Framework
Product: [WebTools] WTP Source Editing Reporter: Gary Karasiuk <karasiuk>
Component: wst.xmlAssignee: Lawrence Mandel <lmandel>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: b.eckenfels, csalter, lmandel
Version: 1.5   
Target Milestone: 1.5 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to exploit the new validation framework none

Description Gary Karasiuk CLA 2006-03-01 10:01:48 EST
The XML validator should exploit the new validation framework.
Comment 1 Gary Karasiuk CLA 2006-03-01 10:05:08 EST
Created attachment 35539 [details]
Patch to exploit the new validation framework

To test the new framework, I patched the XML validator. 

One thing that still needs to be changed, is converting or removing the new message that I added. (I didn't add it to the resource bundle, but just added it as a literal).
Comment 2 Lawrence Mandel CLA 2006-03-01 11:50:05 EST
Gary, I just tested out your patch and it appears to work fine for simple files. I see that you removed the IWorkspaceRunnable operation from ValidateAction. That operation was in place to encapsulate adding markers to the workspace in a single operation. This was a performance fix for XML files that contain many errors. When running as part of the validation framework this should no longer be needed but I'd assume it's still needed when running the validator with the Validate XML File context menu action. Did you test out this case? Can you confirm that the IWorkspaceRunnable operation is no longer needed in ValidateAction?
Comment 3 Gary Karasiuk CLA 2006-03-01 12:11:14 EST
(In reply to comment #2)
Because the validator now runs as a job, you can not use the IWorkspaceRunnable 
operation. It will throw an exception if you try. 

I didn’t do much complicated testing either, but I did use the “Run Validation” menu item, to have it run against some files, and for my tests it worked fine. 
Comment 4 Lawrence Mandel CLA 2006-03-01 12:18:12 EST
OK. Because the Validate XML File menu action hasn't been tested I'd feel more comfortable making this move in 1.5M6. I will also refactor the validator so the ValidateAction depends on the ValidatorJob and not the other way around (as it is currently). This will allow the ValidateAction to still use the IWorkspaceRunnable without causing problems when integrating with the validation framework.

I will also do this work for the DTD, WSDL, and XSD validators.
 
Will the M6 timeline work for you Gary?
Comment 5 Gary Karasiuk CLA 2006-03-06 16:27:46 EST
(In reply to comment #4)
I have been testing my patch with the Validate XML file menu option, seems to work fine.

Why do we need yet another menu item, why isn't the Run Validation menu item "good enough"? 
Comment 6 Lawrence Mandel CLA 2006-03-06 16:57:45 EST
Gary, I have bug 112037 open to decide whether these actions are necessary. There are currently some benefits realized by these actions that are not available through the generic Run Validation menu item.
Comment 7 Gary Karasiuk CLA 2006-03-06 17:10:37 EST
(In reply to comment #4)

> This will allow the ValidateAction to still use the
> IWorkspaceRunnable without causing problems when integrating with the
> validation framework.

Given that the validator doesn’t (in fact can’t) change any resources why does the action need to run in an IWorkspaceRunnable ? 

Or if it does need to run in an IWorkspaceRunnable, can you use an Empty scheduling rule? (instead of the default … which is lock the root).  
Comment 8 Lawrence Mandel CLA 2006-03-06 17:29:50 EST
>Given that the validator doesn’t (in fact can’t) change any resources why does
>the action need to run in an IWorkspaceRunnable ? 
As I said in comment #2, although the validator isn't changing any resources it is adding markers to the resources. Adding markers individually is a slow process. Adding them in an IWorkspaceRunnable allows them to be added in a batch. This was introduced as a performance fix for XML files with many errors.

>Or if it does need to run in an IWorkspaceRunnable, can you use an Empty
>scheduling rule? (instead of the default … which is lock the root).  
I don't think there will be a problem using an empty scheduling rule. I'll look into this in M6 when I perform the refactoring of the validators and actions.
Comment 9 Lawrence Mandel CLA 2006-03-29 04:18:27 EST
*** Bug 114942 has been marked as a duplicate of this bug. ***
Comment 10 Lawrence Mandel CLA 2006-03-29 05:22:07 EST
The DTD, WSDL, XML, and XSD validators have been updated to make use of the validator jobs API. I've released the changes to the 1.5 stream. The changes should be in builds from 20060328 and later.
Comment 11 Lawrence Mandel CLA 2006-04-18 13:16:10 EDT
*** Bug 132559 has been marked as a duplicate of this bug. ***
Comment 12 Lawrence Mandel CLA 2006-09-26 12:46:02 EDT
Thanks for verifying. Closing bug.