Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 307922 | Differences between
and this patch

Collapse All | Expand All

(-)vf2/org/eclipse/wst/validation/internal/ValidatorExtensionReader.java (-1 / +24 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2009 IBM Corporation and others.
2
 * Copyright (c) 2007, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 104-109 Link Here
104
			}
104
			}
105
			
105
			
106
		}
106
		}
107
		
108
		for (String removedValidator : getRemovedValidators()){
109
			if (removedValidator != null) {
110
				map.remove(removedValidator);
111
			}
112
		}
113
107
		return map.values();
114
		return map.values();
108
		
115
		
109
	}
116
	}
Lines 221-226 Link Here
221
	}
228
	}
222
	
229
	
223
	/**
230
	/**
231
	 * Answer the extension point for removing a validator. 
232
	 * 
233
	 * @return list of validator ID or null if no validator will be removed
234
	 */
235
	private List<String> getRemovedValidators(){
236
		IExtensionRegistry registry = Platform.getExtensionRegistry();
237
		IExtensionPoint extensionPoint = registry.getExtensionPoint(ValidationPlugin.PLUGIN_ID, ExtensionConstants.removedValidatorExtension);
238
		List<String> val = new LinkedList<String>();
239
		for (IExtension ext : extensionPoint.getExtensions()){
240
			for (IConfigurationElement validator : ext.getConfigurationElements()){
241
				val.add(validator.getAttribute(ExtensionConstants.RemovedValidator.validatorIDAttr));
242
			}
243
		}
244
		return val;
245
	}
246
	/**
224
	 * Process a message element for the validator, by creating a MessageCategory for it.
247
	 * Process a message element for the validator, by creating a MessageCategory for it.
225
	 * 
248
	 * 
226
	 * @param ce a MessageCategory element.
249
	 * @param ce a MessageCategory element.
(-)vf2/org/eclipse/wst/validation/internal/ExtensionConstants.java (-1 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 67-72 Link Here
67
	/** rules - extension point to declare a validator group */
67
	/** rules - extension point to declare a validator group */
68
	String group = "validatorGroup"; //$NON-NLS-1$
68
	String group = "validatorGroup"; //$NON-NLS-1$
69
	
69
	
70
	/** removeV2Validator - extension point to remove a V2 validator */
71
	String removedValidatorExtension = "removeV2Validator"; //$NON-NLS-1$
72
	
73
70
	interface Group {
74
	interface Group {
71
		/*
75
		/*
72
		 * The group sub-element for either the validatorGroup or validator
76
		 * The group sub-element for either the validatorGroup or validator
Lines 175-180 Link Here
175
		String id = "id"; //$NON-NLS-1$
179
		String id = "id"; //$NON-NLS-1$
176
	}
180
	}
177
	
181
	
182
	interface RemovedValidator {
183
		/** validatorId - the validator ID. The String represents the validator that will be removed */
184
		String validatorIDAttr = "validatorId"; //$NON-NLS-1$
185
	}
178
	/** true */
186
	/** true */
179
	String True = "true"; //$NON-NLS-1$
187
	String True = "true"; //$NON-NLS-1$
180
	
188
	
(-)plugin.xml (-1 / +2 lines)
Lines 10-16 Link Here
10
   <extension-point id="validationHelper" name="validationHelper" schema="xsds/validationHelper.exsd"/>
10
   <extension-point id="validationHelper" name="validationHelper" schema="xsds/validationHelper.exsd"/>
11
   <extension-point id="validatorDelegates" name="%ValidatorDelegates" schema="xsds/validatorDelegates.exsd"/>   
11
   <extension-point id="validatorDelegates" name="%ValidatorDelegates" schema="xsds/validatorDelegates.exsd"/>   
12
   <extension-point id="validatorGroup" name="Validator Group" schema="xsds/validatorgroup.exsd"/>   
12
   <extension-point id="validatorGroup" name="Validator Group" schema="xsds/validatorgroup.exsd"/>   
13
   <extension-point id="exclude" name="Validator Exclusions" schema="xsds/exclude.exsd"/>   
13
   <extension-point id="exclude" name="Validator Exclusions" schema="xsds/exclude.exsd"/>
14
   <extension-point id="removeV2Validator" name="%removeV2Validator" schema="xsds/removeV2Validator.exsd"/>   
14
   
15
   
15
<!--============================-->
16
<!--============================-->
16
<!-- Validation Contributions   -->
17
<!-- Validation Contributions   -->
(-)plugin.properties (+1 lines)
Lines 24-26 Link Here
24
Bundle-Vendor.0 = Eclipse Web Tools Platform
24
Bundle-Vendor.0 = Eclipse Web Tools Platform
25
25
26
Extension.validator=Validator (Version 2)
26
Extension.validator=Validator (Version 2)
27
removeV2Validator=Remove V2 Validator
(-)xsds/removeV2Validator.exsd (+123 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.wst.validation" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.wst.validation" id="removeV2Validator" name="Remove V2 Validator"/>
7
      </appInfo>
8
      <documentation>
9
         This is used to remove a V2 validator. By specifying the validator ID, the corresponding validator will be removed as if it hasn&apos;t been registered. The removed validator will not be shown in the Preferences page.
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <annotation>
15
         <appInfo>
16
            <meta.element />
17
         </appInfo>
18
      </annotation>
19
      <complexType>
20
         <sequence>
21
            <element ref="remove" minOccurs="1" maxOccurs="unbounded"/>
22
         </sequence>
23
         <attribute name="point" type="string" use="required">
24
            <annotation>
25
               <documentation>
26
                  
27
               </documentation>
28
            </annotation>
29
         </attribute>
30
         <attribute name="id" type="string">
31
            <annotation>
32
               <documentation>
33
                  
34
               </documentation>
35
            </annotation>
36
         </attribute>
37
         <attribute name="name" type="string">
38
            <annotation>
39
               <documentation>
40
                  
41
               </documentation>
42
               <appInfo>
43
                  <meta.attribute translatable="true"/>
44
               </appInfo>
45
            </annotation>
46
         </attribute>
47
      </complexType>
48
   </element>
49
50
   <element name="remove">
51
      <annotation>
52
         <documentation>
53
            Define the validator that will be removed.
54
         </documentation>
55
      </annotation>
56
      <complexType>
57
         <attribute name="validatorId" type="string" use="required">
58
            <annotation>
59
               <documentation>
60
                  The validator ID that will be removed.
61
               </documentation>
62
            </annotation>
63
         </attribute>
64
      </complexType>
65
   </element>
66
67
   <annotation>
68
      <appInfo>
69
         <meta.section type="since"/>
70
      </appInfo>
71
      <documentation>
72
         WebTools 3.2
73
      </documentation>
74
   </annotation>
75
76
   <annotation>
77
      <appInfo>
78
         <meta.section type="examples"/>
79
      </appInfo>
80
      <documentation>
81
         An example to remove the XSL validator
82
83
&lt;extension
84
       point=&quot;org.eclipse.wst.validation.removeV2Validator&quot;&gt;
85
    &lt;remove
86
          validatorId=&quot;org.eclipse.wst.xml.core.xml&quot;&gt;
87
    &lt;/remove&gt;
88
 &lt;/extension&gt;
89
      </documentation>
90
   </annotation>
91
92
   <annotation>
93
      <appInfo>
94
         <meta.section type="apiinfo"/>
95
      </appInfo>
96
      <documentation>
97
         Provisional API.
98
      </documentation>
99
   </annotation>
100
101
   <annotation>
102
      <appInfo>
103
         <meta.section type="implementation"/>
104
      </appInfo>
105
      <documentation>
106
         [Enter information about supplied implementation of this extension point.]
107
      </documentation>
108
   </annotation>
109
110
   <annotation>
111
      <appInfo>
112
         <meta.section type="copyright"/>
113
      </appInfo>
114
      <documentation>
115
         Copyright (c) 2010 IBM Corporation and others.&lt;br&gt;
116
All rights reserved. This program and the accompanying materials are made 
117
available under the terms of the Eclipse Public License v1.0 which accompanies 
118
this distribution, and is available at &lt;a
119
href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
120
      </documentation>
121
   </annotation>
122
123
</schema>

Return to bug 307922