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

Bug 86309

Summary: [validation] Move core helper from XML validator to validation framework
Product: [WebTools] WTP Common Tools Reporter: Lawrence Mandel <lmandel>
Component: wst.validationAssignee: Neeraj Agrawal <nagrawal>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: valentinbaciu, vbhadrir
Version: 0.7Keywords: helpwanted
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Lawrence Mandel CLA 2005-02-23 12:39:41 EST
The XML validator currently contains a core helper class  
org.eclipse.wst.xml.validation.internal.core.Helper. This is a general helper 
that is reused by the XML, DTD, XSD, and WSDL (available in WSVT) validators. 
This helper class should be pushed down to the validation framework and made 
available to any validators that need a default helper.

As an anhancement to this helper, the dependency on the JDT should be removed. 
The JDT dependency exists to support validation specific to JDT projects. (The 
helper does not validate resources in the bin directory.) This funtionality 
should be made extensible so a default helper can be defined for a given 
project type and all existing validators that use a default helper will 
automatically use the default for the given project type. As an example of 
this, if I am validating a Java project the bin directory is not validated. If 
I am validating a Web project, perhaps the INF directory is not validated 
(this is just an example - this directory should be validated). If I am 
validating a resource project all resources should be validated. The key here 
is that this is extensible so the validation framework does not need to know 
about all project types up front.
Comment 1 Vijay Bhadriraju CLA 2005-06-14 11:19:25 EDT
Lawrence, We have already moved the function that is available in the XML helper
to WorkbenchContext the only second part of this defect needs to be fixed i.e
the JDT dependency needs to moved to a separate extension point so it is
available only for java projects infact not sure if this ext point is really
needed. Please comment
Comment 2 Lawrence Mandel CLA 2005-06-14 16:49:07 EDT
Two comments/questions.

1. As I understand it, the current state of the validation framework still
requires all validators to declare their own helper. We had discussed removing
the requirement on the client to provide a helper.

2. Is there currently a default helper contained in the validation framework
which clients can reuse or does every client need to define and specify their
own helper?
Comment 3 Lawrence Mandel CLA 2005-06-29 00:44:47 EDT
Vijay, I'm working on verifying defects. Can you provide answers for my
previously asked questions?
Comment 4 Vijay Bhadriraju CLA 2005-06-29 09:23:23 EDT
1. As I understand it, the current state of the validation framework still
requires all validators to declare their own helper. We had discussed removing
the requirement on the client to provide a helper.

A. We will still have the notion of each validator having an optional helper in
the future. In the case where the validator does not provide one the default
WorkbenchContext implmentation of IValidationContext will be used and  passed in.

2. Is there currently a default helper contained in the validation framework
which clients can reuse or does every client need to define and specify their
own helper?

A. Currently the validator ext defn needs to explicity define the helper as
always it has been. They are can used the WorkbenchContext class as the default
implmentation if they do not want to implement one i.e usually the cases where
the validators are interested only in the changed file uri's
Comment 5 Lawrence Mandel CLA 2005-06-29 11:37:50 EDT
So the current state is a validator needs to explicitly state the workbench
context that is part of the framework. Can you provide the class that should be
used as the helper in this case?

I'm going to reopen this defect and leave the target as is. The goal of this
defect is for the validation framework to have a default helper and not require
validators to explicitly define the helper.
Comment 6 Vijay Bhadriraju CLA 2005-08-09 11:14:38 EDT
The fix to create a default workbench context if not defined in the validator
ext point under the helper element is released.
Comment 7 Lawrence Mandel CLA 2005-12-20 18:10:08 EST
I tested on RC5 and when I remove the helper declaration for the WSDL validator the validator is no longer available from the validation framework. The validation preference page does not list the WSDL validator. I also see the following in the log:

!ENTRY org.eclipse.wst.validation 4 0 2005-12-20 18:08:12.289
!MESSAGE 
*** ERROR ***: Tue Dec 20 18:08:12 EST 2005    IWAE0021E Cannot locate meta-data for validator org.eclipse.wst.wsdl.ui.internal.validation.Validator.
Comment 8 Valentin Baciu CLA 2009-08-18 15:55:57 EDT
Starting with WTP 3.0 the majority of the effort is focused on the new validation framework. It is very likely that the old framework will be deprecated. We will continue to main it until all adopters migrate to the new framework. 

As such, I will mark this old defect as wontfix.