Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 112037 - Should DTD, WSDL, XML, XSD validators have "Validate" action
Summary: Should DTD, WSDL, XML, XSD validators have "Validate" action
Status: CLOSED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 0.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Lawrence Mandel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-08 17:02 EDT by Lawrence Mandel CLA
Modified: 2006-05-18 17:18 EDT (History)
6 users (show)

See Also:


Attachments
Patch for org.eclipse.wst.validation (8.40 KB, patch)
2006-03-31 03:55 EST, Lawrence Mandel CLA
no flags Details | Diff
Patch for org.eclipse.wst.validation.ui (20.99 KB, patch)
2006-03-31 03:57 EST, Lawrence Mandel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lawrence Mandel CLA 2005-10-08 17:02:42 EDT
The DTD, WSDL, XML, and XSD validators can all be run either through the
validation framework or via the "Validate X file" context action. I've opened
this defect to determine whether we should continue to maintain the validate
actions given that other validators such as JSP, HTML, etc., which not XML file
types per se, do not have these actions.

David, Vijay - I'm hoping you can give a XML neutral validation perspective on
this having removed the Run Validation action from the validation framework.
Comment 1 Vijay Bhadriraju CLA 2005-10-09 21:52:36 EDT
My thought on this is that any validator that is being run as part of the 
validation framework should not have its own "Validation XXX file" action. 
Every validator should run off the Run Validation action. If any validator is 
having its own validation action, we need to understand why this action is 
needed and what is the limitation in the framework that is forcing for any 
validator have its own action.
Comment 2 David Williams CLA 2005-10-10 13:44:07 EDT
I'm not sure what a "XML neutral validation perspective" is, but I agree. 
There should not be seperate actions. I'd say let's approach with following steps. 

1. One action, "Run Validation" ... it works on file, or project. 
If folder selected, runs on files in that folder? If just a file, 
it picks out right validator(s) based on extension/content type. 

2. Ideally, using content type based object actions, action should only appear on 
files/projects which are "match" for covered content types. 

3. Eventually, have dynamic label, so user is re-assures its doing what they
want, for example, if XML slected, would say "Validate: XML", if JSP selected, 
"Validate: JSP", if project selected, "Validate Project". 

= = =
Is this the feedback needed?
Comment 3 Vijay Bhadriraju CLA 2005-10-10 14:11:25 EDT
Yes, This is the feedback that we need. I brought this functional requirment to 
Chuck's attention and at this point we do not have the resources to do this for 
1.0 timeframe and I would let chuck comment on the timing and priority of this 
function request and when it can be done.
Comment 4 Vijay Bhadriraju CLA 2005-10-10 14:13:00 EDT
Chuck, Can you comment on the timing and priority of these functional 
requiremnts in VF.
Comment 5 Lawrence Mandel CLA 2006-03-06 16:56:34 EST
I'm picking this back up now that we're in 1.5 and changes have already been made to the validation framework.

A few of the nice features we currently get from our separate Validate actions for XML, WSDL, XSD, and DTD files are:

1. the ability to report messages other than pass/fail - for example, the XML validator provides a message that states if no grammar is detected for an XML file

2. the actions give users the ability to tell that a selected file is valid or not by the dialog that appears at the end of validation. This is arguably unnecessary as errors and warning are flagged on the file itself

3. the files are checked for their 'dirty' status and if 'dirty' (changes have been made since the last save) the user is prompted to save the file before validating it

Chuck/Vijay - Can we work fixes into the validation framework for at least 1 and 3?
Comment 6 Gary Karasiuk CLA 2006-03-06 17:13:59 EST
I vote for getting rid of the extra menu item.  
Comment 7 Nitin Dahyabhai CLA 2006-03-07 03:12:51 EST
> 1. the ability to report messages other than pass/fail - for example, the XML
> validator provides a message that states if no grammar is detected for an XML
> file
Possibly just handling the neither pass nor fail messages as Warnings in the Problems view (which could be disabled at the user's request).  As an aside, is there a central way of displaying user settings specific to each validator?
Comment 8 Lawrence Mandel CLA 2006-03-07 11:09:13 EST
>Possibly just handling the neither pass nor fail messages as Warnings in the
>Problems view (which could be disabled at the user's request).  
That may work. I'll have to take a look at the messages to see if it makes sense to display them in the Problems view.

>As an aside, is there a central way of displaying user settings specific to each >validator?
Not currently but Craig's team recently started investigating this.
Craig - Is there an open bug for validator specific preference pages?
Comment 9 Lawrence Mandel CLA 2006-03-29 13:06:46 EST
I've removed the Validate DTD/WSDL/XML/XSD File menu items. This bug will remain open to track the two enhancements to the Run Validation menu action that Craig and I feel are required (and I will investigate) now that the XML specific options have been removed.

The two enhancements are:
1. If any of the files selected for manual validation are dirty (unsaved changes in an editor) the user should be prompted to save the files before validating them.
2. The manual validation dialog should display overall validation results. This may be number of files not valid or number of errors and warnings reported. If minimized, the progress view should maintain the validation task after it is complete so a user can select it to see the results.
Comment 10 Lawrence Mandel CLA 2006-03-31 03:52:50 EST
I have a fix ready for the first issue I stated in comment #9. The fix will prompt the user to save any file that is included in validation that has a dirty editor. This fix requires the addition of another setting to the global validation preference page. This fix also required the resolution of bug 129977, which is included in the patches that follow.

I haven't included tests at this time. Not only does no test suite exist for the validation framework but the code seems quite confusing at the moment.

Vijay - I'd appreciate your review of the patches that will follow.
Comment 11 Lawrence Mandel CLA 2006-03-31 03:55:28 EST
Created attachment 37398 [details]
Patch for org.eclipse.wst.validation

This patch adds a global preference for save automatically to the global preference configuration.

This patch also contains a fix for bug 129977 restricting validation to the resources that were selected.
Comment 12 Lawrence Mandel CLA 2006-03-31 03:57:21 EST
Created attachment 37399 [details]
Patch for org.eclipse.wst.validation.ui

This patch adds the save dialog. When manually running validation, the dialog will display with a list of files that are to be validated but are dirty and inform the user that the files must be saved prior to validating. The dialog also contains an option to always save. This option is mirrored on the global validation preference page.
Comment 13 Lawrence Mandel CLA 2006-03-31 03:58:38 EST
I forgot to add in comment #10 that an enhancement that should be made to this patch at a later time is to only prompt to save files that will be validated. For example, if validating a project and the .project file is dirty the user will be prompted to save it even though it will not be validated by any validator.
Comment 14 Lawrence Mandel CLA 2006-04-03 17:37:44 EDT
Vijay committed and released my fix for problem 1 today. The fix will be included in the I-build from the week of 20060403. 
Comment 15 Lawrence Mandel CLA 2006-04-26 16:16:41 EDT
Bug 138743 has been opened to track issue 2 from comment #9. I'm resolving this bug as the rest of the bug has been fixed and is in WTP 1.5M6.
Comment 16 Lawrence Mandel CLA 2006-05-18 17:18:35 EDT
Verified on wtp-sdk-S-1.5RC3-200605162029.
Comment 17 Lawrence Mandel CLA 2006-05-18 17:18:46 EDT
Closing bug.