Author: bbrodt
Date: 2011-02-04 14:25:48 -0500 (Fri, 04 Feb 2011)
New Revision: 29019
Added:
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/UnknownElementValidator.java
Modified:
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/Factory.java
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/messages.properties
Log:
https://issues.jboss.org/browse/JBIDE-6825
Handle unknown BPEL elements
Modified:
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/Factory.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/Factory.java 2011-02-04
18:57:19 UTC (rev 29018)
+++
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/Factory.java 2011-02-04
19:25:48 UTC (rev 29019)
@@ -47,13 +47,13 @@
public Validator create(QName qname) {
- String nsURI = qname.getNamespaceURI();
-
- if (nsURI.equals(IConstants.XMLNS_BPEL) || nsURI.equals(IConstants.XMLNS_BPEL20_OLD))
{
- return createValidator ( qname.getLocalPart() );
- }
-
- return null;
+ // Bugzilla 324165
+ //
https://issues.jboss.org/browse/JBIDE-6825
+ // handle unknown BPEL elements
+ Validator validator = createValidator ( qname.getLocalPart() );
+ if (validator==null)
+ validator = new UnknownElementValidator();
+ return validator;
}
@SuppressWarnings("nls")
Added:
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/UnknownElementValidator.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/UnknownElementValidator.java
(rev 0)
+++
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/UnknownElementValidator.java 2011-02-04
19:25:48 UTC (rev 29019)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010 JBoss, Inc. and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.eclipse.bpel.validator.rules;
+
+import org.eclipse.bpel.validator.model.IProblem;
+
+/*
+ * This validator handles unknown BPEL elements. Actually not a validator at all, just an
error reporter.
+ *
+ * @see Bugzilla 324165
+ * @see
https://issues.jboss.org/browse/JBIDE-6825
+ * @author Bob Brodt
+ * @date Aug 13, 2010
+ */
+public class UnknownElementValidator extends CValidator {
+
+ @Override
+ protected void start () {
+ super.start();
+
+ IProblem problem = createError();
+
+ problem.fill("BPELC_UNKNOWN__ELEMENT",
+ toString(mNode.nodeName()),
+ mNode.nodeName().getNamespaceURI());
+ }
+
+ @Override
+ public void checkParentNode () {
+ }
+}
Modified:
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/messages.properties
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/messages.properties 2011-02-04
18:57:19 UTC (rev 29018)
+++
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/messages.properties 2011-02-04
19:25:48 UTC (rev 29019)
@@ -922,3 +922,15 @@
BPELC_MISSING_EXTENSION__ACTIVITY.summary = Extension Activity element <{0}> must
have exactly one child element.
BPELC_MISSING_EXTENSION__ACTIVITY = Extension Activity element <{0}
name="{1}"> must have exactly one child element.
BPELC_MISSING_EXTENSION__ACTIVITY.fix = Make sure the Extension Activity element
<{0}> has exactly one child element that is supported by this implementation
+#
+# Bugzilla 324165
+#
https://issues.jboss.org/browse/JBIDE-6825
+#
+# ------------- Unknown BPEL Element ---------------------
+# BPELC_UNKNOWN__ELEMENT
+# {0}: node
+# {1}: namespace URI
+#
+BPELC_UNKNOWN__ELEMENT.summary = BPEL element <{0}> is not supported.
+BPELC_UNKNOWN__ELEMENT = BPEL element <{0}> in namespace "{1}" is not
supported by this implementation.
+BPELC_UNKNOWN__ELEMENT.fix = Remove the element <{0}> or contact the vendor to
obtain the necessary plug-in(s)