Author: kwin
Date: Thu Nov 3 10:34:23 2016
New Revision: 1767854
URL: http://svn.apache.org/viewvc?rev=1767854&view=rev
Log:
SLING-6237 enable a specific XML validator for content-projects which ignores
missing grammar in an XML file
Added:
sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/IgnoreMissingGrammarXmlValidator.java
(with props)
Modified:
sling/trunk/tooling/ide/eclipse-core/META-INF/MANIFEST.MF
sling/trunk/tooling/ide/eclipse-core/plugin.xml
Modified: sling/trunk/tooling/ide/eclipse-core/META-INF/MANIFEST.MF
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/META-INF/MANIFEST.MF?rev=1767854&r1=1767853&r2=1767854&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/META-INF/MANIFEST.MF (original)
+++ sling/trunk/tooling/ide/eclipse-core/META-INF/MANIFEST.MF Thu Nov 3
10:34:23 2016
@@ -42,6 +42,8 @@ Import-Package: org.apache.commons.httpc
org.eclipse.wst.server.core.model,
org.eclipse.wst.server.core.util,
org.eclipse.wst.validation,
+ org.eclipse.wst.xml.core.internal.validation.core,
+ org.eclipse.wst.xml.core.internal.validation.eclipse,
org.json,
org.osgi.service.component;version="1.1.0"
Export-Package: org.apache.sling.ide.eclipse.core,
Modified: sling/trunk/tooling/ide/eclipse-core/plugin.xml
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/plugin.xml?rev=1767854&r1=1767853&r2=1767854&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/plugin.xml (original)
+++ sling/trunk/tooling/ide/eclipse-core/plugin.xml Thu Nov 3 10:34:23 2016
@@ -253,7 +253,7 @@
</validator>
</extension>
- <!-- disable XML validation for content projects -->
+ <!-- disable general XML validation for content projects -->
<extension id="org.apache.sling.ide.excludeXmlValidator"
point="org.eclipse.wst.validation.exclude">
<validator id="org.eclipse.wst.xml.core.xml">
<exclude>
@@ -264,6 +264,42 @@
</validator>
</extension>
+ <!-- but enable our own XML validator based on the default XML
validator ignoring any missing grammar, look at org.eclipse.wst.xml.core ->
plugin.xml on how to configure -->
+ <extension id="xml" name="XML Validator for Sling Content Projects"
point="org.eclipse.wst.validation.validatorV2">
+ <validator
+ build="true"
+
class="org.apache.sling.ide.eclipse.internal.validation.IgnoreMissingGrammarXmlValidator"
+ manual="true"
+
sourceid="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
+ version="3"
+ markerId="org.eclipse.wst.xml.core.validationMarker">
+ <include>
+ <rules>
+ <contentType id="org.eclipse.core.runtime.xml"></contentType>
+ <contentType
id="org.eclipse.wst.xml.core.xmlsource"></contentType>
+ <contentType
id="org.eclipse.wst.xml.core.xslsource"></contentType>
+ <contentType
id="org.eclipse.jst.jsp.core.tldsource"></contentType>
+ <fileext
+ caseSensitive="false"
+ ext="xml">
+ </fileext>
+ <!--only enable for sling.content projects -->
+ <facet id="sling.content"/>
+ </rules>
+ </include>
+ <exclude>
+ <rules>
+ <projectNature
id="org.eclipse.jst.j2ee.ejb.EJBNature"/>
+ <projectNature
id="org.eclipse.jst.j2ee.EARNature"/>
+ <file caseSensitive="true" name=".project" type="file"/>
+ <file caseSensitive="true" name=".classpath"
type="file"/>
+ <file caseSensitive="true" name=".settings"
type="folder"/>
+ </rules>
+ </exclude>
+ </validator>
+ </extension>
+
+
<!-- Store project preferences in the filesystem -->
<extension id="org.apache.sling.ide.preferences"
point="org.eclipse.core.runtime.preferences">
<scope name="project"
class="org.eclipse.core.internal.resources.ProjectPreferences">
Added:
sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/IgnoreMissingGrammarXmlValidator.java
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/IgnoreMissingGrammarXmlValidator.java?rev=1767854&view=auto
==============================================================================
---
sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/IgnoreMissingGrammarXmlValidator.java
(added)
+++
sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/IgnoreMissingGrammarXmlValidator.java
Thu Nov 3 10:34:23 2016
@@ -0,0 +1,17 @@
+package org.apache.sling.ide.eclipse.internal.validation;
+
+import
org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
+import org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;
+
+@SuppressWarnings("restriction")
+public class IgnoreMissingGrammarXmlValidator extends Validator {
+
+ @Override
+ protected void setupValidation(NestedValidatorContext context) {
+ super.setupValidation(context);
+ // always ignore missing grammar constraints being referenced in the
XML
+ indicateNoGrammar = 0;
+ }
+
+
+}
Propchange:
sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/IgnoreMissingGrammarXmlValidator.java
------------------------------------------------------------------------------
svn:mime-type = text/plain