savara SVN: r402 - trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-16 12:12:30 -0400 (Thu, 16 Sep 2010)
New Revision: 402
Modified:
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
Log:
Remove unnecessary printf
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-09-16 16:05:34 UTC (rev 401)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-09-16 16:12:30 UTC (rev 402)
@@ -229,8 +229,6 @@
javax.wsdl.Message mesg=defn.getMessage(new QName(namespace, wsdlMessageType));
if (mesg != null && mesg.getParts().size() == 1) {
- System.out.println("PARTS="+mesg.getParts());
-
javax.wsdl.Part part=(javax.wsdl.Part)
mesg.getParts().values().iterator().next();
13 years, 7 months
savara SVN: r401 - in trunk/tools/plugins: org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse and 14 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-16 12:05:34 -0400 (Thu, 16 Sep 2010)
New Revision: 401
Added:
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/Messages.properties
trunk/tools/plugins/org.scribble.core/src/java/org/scribble/model/admin/Context.java
Modified:
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/RelationshipValidator.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ws/BPELRelationshipValidator.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/DefaultBPELLanguageModel.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/parser/BPELModelParserRule.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/GeneratorTest.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/parser/ParserTest.java
trunk/tools/plugins/org.scribble.conformance/src/plugintest/org/scribble/conformance/model/transform/TransformTest.java
trunk/tools/plugins/org.scribble.conversation.comparator/src/plugintest/org/scribble/conversation/comparator/model/transform/TransformTest.java
trunk/tools/plugins/org.scribble.core/src/java/org/scribble/model/admin/AbstractModelRepository.java
trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/DefaultParser.java
trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/DefaultParserContext.java
trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/Parser.java
trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/ParserContext.java
trunk/tools/plugins/org.scribble.core/src/test/org/scribble/parser/DefaultParserContextTest.java
trunk/tools/plugins/org.scribble.core/src/test/org/scribble/parser/TestParserContext.java
trunk/tools/plugins/org.scribble.eclipse/src/java/org/scribble/eclipse/model/admin/OSGIModelListener.java
Log:
Fixed SAVARA-121 where conformance checking for BPEL was producing errors, as the message types were being compared against the WSDL message type name, rather than the type of the doc/lit XSD element/type that it contained.
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -22,6 +22,7 @@
package org.jboss.savara.tap.model.admin;
import org.jboss.savara.tap.model.Resource;
+import org.scribble.model.ModelReference;
import org.scribble.model.admin.ModelListener;
public interface ResourceLoader {
@@ -36,6 +37,14 @@
public boolean isSupported(Resource resource);
/**
+ * This method determines if the supplied resource exists.
+ *
+ * @param resource The resource
+ * @return Whether the resource exists
+ */
+ public boolean exists(Resource resource);
+
+ /**
* This method retrieves the contents associated with the
* supplied resource.
*
@@ -45,6 +54,29 @@
public java.io.InputStream getContents(Resource resource);
/**
+ * This method retrieves the contents associated with the
+ * supplied URI. If the URI is a relative path, then the resource will
+ * be located relative to the supplied model reference.
+ *
+ * @param ref The model reference
+ * @param uri The URI
+ * @return The contents, or null if not found
+ */
+ public java.io.InputStream getContents(ModelReference ref, String uri);
+
+ /**
+ * This method retrieves the URI associated with the
+ * supplied URI string. If the supplied URI is a relative path,
+ * then the resource will be located relative to the supplied
+ * model reference.
+ *
+ * @param ref The model reference
+ * @param uri The URI
+ * @return The resolved URI, or null if not found
+ */
+ public java.net.URI getURI(ModelReference ref, String uri);
+
+ /**
* This method returns a model listener associated with the supplied resource.
*
* @param res The resource
@@ -60,4 +92,12 @@
*/
public void freeResourceModelListener(Resource res, ModelListener l);
+ /**
+ * This method returns the model reference associated with the supplied resource.
+ *
+ * @param resource The resource
+ * @return The model reference
+ */
+ public ModelReference getModelReference(Resource resource);
+
}
Modified: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -26,12 +26,15 @@
import java.util.logging.Logger;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.Path;
import org.jboss.savara.tap.model.Resource;
import org.jboss.savara.tap.model.URI;
import org.jboss.savara.tap.model.admin.ResourceLoader;
import org.scribble.eclipse.model.admin.OSGIModelListener;
+import org.scribble.eclipse.model.admin.OSGIModelRepository;
+import org.scribble.model.ModelReference;
import org.scribble.model.admin.ModelListener;
/**
@@ -63,6 +66,17 @@
}
/**
+ * This method determines if the supplied resource exists.
+ *
+ * @param resource The resource
+ * @return Whether the resource exists
+ */
+ public boolean exists(Resource resource) {
+ IFile res=getFile(resource);
+ return(res == null ? false : res.exists());
+ }
+
+ /**
* This method retrieves the contents associated with the
* supplied resource.
*
@@ -87,6 +101,89 @@
/**
* This method retrieves the contents associated with the
+ * supplied URI. If the URI is a relative path, then the resource will
+ * be located relative to the supplied model reference.
+ *
+ * @param ref The model reference
+ * @param uri The URI
+ * @return The contents, or null if not found
+ */
+ public java.io.InputStream getContents(ModelReference ref, String uri) {
+ java.io.InputStream ret=null;
+
+ if (uri != null) {
+
+ if (uri.startsWith("http:")) {
+ // TODO: Implement
+
+ } else {
+ // Try to locate as relative path from supplied model reference
+ IFile file=OSGIModelRepository.getFile(ref);
+
+ // Find folder
+ IFolder folder = (IFolder)file.getParent();
+
+ IFile refFile=folder.getFile(new Path(uri));
+
+ if (refFile != null) {
+ try {
+ ret = refFile.getContents();
+ } catch(Exception e) {
+ logger.log(Level.SEVERE,
+ "Failed to load content from referenced resource '"+uri+"'", e);
+ }
+ } else if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Unable to locate resource '"+uri+"'");
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method retrieves the URI associated with the
+ * supplied URI string. If the supplied URI is a relative path,
+ * then the resource will be located relative to the supplied
+ * model reference.
+ *
+ * @param ref The model reference
+ * @param uri The URI
+ * @return The resolved URI, or null if not found
+ */
+ public java.net.URI getURI(ModelReference ref, String uri) {
+ java.net.URI ret=null;
+
+ if (uri != null) {
+
+ if (uri.startsWith("http:")) {
+ try {
+ ret = new java.net.URI(uri);
+ } catch(Exception e) {
+ logger.log(Level.SEVERE, "Invalid URI '"+uri+"'", e);
+ }
+ } else {
+ // Try to locate as relative path from supplied model reference
+ IFile file=OSGIModelRepository.getFile(ref);
+
+ // Find folder
+ IFolder folder = (IFolder)file.getParent();
+
+ IFile refFile=folder.getFile(new Path(uri));
+
+ if (refFile != null) {
+ ret = refFile.getRawLocationURI();
+ } else if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Unable to locate resource '"+uri+"'");
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method retrieves the contents associated with the
* supplied resource.
*
* @param resource The resource
@@ -161,4 +258,15 @@
((OSGIModelListener)l).finished();
}
}
+
+ /**
+ * This method returns the model reference associated with the supplied resource.
+ *
+ * @param resource The resource
+ * @return The model reference
+ */
+ public ModelReference getModelReference(Resource resource) {
+ return(OSGIModelRepository.createReference(getFile(resource)));
+ }
+
}
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/Messages.properties
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/Messages.properties (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/Messages.properties 2010-09-16 16:05:34 UTC (rev 401)
@@ -0,0 +1,20 @@
+#/*
+# * JBoss, Home of Professional Open Source
+# * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+# * by the @authors tag. All rights reserved.
+# * See the copyright.txt in the distribution for a
+# * full listing of individual contributors.
+# * This copyrighted material is made available to anyone wishing to use,
+# * modify, copy, or redistribute it subject to the terms and conditions
+# * of the GNU Lesser General Public License, v. 2.1.
+# * This program is distributed in the hope that it will be useful, but WITHOUT A
+# * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+# * You should have received a copy of the GNU Lesser General Public License,
+# * v.2.1 along with this distribution; if not, write to the Free Software
+# * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# * MA 02110-1301, USA.
+# */
+
+SAVARATAPV-00001=Unable to load resource type for resource with id "{0}"
+SAVARATAPV-00002=Unable to locate resource with id "{0}"
Modified: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/RelationshipValidator.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/RelationshipValidator.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/RelationshipValidator.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -23,6 +23,7 @@
import org.jboss.savara.tap.model.Relationship;
import org.jboss.savara.tap.model.Resource;
+import org.jboss.savara.tap.model.admin.ResourceLoader;
import org.scribble.model.admin.ModelListener;
/**
@@ -49,12 +50,12 @@
*
* @param rel The relationship details
* @param fromResource The 'from' resource to be validated
- * @param fromIS The 'from' resource input stream
+ * @param fromRL The 'from' resource loader
* @param toResource The 'to' resource to be validated
- * @param toIS The 'to' resource input stream
+ * @param toRL The 'to' resource loader
* @param l The model listener
*/
- public void validate(Relationship rel, Resource fromResource, java.io.InputStream fromIS,
- Resource toResource, java.io.InputStream toIS, ModelListener l);
+ public void validate(Relationship rel, Resource fromResource, ResourceLoader fromRL,
+ Resource toResource, ResourceLoader toRL, ModelListener l);
}
Modified: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -21,6 +21,7 @@
*/
package org.jboss.savara.tap.validation;
+import java.text.MessageFormat;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -30,6 +31,7 @@
import org.jboss.savara.tap.model.Relationship;
import org.jboss.savara.tap.model.Resource;
import org.jboss.savara.tap.model.admin.ResourceLoader;
+import org.scribble.model.admin.ModelIssue;
import org.scribble.model.admin.ModelListener;
/**
@@ -113,16 +115,17 @@
// Load and validate the individual resources
for (Phase phase : project.getPhase()) {
for (Resource resource : phase.getResource()) {
- ModelListener rl=getResourceModelListener(resource);
+ ModelListener ml=getResourceModelListener(resource);
// Validate resource
for (ResourceValidator rv : m_resourceValidators) {
if (rv.isSupported(resource)) {
// Obtain input stream for resource
- java.io.InputStream is=getResourceContents(resource);
+ ResourceLoader rl=getResourceLoader(resource);
+ java.io.InputStream is=rl.getContents(resource);
if (is != null) {
- rv.validate(resource, is, rl);
+ rv.validate(resource, is, ml);
try {
is.close();
@@ -146,12 +149,38 @@
if (rv.isSupported(rel, resource, toResource)) {
// Obtain input stream for resource
- java.io.InputStream fromIS=getResourceContents(resource);
- java.io.InputStream toIS=getResourceContents(toResource);
+ ResourceLoader fromRL=getResourceLoader(resource);
+ ResourceLoader toRL=getResourceLoader(toResource);
- rv.validate(rel, resource, fromIS, toResource, toIS, rl);
+ if (fromRL == null) {
+ l.error(new ModelIssue(null,
+ MessageFormat.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.savara.tap.validation.Messages").
+ getString("SAVARATAPV-00001"), resource.getId())));
+ } else if (toRL == null) {
+ l.error(new ModelIssue(null,
+ MessageFormat.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.savara.tap.validation.Messages").
+ getString("SAVARATAPV-00001"), toResource.getId())));
+ } else if (!fromRL.exists(resource)) {
+ l.error(new ModelIssue(null,
+ MessageFormat.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.savara.tap.validation.Messages").
+ getString("SAVARATAPV-00002"), resource.getId())));
+ } else if (!toRL.exists(toResource)) {
+ l.error(new ModelIssue(null,
+ MessageFormat.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.savara.tap.validation.Messages").
+ getString("SAVARATAPV-00002"), toResource.getId())));
+ } else {
+ rv.validate(rel, resource, fromRL, toResource, toRL, ml);
- break;
+ break;
+ }
}
}
} else {
@@ -160,18 +189,18 @@
}
}
- freeResourceModelListener(resource, rl);
+ freeResourceModelListener(resource, ml);
}
}
}
- protected java.io.InputStream getResourceContents(Resource resource) {
- java.io.InputStream ret=null;
+ protected ResourceLoader getResourceLoader(Resource resource) {
+ ResourceLoader ret=null;
try {
for (ResourceLoader rl : m_resourceLoaders) {
if (rl.isSupported(resource)) {
- ret = rl.getContents(resource);
+ ret = rl;
if (ret != null) {
break;
@@ -179,7 +208,7 @@
}
}
} catch(Exception e) {
- logger.log(Level.SEVERE, "Failed to load resource '"+
+ logger.log(Level.SEVERE, "Failed to get resource loader for resource '"+
resource.getId()+"'", e);
}
Modified: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ws/BPELRelationshipValidator.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ws/BPELRelationshipValidator.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ws/BPELRelationshipValidator.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -21,14 +21,19 @@
*/
package org.jboss.savara.tap.validation.ws;
+import java.io.InputStream;
+
import javax.xml.namespace.QName;
import org.jboss.savara.tap.model.Link;
import org.jboss.savara.tap.model.Relationship;
import org.jboss.savara.tap.model.Resource;
+import org.jboss.savara.tap.model.admin.ResourceLoader;
import org.jboss.savara.tap.validation.RelationshipValidator;
import org.scribble.model.Model;
+import org.scribble.model.ModelReference;
import org.scribble.model.Role;
+import org.scribble.model.admin.Context;
import org.scribble.model.admin.ModelIssue;
import org.scribble.model.admin.ModelListener;
@@ -70,13 +75,13 @@
*
* @param rel The relationship details
* @param fromResource The 'from' resource to be validated
- * @param fromIS The 'from' resource input stream
+ * @param fromRL The 'from' resource loader
* @param toResource The 'to' resource to be validated
- * @param toIS The 'to' resource input stream
+ * @param toRL The 'to' resource loader
* @param l The model listener
*/
- public void validate(Relationship rel, Resource fromResource, java.io.InputStream fromIS,
- Resource toResource, java.io.InputStream toIS, ModelListener l) {
+ public void validate(Relationship rel, Resource fromResource, final ResourceLoader fromRL,
+ Resource toResource, final ResourceLoader toRL, ModelListener l) {
String roleName=null;
// Get the 'to' role associated with the link
@@ -94,21 +99,27 @@
} else {
org.scribble.parser.Parser p=new org.scribble.parser.DefaultParser();
- org.scribble.model.ModelReference fromRef=
- new org.scribble.model.ModelReference("bpel");
+ org.scribble.model.ModelReference fromRef=fromRL.getModelReference(fromResource);
+ //new org.scribble.model.ModelReference("bpel");
- org.scribble.model.Model fromModel=p.parse(fromRef, fromIS, l);
+ java.io.InputStream fromIS=fromRL.getContents(fromResource);
+ org.scribble.model.Model fromModel=p.parse(fromRef, fromIS, l,
+ new ResourceLoaderContext(fromRL));
+
if (fromModel == null) {
ModelIssue issue=new ModelIssue();
issue.setMessage("Failed to parse '"+fromResource.getId()+"'");
l.error(issue);
} else {
- org.scribble.model.ModelReference toRef=
- new org.scribble.model.ModelReference("cdm");
+ org.scribble.model.ModelReference toRef=toRL.getModelReference(toResource);
+ //new org.scribble.model.ModelReference("cdm");
- org.scribble.model.Model toModel=p.parse(toRef, toIS, l);
+ java.io.InputStream toIS=fromRL.getContents(toResource);
+
+ org.scribble.model.Model toModel=p.parse(toRef, toIS, l,
+ new ResourceLoaderContext(toRL));
if (toModel == null) {
ModelIssue issue=new ModelIssue();
@@ -142,4 +153,23 @@
}
}
+ public class ResourceLoaderContext implements Context {
+
+ private ResourceLoader m_resourceLoader=null;
+
+ public ResourceLoaderContext(ResourceLoader rl) {
+ m_resourceLoader = rl;
+ }
+
+ @Override
+ public InputStream getResource(ModelReference ref, String uri) {
+ return(m_resourceLoader.getContents(ref, uri));
+ }
+
+ @Override
+ public java.net.URI getResourceURI(ModelReference ref, String uri) {
+ return(m_resourceLoader.getURI(ref, uri));
+ }
+
+ }
}
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/editor/BPELEditorManager.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -96,8 +96,11 @@
*/
@Override
public void enrich(ModelIssue issue) {
- String uri=issue.getModelObject().getSource().getComponentURI();
- issue.getProperties().put("address.model", uri);
+ if (issue != null && issue.getModelObject() != null) {
+ String uri=issue.getModelObject().getSource().getComponentURI();
+
+ issue.getProperties().put("address.model", uri);
+ }
}
}
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/DefaultBPELLanguageModel.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/DefaultBPELLanguageModel.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/DefaultBPELLanguageModel.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -21,6 +21,7 @@
import org.jboss.savara.tools.bpel.model.component.Process;
import org.scribble.conversation.model.Conversation;
import org.scribble.model.*;
+import org.scribble.model.admin.Context;
import org.scribble.model.admin.ModelIssue;
import org.scribble.model.admin.ModelListener;
import org.scribble.model.resolutions.*;
@@ -45,7 +46,7 @@
* @param contents The textual contents
*/
public DefaultBPELLanguageModel(ModelReference source, org.w3c.dom.Element elem,
- String contents) {
+ String contents, Context context) {
m_source = source;
m_contents = contents;
m_bpelProcess = new Process(this, elem);
@@ -55,7 +56,7 @@
setNamespace(ns);
// Initialize the existing model
- Conversation conv=m_bpelProcess.convert();
+ Conversation conv=m_bpelProcess.convert(context);
if (conv != null) {
getConversations().add(conv);
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/AbstractInteraction.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -17,6 +17,8 @@
*/
package org.jboss.savara.tools.bpel.model.component;
+import javax.xml.namespace.QName;
+
import org.scribble.model.TypeReference;
import org.scribble.model.admin.ModelListener;
import org.jboss.savara.tools.bpel.model.*;
@@ -150,8 +152,17 @@
if (type != null) {
int index=-1;
- if ((index=type.indexOf(':')) == -1) {
+
+ if (type.charAt(0) == '{') {
+ // Assume a qname
+ QName qname=QName.valueOf(type);
+
+ ret.setLocalpart(qname.getLocalPart());
+ ret.setNamespace(qname.getNamespaceURI());
+
+ } else if ((index=type.indexOf(':')) == -1) {
ret.setLocalpart(type);
+
} else {
ret.setLocalpart(type.substring(index+1));
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -17,9 +17,18 @@
*/
package org.jboss.savara.tools.bpel.model.component;
+import org.scribble.model.admin.Context;
+
public interface ConversionContext {
/**
+ * This method returns a reference to the environment context.
+ *
+ * @return The environment context
+ */
+ public Context getEnvironmentContext();
+
+ /**
* This method returns the process.
*
* @return The process
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -17,6 +17,8 @@
*/
package org.jboss.savara.tools.bpel.model.component;
+import org.scribble.model.admin.Context;
+
/**
* This class provides a default implementation of the conversation
* context.
@@ -28,13 +30,25 @@
* with the role being played by the converted BPEL process.
*
* @param role The role
+ * @param proc The process
+ * @param envContext The environment context
*/
- public DefaultConversionContext(String role, Process proc) {
+ public DefaultConversionContext(String role, Process proc, Context envContext) {
m_role = role;
m_process = proc;
+ m_environmentContext = envContext;
}
/**
+ * This method returns a reference to the environment context.
+ *
+ * @return The environment context
+ */
+ public Context getEnvironmentContext() {
+ return(m_environmentContext);
+ }
+
+ /**
* This method returns the process.
*
* @return The process
@@ -94,6 +108,7 @@
private String m_role=null;
private Process m_process=null;
+ private Context m_environmentContext=null;
private java.util.Map<String,Variable> m_variables=
new java.util.HashMap<String,Variable>();
}
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -212,7 +212,10 @@
Variable var=context.getVariable(getInputVariable());
- TypeReference tref=createTypeReference(var.getMessageType(), context);
+ String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+ context.getEnvironmentContext());
+
+ TypeReference tref=createTypeReference(xmlType, context);
MessageSignature ms=new MessageSignature();
ms.setOperation(getOperation());
@@ -242,7 +245,10 @@
Variable var=context.getVariable(getOutputVariable());
- TypeReference tref=createTypeReference(var.getMessageType(), context);
+ String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+ context.getEnvironmentContext());
+
+ TypeReference tref=createTypeReference(xmlType, context);
MessageSignature ms=new MessageSignature();
ms.setOperation(getOperation());
@@ -280,7 +286,10 @@
Variable var=context.getVariable(faultVar);
if (var != null) {
- tref = createTypeReference(var.getMessageType(), context);
+ String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+ context.getEnvironmentContext());
+
+ tref = createTypeReference(xmlType, context);
//tref.setLocalpart(var.getMessageType());
} else if (faultMesgType != null) {
tref = createTypeReference(faultMesgType, context);
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -17,10 +17,16 @@
*/
package org.jboss.savara.tools.bpel.model.component;
+import java.util.logging.Level;
+
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
import org.scribble.conversation.model.ConditionalBlock;
import org.scribble.conversation.model.Conversation;
import org.scribble.conversation.model.ConversationNotation;
import org.scribble.model.*;
+import org.scribble.model.admin.Context;
import org.scribble.model.admin.ModelListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -169,9 +175,10 @@
* WSDL message type.
*
* @param wsdlMessageType The WSDL message type
+ * @param context The context
* @return The underlying XML element/type, or null if not found
*/
- public String getXMLType(String wsdlMessageType) {
+ public String getXMLType(String wsdlMessageType, Context context) {
String ret=null;
// Resolve the namespace prefix
@@ -191,13 +198,56 @@
imp.getNamespace().equals(namespace) &&
imp.getLocation() != null &&
imp.getLocation().endsWith(".wsdl")) {
- System.out.println("Check "+imp.getLocation());
+
+ java.net.URI uri=
+ context.getResourceURI(getModel().getModelReference(),
+ imp.getLocation());
+
+ if (uri != null) {
+ ret = getXMLType(imp.getNamespace(), wsdlMessageType, uri);
+
+ if (ret != null) {
+ break;
+ }
+ }
}
}
}
return(ret);
}
+
+ protected String getXMLType(String namespace, String wsdlMessageType, java.net.URI uri) {
+ String ret=null;
+
+ try {
+ WSDLReader reader=javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader();
+
+ javax.wsdl.Definition defn=reader.readWSDL(uri.toString());
+
+ if (defn != null) {
+ javax.wsdl.Message mesg=defn.getMessage(new QName(namespace, wsdlMessageType));
+
+ if (mesg != null && mesg.getParts().size() == 1) {
+ System.out.println("PARTS="+mesg.getParts());
+
+ javax.wsdl.Part part=(javax.wsdl.Part)
+ mesg.getParts().values().iterator().next();
+
+ if (part.getElementName() != null) {
+ ret = part.getElementName().toString();
+ } else if (part.getTypeName() != null) {
+ ret = part.getTypeName().toString();
+ }
+ }
+ }
+
+ } catch(Exception e) {
+ logger.error("Failed to read WSDL", e);
+ }
+
+ return(ret);
+ }
/**
* This method returns the list of partner links.
@@ -827,9 +877,10 @@
* This method returns the conversion associated with the
* BPEL process.
*
+ * @param envContext The environment context
* @return The conversation
*/
- public Conversation convert() {
+ public Conversation convert(Context envContext) {
Conversation ret=new Conversation();
ret.derivedFrom(this);
@@ -897,7 +948,7 @@
}
// Convert the process contents
- DefaultConversionContext context=new DefaultConversionContext(role, this);
+ DefaultConversionContext context=new DefaultConversionContext(role, this, envContext);
// Add variables to the context
for (int i=0; i < m_variables.size(); i++) {
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -129,7 +129,7 @@
* @param context The conversion context
*/
protected void convertActivity(java.util.List<Activity> activities,
- ConversionContext context) {
+ ConversionContext context) {
getSource().setComponentURI(getURI());
ConversationInteraction interaction=new ConversationInteraction();
@@ -137,9 +137,10 @@
Variable var=context.getVariable(getVariable());
- String xmlType=context.getProcess().getXMLType(var.getMessageType());
+ String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+ context.getEnvironmentContext());
- TypeReference tref=createTypeReference(var.getMessageType(), context);
+ TypeReference tref=createTypeReference(xmlType, context);
MessageSignature ms=new MessageSignature();
ms.derivedFrom(this);
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Reply.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -125,7 +125,10 @@
Variable var=context.getVariable(getVariable());
- TypeReference tref=createTypeReference(var.getMessageType(), context);
+ String xmlType=context.getProcess().getXMLType(var.getMessageType(),
+ context.getEnvironmentContext());
+
+ TypeReference tref=createTypeReference(xmlType, context);
MessageSignature ms=new MessageSignature();
ms.derivedFrom(this);
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/parser/BPELModelParserRule.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/parser/BPELModelParserRule.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/parser/BPELModelParserRule.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -96,7 +96,7 @@
// Identify the model associated with the
// changed resource
ret = new DefaultBPELLanguageModel(context.getSource(),
- doc.getDocumentElement(), str);
+ doc.getDocumentElement(), str, context.getEnvironmentContext());
} catch(Exception e) {
logger.log(Level.SEVERE,
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/GeneratorTest.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/GeneratorTest.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/GeneratorTest.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -111,7 +111,7 @@
org.scribble.model.admin.ModelListener l=
new org.scribble.model.admin.DefaultModelListener();
- org.scribble.model.Model model=p.parse(ref, is, l);
+ org.scribble.model.Model model=p.parse(ref, is, l, null);
if (model == null) {
result.addError(this, new Throwable("Model is null"));
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/parser/ParserTest.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/parser/ParserTest.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/parser/ParserTest.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -87,7 +87,7 @@
org.scribble.model.admin.DefaultModelListener l=
new org.scribble.model.admin.DefaultModelListener();
- org.scribble.model.Model model=p.parse(ref, is, l);
+ org.scribble.model.Model model=p.parse(ref, is, l, null);
if (model == null) {
result.addError(this, new Throwable("Model is null"));
Modified: trunk/tools/plugins/org.scribble.conformance/src/plugintest/org/scribble/conformance/model/transform/TransformTest.java
===================================================================
--- trunk/tools/plugins/org.scribble.conformance/src/plugintest/org/scribble/conformance/model/transform/TransformTest.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.scribble.conformance/src/plugintest/org/scribble/conformance/model/transform/TransformTest.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -83,7 +83,7 @@
org.scribble.model.admin.ModelListener l=
new org.scribble.model.admin.DefaultModelListener();
- org.scribble.model.Model model=p.parse(ref, is, l);
+ org.scribble.model.Model model=p.parse(ref, is, l, null);
if (model == null) {
result.addError(this, new Throwable("Model is null"));
Modified: trunk/tools/plugins/org.scribble.conversation.comparator/src/plugintest/org/scribble/conversation/comparator/model/transform/TransformTest.java
===================================================================
--- trunk/tools/plugins/org.scribble.conversation.comparator/src/plugintest/org/scribble/conversation/comparator/model/transform/TransformTest.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.scribble.conversation.comparator/src/plugintest/org/scribble/conversation/comparator/model/transform/TransformTest.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -82,7 +82,7 @@
org.scribble.model.admin.ModelListener l=
new org.scribble.model.admin.DefaultModelListener();
- org.scribble.model.Model model=p.parse(ref, is, l);
+ org.scribble.model.Model model=p.parse(ref, is, l, null);
if (model == null) {
result.addError(this, new Throwable("Model is null"));
Modified: trunk/tools/plugins/org.scribble.core/src/java/org/scribble/model/admin/AbstractModelRepository.java
===================================================================
--- trunk/tools/plugins/org.scribble.core/src/java/org/scribble/model/admin/AbstractModelRepository.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.scribble.core/src/java/org/scribble/model/admin/AbstractModelRepository.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -67,7 +67,7 @@
org.scribble.parser.Parser.class, ref.getNotation());
if (parser != null) {
- ret=parser.parse(ref, is, l);
+ ret=parser.parse(ref, is, l, null);
if (ret != null) {
ret.initializeURIs();
Added: trunk/tools/plugins/org.scribble.core/src/java/org/scribble/model/admin/Context.java
===================================================================
--- trunk/tools/plugins/org.scribble.core/src/java/org/scribble/model/admin/Context.java (rev 0)
+++ trunk/tools/plugins/org.scribble.core/src/java/org/scribble/model/admin/Context.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.scribble.model.admin;
+
+import org.scribble.model.ModelReference;
+
+/**
+ * This interface provides access to the environment in which a tool is
+ * being used.
+ *
+ */
+public interface Context {
+
+ /**
+ * This method can be used to retrieve the contents of a resource which
+ * is located at the specified URI. If the URI is a relative path, then
+ * the supplied model reference can be used to identify the source from
+ * which the path is relative.
+ *
+ * @param ref The model reference for the source file
+ * @param uri The URI of the resource to load
+ * @return The input stream, or null if not found
+ */
+ public java.io.InputStream getResource(ModelReference ref, String uri);
+
+ /**
+ * This method can be used to retrieve the URI of a resource which
+ * is located at the specified URI. If the URI is a relative path, then
+ * the supplied model reference can be used to identify the source from
+ * which the path is relative.
+ *
+ * @param ref The model reference for the source file
+ * @param uri The URI of the resource to load
+ * @return The URI, or null if not found
+ */
+ public java.net.URI getResourceURI(ModelReference ref, String uri);
+
+}
Modified: trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/DefaultParser.java
===================================================================
--- trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/DefaultParser.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/DefaultParser.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -21,6 +21,7 @@
import org.scribble.extensions.RegistryInfo;
import org.scribble.model.*;
+import org.scribble.model.admin.Context;
import org.scribble.model.admin.ModelListener;
/**
@@ -46,17 +47,17 @@
*
*/
public Model parse(ModelReference ref, java.io.InputStream is,
- ModelListener l) {
+ ModelListener l, Context context) {
Model ret=null;
Tokenizer tokenizer=(Tokenizer)
org.scribble.extensions.RegistryFactory.getRegistry().
getExtension(Tokenizer.class, ref.getNotation());
- DefaultParserContext context=
- new DefaultParserContext(ref, is, tokenizer);
+ DefaultParserContext parserContext=
+ new DefaultParserContext(ref, is, tokenizer, context);
- ret = (Model)context.parse(Model.class, l);
+ ret = (Model)parserContext.parse(Model.class, l);
return(ret);
}
Modified: trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/DefaultParserContext.java
===================================================================
--- trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/DefaultParserContext.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/DefaultParserContext.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -23,6 +23,7 @@
import java.util.logging.Logger;
import org.scribble.model.*;
+import org.scribble.model.admin.Context;
import org.scribble.model.admin.ModelIssue;
import org.scribble.model.admin.ModelListener;
import org.scribble.util.Scope;
@@ -39,10 +40,12 @@
* @param ref The model reference
* @param is The input stream
* @param tokenizer The optional tokenizer to use
+ * @param context The environment context
*/
public DefaultParserContext(ModelReference ref, java.io.InputStream is,
- Tokenizer tokenizer) {
+ Tokenizer tokenizer, Context context) {
m_modelReference = ref;
+ m_environmentContext = context;
initializeScope(m_scope);
@@ -85,6 +88,15 @@
}
/**
+ * This method provides the environment's context.
+ *
+ * @return The environment context
+ */
+ public Context getEnvironmentContext() {
+ return(m_environmentContext);
+ }
+
+ /**
* This method returns the source model reference associated
* with the definition being parsed.
*
@@ -93,6 +105,19 @@
public ModelReference getSource() {
return(m_modelReference);
}
+
+ /**
+ * This method retrieves the contents of the resource at the
+ * specified URI. If the URI is relative, then the path will
+ * be considered relative to the resource associated with
+ * the source model reference.
+ *
+ * @param uri The URI
+ * @return The input stream, or null if not found
+ */
+ public java.io.InputStream getResource(String uri) {
+ return(m_environmentContext.getResource(getSource(), uri));
+ }
/**
* This method returns the located role associated with the
@@ -415,6 +440,7 @@
private static final String UNRESOLVED_REFERENCES="UnresolvedReferences";
private ModelReference m_modelReference=null;
+ private Context m_environmentContext=null;
private int m_position=0;
private java.util.List<Token> m_tokens=null;
private boolean m_errorReported=false;
Modified: trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/Parser.java
===================================================================
--- trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/Parser.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/Parser.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -20,6 +20,7 @@
package org.scribble.parser;
import org.scribble.model.*;
+import org.scribble.model.admin.Context;
import org.scribble.model.admin.ModelListener;
public interface Parser {
@@ -33,9 +34,10 @@
* @param ref The scribble source reference
* @param is The input stream
* @param l The model listener
+ * @param context The environment context
* @return The model, or null if not found
*/
public Model parse(ModelReference ref, java.io.InputStream is,
- ModelListener l);
+ ModelListener l, Context context);
}
Modified: trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/ParserContext.java
===================================================================
--- trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/ParserContext.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.scribble.core/src/java/org/scribble/parser/ParserContext.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -20,6 +20,7 @@
package org.scribble.parser;
import org.scribble.model.*;
+import org.scribble.model.admin.Context;
import org.scribble.model.admin.ModelListener;
/**
@@ -29,6 +30,13 @@
public interface ParserContext {
/**
+ * This method provides the environment's context.
+ *
+ * @return The environment context
+ */
+ public Context getEnvironmentContext();
+
+ /**
* This method returns the source model reference associated
* with the definition being parsed.
*
Modified: trunk/tools/plugins/org.scribble.core/src/test/org/scribble/parser/DefaultParserContextTest.java
===================================================================
--- trunk/tools/plugins/org.scribble.core/src/test/org/scribble/parser/DefaultParserContextTest.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.scribble.core/src/test/org/scribble/parser/DefaultParserContextTest.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -49,7 +49,7 @@
ModelReference ref=new ModelReference("");
DefaultParserContext context=new DefaultParserContext(ref,
new java.io.ByteArrayInputStream(text.getBytes()),
- new DefaultTokenizer());
+ new DefaultTokenizer(), null);
// Should be 2 tokens, as comment is filtered out
if (context.getTokenCount() != 2) {
@@ -65,7 +65,7 @@
ModelReference ref=new ModelReference("");
DefaultParserContext context=new DefaultParserContext(ref,
new java.io.ByteArrayInputStream(text.getBytes()),
- new DefaultTokenizer());
+ new DefaultTokenizer(), null);
// Should be 2 tokens, as comment is filtered out
if (context.getTokenCount() != 2) {
@@ -82,7 +82,7 @@
ModelReference ref=new ModelReference("");
DefaultParserContext context=new DefaultParserContext(ref,
new java.io.ByteArrayInputStream(text.getBytes()),
- new DefaultTokenizer());
+ new DefaultTokenizer(), null);
if (context.getTokenCount() != 3) {
fail("Expecting 3 tokens, but got: "+context.getTokenCount());
@@ -100,7 +100,7 @@
ModelReference ref=new ModelReference("");
DefaultParserContext context=new DefaultParserContext(ref,
new java.io.ByteArrayInputStream(text.getBytes()),
- new DefaultTokenizer());
+ new DefaultTokenizer(), null);
// Should be 3 tokens
if (context.getTokenCount() != 3) {
@@ -125,7 +125,7 @@
ModelReference ref=new ModelReference("");
DefaultParserContext context=new DefaultParserContext(ref,
new java.io.ByteArrayInputStream(text.getBytes()),
- new DefaultTokenizer());
+ new DefaultTokenizer(), null);
// Should be 2 tokens
if (context.getTokenCount() != 2) {
Modified: trunk/tools/plugins/org.scribble.core/src/test/org/scribble/parser/TestParserContext.java
===================================================================
--- trunk/tools/plugins/org.scribble.core/src/test/org/scribble/parser/TestParserContext.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.scribble.core/src/test/org/scribble/parser/TestParserContext.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -24,6 +24,6 @@
public TestParserContext(org.scribble.model.ModelReference ref,
String text) {
super(ref, new java.io.ByteArrayInputStream(text.getBytes()),
- new DefaultTokenizer());
+ new DefaultTokenizer(), null);
}
}
Modified: trunk/tools/plugins/org.scribble.eclipse/src/java/org/scribble/eclipse/model/admin/OSGIModelListener.java
===================================================================
--- trunk/tools/plugins/org.scribble.eclipse/src/java/org/scribble/eclipse/model/admin/OSGIModelListener.java 2010-09-15 14:24:47 UTC (rev 400)
+++ trunk/tools/plugins/org.scribble.eclipse/src/java/org/scribble/eclipse/model/admin/OSGIModelListener.java 2010-09-16 16:05:34 UTC (rev 401)
@@ -174,8 +174,10 @@
marker.setAttribute(IMarker.CHAR_END, endPos);
}
- marker.setAttribute(SOURCE_MODEL_OBJECT_URI, src.getSource().getModelObjectURI());
- marker.setAttribute(SOURCE_COMPONENT_URI, src.getSource().getComponentURI());
+ if (src != null && src.getSource() != null) {
+ marker.setAttribute(SOURCE_MODEL_OBJECT_URI, src.getSource().getModelObjectURI());
+ marker.setAttribute(SOURCE_COMPONENT_URI, src.getSource().getComponentURI());
+ }
if (m_reference != null) {
marker.setAttribute(MODEL_NAMESPACE, m_reference.getNamespace());
@@ -273,11 +275,11 @@
}
public int getStartPosition() {
- return(m_issue.getModelObject().getSource().getStartPosition());
+ return(m_issue.getModelObject() == null ? -1 : m_issue.getModelObject().getSource().getStartPosition());
}
public int getEndPosition() {
- return(m_issue.getModelObject().getSource().getEndPosition());
+ return(m_issue.getModelObject() == null ? -1 : m_issue.getModelObject().getSource().getEndPosition());
}
public String getMessage() {
13 years, 7 months
savara SVN: r398 - in trunk/tools/plugins: org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin and 3 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-15 10:17:45 -0400 (Wed, 15 Sep 2010)
New Revision: 398
Modified:
trunk/tools/plugins/org.jboss.savara.tap.model/META-INF/MANIFEST.MF
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java
Log:
Create specific model listener per resource, based on the underlying platform, so validation errors associated with the correct file.
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/META-INF/MANIFEST.MF 2010-09-14 16:36:26 UTC (rev 397)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/META-INF/MANIFEST.MF 2010-09-15 14:17:45 UTC (rev 398)
@@ -9,3 +9,4 @@
Import-Package: org.osgi.framework;version="1.3.0"
Export-Package: org.jboss.savara.tap.model,
org.jboss.savara.tap.model.admin
+Require-Bundle: org.scribble.core;bundle-version="[1.1.0,2.0.0)"
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java 2010-09-14 16:36:26 UTC (rev 397)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java 2010-09-15 14:17:45 UTC (rev 398)
@@ -22,6 +22,7 @@
package org.jboss.savara.tap.model.admin;
import org.jboss.savara.tap.model.Resource;
+import org.scribble.model.admin.ModelListener;
public interface ResourceLoader {
@@ -43,4 +44,20 @@
*/
public java.io.InputStream getContents(Resource resource);
+ /**
+ * This method returns a model listener associated with the supplied resource.
+ *
+ * @param res The resource
+ * @return The model listener associated with the resource
+ */
+ public ModelListener getResourceModelListener(Resource res);
+
+ /**
+ * This method frees a model listener associated with the supplied resource.
+ *
+ * @param res The resource
+ * @param l The model listener associated with the resource
+ */
+ public void freeResourceModelListener(Resource res, ModelListener l);
+
}
Modified: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java 2010-09-14 16:36:26 UTC (rev 397)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java 2010-09-15 14:17:45 UTC (rev 398)
@@ -31,6 +31,8 @@
import org.jboss.savara.tap.model.Resource;
import org.jboss.savara.tap.model.URI;
import org.jboss.savara.tap.model.admin.ResourceLoader;
+import org.scribble.eclipse.model.admin.OSGIModelListener;
+import org.scribble.model.admin.ModelListener;
/**
* This class providers the Eclipse resource loader implementation.
@@ -68,9 +70,32 @@
* @return The contents, or null if not found
*/
public InputStream getContents(Resource resource) {
+ java.io.InputStream ret=null;
+ IFile res=getFile(resource);
+
+ if (res != null) {
+ try {
+ ret = res.getContents();
+ } catch(Exception e) {
+ logger.log(Level.SEVERE,
+ "Failed to get contents for resource '"+res+"'", e);
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method retrieves the contents associated with the
+ * supplied resource.
+ *
+ * @param resource The resource
+ * @return The contents, or null if not found
+ */
+ protected IFile getFile(Resource resource) {
String projectName=null;
String location=null;
- java.io.InputStream ret=null;
+ IFile ret=null;
for (URI uri : resource.getUri()) {
if (uri.getType().equalsIgnoreCase("eclipse")) {
@@ -90,18 +115,11 @@
} else if (location == null) {
logger.severe("Eclipse locator has not been defined for resource: "+resource.getId());
} else {
- IFile res=project.getFile(new Path(location));
+ ret = project.getFile(new Path(location));
- if (res == null) {
+ if (ret == null) {
logger.severe("Eclipse locator '"+location+"' for project '"+projectName+
"' does not exist for resource: "+resource.getId());
- } else {
- try {
- ret = res.getContents();
- } catch(Exception e) {
- logger.log(Level.SEVERE,
- "Failed to get contents for resource '"+res+"'", e);
- }
}
}
} else {
@@ -112,4 +130,35 @@
return(ret);
}
+ /**
+ * This method returns a model listener associated with the supplied resource.
+ *
+ * @param res The resource
+ * @return The model listener associated with the resource
+ */
+ public ModelListener getResourceModelListener(Resource res) {
+ IFile file=getFile(res);
+ ModelListener ret=null;
+
+ if (file != null) {
+ ret = new OSGIModelListener(file);
+ } else {
+ logger.severe("Failed to get model listener for resource '"+res+"'");
+
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method frees a model listener associated with the supplied resource.
+ *
+ * @param res The resource
+ * @param l The model listener associated with the resource
+ */
+ public void freeResourceModelListener(Resource res, ModelListener l) {
+ if (l instanceof OSGIModelListener) {
+ ((OSGIModelListener)l).finished();
+ }
+ }
}
Modified: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java 2010-09-14 16:36:26 UTC (rev 397)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java 2010-09-15 14:17:45 UTC (rev 398)
@@ -113,6 +113,7 @@
// Load and validate the individual resources
for (Phase phase : project.getPhase()) {
for (Resource resource : phase.getResource()) {
+ ModelListener rl=getResourceModelListener(resource);
// Validate resource
for (ResourceValidator rv : m_resourceValidators) {
@@ -121,7 +122,7 @@
java.io.InputStream is=getResourceContents(resource);
if (is != null) {
- rv.validate(resource, is, l);
+ rv.validate(resource, is, rl);
try {
is.close();
@@ -148,7 +149,7 @@
java.io.InputStream fromIS=getResourceContents(resource);
java.io.InputStream toIS=getResourceContents(toResource);
- rv.validate(rel, resource, fromIS, toResource, toIS, l);
+ rv.validate(rel, resource, fromIS, toResource, toIS, rl);
break;
}
@@ -158,6 +159,8 @@
"' not found for resource '"+resource.getId()+"'");
}
}
+
+ freeResourceModelListener(resource, rl);
}
}
}
@@ -182,4 +185,30 @@
return(ret);
}
+
+ protected ModelListener getResourceModelListener(Resource resource) {
+ ModelListener ret=null;
+
+ for (ResourceLoader rl : m_resourceLoaders) {
+ if (rl.isSupported(resource)) {
+ ret = rl.getResourceModelListener(resource);
+
+ if (ret != null) {
+ break;
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ protected void freeResourceModelListener(Resource resource, ModelListener l) {
+
+ for (ResourceLoader rl : m_resourceLoaders) {
+ if (rl.isSupported(resource)) {
+ rl.freeResourceModelListener(resource, l);
+ break;
+ }
+ }
+ }
}
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java 2010-09-14 16:36:26 UTC (rev 397)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/BPELElement.java 2010-09-15 14:17:45 UTC (rev 398)
@@ -130,6 +130,27 @@
}
/**
+ * This method returns the BPEL process in which the BPEL element
+ * is contained.
+ *
+ * @return The BPEL process, or null if not found
+ */
+ protected Process getProcess() {
+ Process ret=null;
+ ModelObject cur=this;
+
+ while (ret == null && cur != null) {
+ if (cur instanceof Process) {
+ ret = (Process)cur;
+ } else {
+ cur = cur.getParent();
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
* This method returns the element associated with
* the supplied name.
*
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java 2010-09-14 16:36:26 UTC (rev 397)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java 2010-09-15 14:17:45 UTC (rev 398)
@@ -20,6 +20,13 @@
public interface ConversionContext {
/**
+ * This method returns the process.
+ *
+ * @return The process
+ */
+ public Process getProcess();
+
+ /**
* This method returns the role associated with the
* endpoint being converted.
*
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java 2010-09-14 16:36:26 UTC (rev 397)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java 2010-09-15 14:17:45 UTC (rev 398)
@@ -35,6 +35,15 @@
}
/**
+ * This method returns the process.
+ *
+ * @return The process
+ */
+ public Process getProcess() {
+ return(m_process);
+ }
+
+ /**
* This method returns the role associated with the
* endpoint being converted.
*
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-09-14 16:36:26 UTC (rev 397)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java 2010-09-15 14:17:45 UTC (rev 398)
@@ -54,6 +54,11 @@
org.w3c.dom.Element activity) {
super(model, activity);
+ java.util.List<BPELElement> imports=findChildElements(Import.class);
+ for (BPELElement elem : imports) {
+ m_imports.add((Import)elem);
+ }
+
m_partnerLinksElem = findChildElement("partnerLinks");
if (m_partnerLinksElem != null) {
@@ -159,6 +164,42 @@
}
/**
+ * This method searches the defined WSDL definitions to identify
+ * the underlying XML element/type associated with the supplied
+ * WSDL message type.
+ *
+ * @param wsdlMessageType The WSDL message type
+ * @return The underlying XML element/type, or null if not found
+ */
+ public String getXMLType(String wsdlMessageType) {
+ String ret=null;
+
+ // Resolve the namespace prefix
+ int index=wsdlMessageType.indexOf(':');
+
+ if (index != -1) {
+ String prefix=wsdlMessageType.substring(0, index);
+
+ String namespace=getNamespace(prefix);
+
+ wsdlMessageType = wsdlMessageType.substring(index+1);
+
+ for (Import imp : getImports()) {
+
+ // Check if import relates to the correct namespace
+ if (imp.getNamespace() != null &&
+ imp.getNamespace().equals(namespace) &&
+ imp.getLocation() != null &&
+ imp.getLocation().endsWith(".wsdl")) {
+ System.out.println("Check "+imp.getLocation());
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
* This method returns the list of partner links.
*
* @return The partner links
Modified: trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java 2010-09-14 16:36:26 UTC (rev 397)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Receive.java 2010-09-15 14:17:45 UTC (rev 398)
@@ -137,6 +137,8 @@
Variable var=context.getVariable(getVariable());
+ String xmlType=context.getProcess().getXMLType(var.getMessageType());
+
TypeReference tref=createTypeReference(var.getMessageType(), context);
MessageSignature ms=new MessageSignature();
13 years, 7 months
savara SVN: r397 - trunk/tools/plugins/org.jboss.savara.tap.validation.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-14 12:36:26 -0400 (Tue, 14 Sep 2010)
New Revision: 397
Modified:
trunk/tools/plugins/org.jboss.savara.tap.validation/
Log:
Ignore bin.
Property changes on: trunk/tools/plugins/org.jboss.savara.tap.validation
___________________________________________________________________
Name: svn:ignore
+ bin
.settings
13 years, 7 months
savara SVN: r396 - in trunk/tools/plugins: org.jboss.savara.tap.model/META-INF and 20 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-14 12:35:12 -0400 (Tue, 14 Sep 2010)
New Revision: 396
Added:
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/TAPModelUtil.java
trunk/tools/plugins/org.jboss.savara.tap.validation/
trunk/tools/plugins/org.jboss.savara.tap.validation/.classpath
trunk/tools/plugins/org.jboss.savara.tap.validation/.project
trunk/tools/plugins/org.jboss.savara.tap.validation/Copyright.txt
trunk/tools/plugins/org.jboss.savara.tap.validation/META-INF/
trunk/tools/plugins/org.jboss.savara.tap.validation/META-INF/MANIFEST.MF
trunk/tools/plugins/org.jboss.savara.tap.validation/OSGI-INF/
trunk/tools/plugins/org.jboss.savara.tap.validation/OSGI-INF/bpel-relationship-validator.xml
trunk/tools/plugins/org.jboss.savara.tap.validation/OSGI-INF/eclipse-resource-loader.xml
trunk/tools/plugins/org.jboss.savara.tap.validation/build.properties
trunk/tools/plugins/org.jboss.savara.tap.validation/plugin.xml
trunk/tools/plugins/org.jboss.savara.tap.validation/pom.xml
trunk/tools/plugins/org.jboss.savara.tap.validation/src/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/RelationshipValidator.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ResourceValidator.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/action/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/action/ValidateAction.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/osgi/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/osgi/Activator.java
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ws/
trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ws/BPELRelationshipValidator.java
Modified:
trunk/tools/plugins/org.jboss.savara.tap.model/META-INF/MANIFEST.MF
trunk/tools/plugins/org.jboss.savara.tap.model/schema/tap.xsd
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Link.java
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/ObjectFactory.java
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Phase.java
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Project.java
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Relationship.java
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Resource.java
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Root.java
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/URI.java
trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/package-info.java
trunk/tools/plugins/org.scribble.eclipse/src/java/org/scribble/eclipse/model/admin/OSGIModelListener.java
Log:
SAVARA-78 - added TAP schema and object model.
SAVARA-80/87 - simple validation framework for the TAP file - may need some enhancements to become more flexible, especially when using new scribble and also being used outside of Eclipse.
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/META-INF/MANIFEST.MF 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/META-INF/MANIFEST.MF 2010-09-14 16:35:12 UTC (rev 396)
@@ -7,3 +7,5 @@
Bundle-Vendor: www.savara.org
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.osgi.framework;version="1.3.0"
+Export-Package: org.jboss.savara.tap.model,
+ org.jboss.savara.tap.model.admin
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/schema/tap.xsd
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/schema/tap.xsd 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/schema/tap.xsd 2010-09-14 16:35:12 UTC (rev 396)
@@ -10,8 +10,8 @@
maxOccurs="unbounded" minOccurs="0">
</element>
</sequence>
- <attribute name="name" type="string"></attribute>
- <attribute name="version" type="string"></attribute>
+ <attribute name="name" type="string" use="required"></attribute>
+ <attribute name="version" type="string" use="required"></attribute>
</extension>
</complexContent>
</complexType>
@@ -22,7 +22,7 @@
<sequence>
<element name="resource" type="tns:Resource" maxOccurs="unbounded" minOccurs="0"></element>
</sequence>
- <attribute name="name" type="string"></attribute>
+ <attribute name="name" type="string" use="required"></attribute>
</extension>
</complexContent>
@@ -37,7 +37,7 @@
</element>
<element name="relationship" type="tns:Relationship" maxOccurs="unbounded" minOccurs="0"></element>
</sequence>
- <attribute name="id" type="ID"></attribute>
+ <attribute name="id" type="ID" use="required"></attribute>
</extension>
</complexContent>
</complexType>
@@ -50,8 +50,8 @@
maxOccurs="unbounded" minOccurs="0">
</element>
</sequence>
- <attribute name="ref" type="IDREF"></attribute>
- <attribute name="type" type="string"></attribute>
+ <attribute name="ref" type="IDREF" use="required"></attribute>
+ <attribute name="type" type="string" use="required"></attribute>
</extension>
</complexContent>
</complexType>
@@ -59,11 +59,11 @@
<complexType name="Link">
<complexContent>
<extension base="tns:Root">
- <attribute name="fromModelName" type="string"></attribute>
+ <attribute name="from" type="string"></attribute>
- <attribute name="toModelName" type="string"></attribute>
+ <attribute name="to" type="string"></attribute>
- <attribute name="modelType" type="string"></attribute>
+ <attribute name="type" type="string" use="required"></attribute>
</extension>
</complexContent>
@@ -84,9 +84,9 @@
<complexType name="URI">
<complexContent>
<extension base="tns:Root">
- <attribute name="type" type="string"></attribute>
- <attribute name="context" type="string"></attribute>
- <attribute name="locator" type="string"></attribute>
+ <attribute name="type" type="string" use="required"></attribute>
+ <attribute name="context" type="string" use="required"></attribute>
+ <attribute name="locator" type="string" use="required"></attribute>
</extension>
</complexContent>
</complexType>
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Link.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Link.java 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Link.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.08.24 at 03:42:04 PM BST
+// Generated on: 2010.09.14 at 02:07:43 PM BST
//
@@ -23,9 +23,9 @@
* <complexType name="Link">
* <complexContent>
* <extension base="{http://www.savara.org/ta/project}Root">
- * <attribute name="fromModelName" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="toModelName" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="modelType" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="from" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="to" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <anyAttribute processContents='lax' namespace='##other'/>
* </extension>
* </complexContent>
@@ -41,82 +41,82 @@
{
@XmlAttribute
- protected String fromModelName;
+ protected String from;
@XmlAttribute
- protected String toModelName;
- @XmlAttribute
- protected String modelType;
+ protected String to;
+ @XmlAttribute(required = true)
+ protected String type;
/**
- * Gets the value of the fromModelName property.
+ * Gets the value of the from property.
*
* @return
* possible object is
* {@link String }
*
*/
- public String getFromModelName() {
- return fromModelName;
+ public String getFrom() {
+ return from;
}
/**
- * Sets the value of the fromModelName property.
+ * Sets the value of the from property.
*
* @param value
* allowed object is
* {@link String }
*
*/
- public void setFromModelName(String value) {
- this.fromModelName = value;
+ public void setFrom(String value) {
+ this.from = value;
}
/**
- * Gets the value of the toModelName property.
+ * Gets the value of the to property.
*
* @return
* possible object is
* {@link String }
*
*/
- public String getToModelName() {
- return toModelName;
+ public String getTo() {
+ return to;
}
/**
- * Sets the value of the toModelName property.
+ * Sets the value of the to property.
*
* @param value
* allowed object is
* {@link String }
*
*/
- public void setToModelName(String value) {
- this.toModelName = value;
+ public void setTo(String value) {
+ this.to = value;
}
/**
- * Gets the value of the modelType property.
+ * Gets the value of the type property.
*
* @return
* possible object is
* {@link String }
*
*/
- public String getModelType() {
- return modelType;
+ public String getType() {
+ return type;
}
/**
- * Sets the value of the modelType property.
+ * Sets the value of the type property.
*
* @param value
* allowed object is
* {@link String }
*
*/
- public void setModelType(String value) {
- this.modelType = value;
+ public void setType(String value) {
+ this.type = value;
}
}
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/ObjectFactory.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/ObjectFactory.java 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/ObjectFactory.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.08.24 at 03:42:04 PM BST
+// Generated on: 2010.09.14 at 02:07:43 PM BST
//
@@ -41,19 +41,19 @@
}
/**
- * Create an instance of {@link Relationship }
+ * Create an instance of {@link Resource }
*
*/
- public Relationship createRelationship() {
- return new Relationship();
+ public Resource createResource() {
+ return new Resource();
}
/**
- * Create an instance of {@link Root }
+ * Create an instance of {@link Phase }
*
*/
- public Root createRoot() {
- return new Root();
+ public Phase createPhase() {
+ return new Phase();
}
/**
@@ -65,27 +65,27 @@
}
/**
- * Create an instance of {@link Resource }
+ * Create an instance of {@link Link }
*
*/
- public Resource createResource() {
- return new Resource();
+ public Link createLink() {
+ return new Link();
}
/**
- * Create an instance of {@link Phase }
+ * Create an instance of {@link Root }
*
*/
- public Phase createPhase() {
- return new Phase();
+ public Root createRoot() {
+ return new Root();
}
/**
- * Create an instance of {@link Link }
+ * Create an instance of {@link Relationship }
*
*/
- public Link createLink() {
- return new Link();
+ public Relationship createRelationship() {
+ return new Relationship();
}
/**
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Phase.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Phase.java 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Phase.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.08.24 at 03:42:04 PM BST
+// Generated on: 2010.09.14 at 02:07:43 PM BST
//
@@ -28,7 +28,7 @@
* <sequence>
* <element name="resource" type="{http://www.savara.org/ta/project}Resource" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
- * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <anyAttribute processContents='lax' namespace='##other'/>
* </extension>
* </complexContent>
@@ -46,7 +46,7 @@
{
protected List<Resource> resource;
- @XmlAttribute
+ @XmlAttribute(required = true)
protected String name;
/**
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Project.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Project.java 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Project.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.08.24 at 03:42:04 PM BST
+// Generated on: 2010.09.14 at 02:07:43 PM BST
//
@@ -28,8 +28,8 @@
* <sequence>
* <element name="phase" type="{http://www.savara.org/ta/project}Phase" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
- * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <anyAttribute processContents='lax' namespace='##other'/>
* </extension>
* </complexContent>
@@ -47,9 +47,9 @@
{
protected List<Phase> phase;
- @XmlAttribute
+ @XmlAttribute(required = true)
protected String name;
- @XmlAttribute
+ @XmlAttribute(required = true)
protected String version;
/**
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Relationship.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Relationship.java 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Relationship.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.08.24 at 03:42:04 PM BST
+// Generated on: 2010.09.14 at 02:07:43 PM BST
//
@@ -30,8 +30,8 @@
* <sequence>
* <element name="link" type="{http://www.savara.org/ta/project}Link" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
- * <attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
- * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
+ * <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <anyAttribute processContents='lax' namespace='##other'/>
* </extension>
* </complexContent>
@@ -49,11 +49,11 @@
{
protected List<Link> link;
- @XmlAttribute
+ @XmlAttribute(required = true)
@XmlIDREF
@XmlSchemaType(name = "IDREF")
protected Object ref;
- @XmlAttribute
+ @XmlAttribute(required = true)
protected String type;
/**
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Resource.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Resource.java 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Resource.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.08.24 at 03:42:04 PM BST
+// Generated on: 2010.09.14 at 02:07:43 PM BST
//
@@ -33,7 +33,7 @@
* <element name="uri" type="{http://www.savara.org/ta/project}URI" maxOccurs="unbounded" minOccurs="0"/>
* <element name="relationship" type="{http://www.savara.org/ta/project}Relationship" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
- * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
* <anyAttribute processContents='lax' namespace='##other'/>
* </extension>
* </complexContent>
@@ -53,7 +53,7 @@
protected List<URI> uri;
protected List<Relationship> relationship;
- @XmlAttribute
+ @XmlAttribute(required = true)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Root.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Root.java 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/Root.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.08.24 at 03:42:04 PM BST
+// Generated on: 2010.09.14 at 02:07:43 PM BST
//
@@ -106,8 +106,8 @@
*
* <p>
* Objects of the following type(s) are allowed in the list
+ * {@link Object }
* {@link Element }
- * {@link Object }
*
*
*/
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/URI.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/URI.java 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/URI.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.08.24 at 03:42:04 PM BST
+// Generated on: 2010.09.14 at 02:07:43 PM BST
//
@@ -23,9 +23,9 @@
* <complexType name="URI">
* <complexContent>
* <extension base="{http://www.savara.org/ta/project}Root">
- * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="context" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="locator" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="context" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="locator" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <anyAttribute processContents='lax' namespace='##other'/>
* </extension>
* </complexContent>
@@ -40,11 +40,11 @@
extends Root
{
- @XmlAttribute
+ @XmlAttribute(required = true)
protected String type;
- @XmlAttribute
+ @XmlAttribute(required = true)
protected String context;
- @XmlAttribute
+ @XmlAttribute(required = true)
protected String locator;
/**
Added: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/ResourceLoader.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.tap.model.admin;
+
+import org.jboss.savara.tap.model.Resource;
+
+public interface ResourceLoader {
+
+ /**
+ * This method determines whether the resource loader can
+ * retrieve the contents associated with the supplied resource.
+ *
+ * @param resource The resource
+ * @return Whether the contents can be retrieved
+ */
+ public boolean isSupported(Resource resource);
+
+ /**
+ * This method retrieves the contents associated with the
+ * supplied resource.
+ *
+ * @param resource The resource
+ * @return The contents, or null if not found
+ */
+ public java.io.InputStream getContents(Resource resource);
+
+}
Added: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/TAPModelUtil.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/TAPModelUtil.java (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/admin/TAPModelUtil.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.tap.model.admin;
+
+import java.io.IOException;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.jboss.savara.tap.model.ObjectFactory;
+import org.jboss.savara.tap.model.Project;
+
+/**
+ * This class contains utility methods associated with the Testable Architecture Project (TAP)
+ * model.
+ *
+ */
+public class TAPModelUtil {
+
+ /**
+ * This method deserializes a TAP project model from an XML document provided in
+ * the supplied input stream.
+ *
+ * @param is The input stream containing the XML document
+ * @return The TAP project
+ * @throws IOException Failed to deserialize the project
+ */
+ public static Project deserialize(java.io.InputStream is) throws IOException {
+ Project ret=null;
+
+ try {
+ JAXBContext context = JAXBContext.newInstance("org.jboss.savara.tap.model");
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+
+ //note: setting schema to null will turn validator off
+ //unmarshaller.setSchema(null);
+ Object xmlObject = unmarshaller.unmarshal(is);
+
+ if (xmlObject instanceof JAXBElement) {
+ ret = (Project)((JAXBElement<?>)xmlObject).getValue();
+ }
+
+ } catch(Exception e) {
+ throw new IOException("Failed to deserialize 'testable architecture project'", e);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method serializes a TAP project model into an XML representation, stored
+ * in the supplied output stream.
+ *
+ * @param project The project to be serialized
+ * @param os The output stream on which to record the serialized project
+ * @throws IOException Failed to serialize the project
+ */
+ public static void serialize(Project project, java.io.OutputStream os) throws IOException {
+
+ try {
+ org.jboss.savara.tap.model.ObjectFactory factory=
+ new org.jboss.savara.tap.model.ObjectFactory();
+
+ JAXBContext context = JAXBContext.newInstance(Project.class);
+ Marshaller marshaller = context.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+
+ marshaller.marshal(factory.createProject(project), os);
+ } catch(Exception e) {
+ throw new IOException("Failed to serialize 'testable architecture project'", e);
+ }
+ }
+}
Modified: trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/package-info.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/package-info.java 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.jboss.savara.tap.model/src/java/org/jboss/savara/tap/model/package-info.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.08.24 at 03:42:04 PM BST
+// Generated on: 2010.09.14 at 02:07:43 PM BST
//
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.savara.org/ta/project", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/.classpath
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/.classpath (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/.classpath 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/.project
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/.project (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/.project 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.savara.tap.validation</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/Copyright.txt
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/Copyright.txt (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/Copyright.txt 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,17 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/META-INF/MANIFEST.MF (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/META-INF/MANIFEST.MF 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SAVARA TAP Validation
+Bundle-SymbolicName: org.jboss.savara.tap.validation;singleton:=true
+Bundle-Version: 1.1.0.qualifier
+Bundle-Activator: org.jboss.savara.tap.validation.osgi.Activator
+Bundle-Vendor: www.savara.org
+Service-Component: OSGI-INF/eclipse-resource-loader.xml,
+ OSGI-INF/bpel-relationship-validator.xml
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.jboss.savara.tap.model,
+ org.scribble.core;bundle-version="[1.1.0,2.0.0)",
+ org.scribble.eclipse;bundle-version="[1.1.0,2.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/OSGI-INF/bpel-relationship-validator.xml
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/OSGI-INF/bpel-relationship-validator.xml (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/OSGI-INF/bpel-relationship-validator.xml 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<component name="bpel-relationship-validator">
+ <implementation class="org.jboss.savara.tap.validation.ws.BPELRelationshipValidator"/>
+ <service>
+ <provide interface="org.jboss.savara.tap.validation.RelationshipValidator"/>
+ </service>
+</component>
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/OSGI-INF/eclipse-resource-loader.xml
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/OSGI-INF/eclipse-resource-loader.xml (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/OSGI-INF/eclipse-resource-loader.xml 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<component name="savara-tap-resource-loader">
+ <implementation class="org.jboss.savara.tap.model.admin.eclipse.EclipseResourceLoader"/>
+ <service>
+ <provide interface="org.jboss.savara.tap.model.admin.ResourceLoader"/>
+ </service>
+</component>
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/build.properties
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/build.properties (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/build.properties 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,4 @@
+source.. = src/java/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/plugin.xml
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/plugin.xml (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/plugin.xml 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ id="org.jboss.savara.tap.validation.contribution1"
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.tap">
+ <menu
+ id="org.jboss.savara.tools.menu"
+ label="Savara"
+ path="additions">
+ <separator name="group1"/>
+ </menu>
+ <action
+ label="Validate"
+ class="org.jboss.savara.tap.validation.action.ValidateAction"
+ menubarPath="org.jboss.savara.tools.menu/group1"
+ enablesFor="1"
+ id="org.jboss.savara.tap.validation.ValidateAction">
+ </action>
+ </objectContribution>
+ </extension>
+
+</plugin>
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/pom.xml
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/pom.xml (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/pom.xml 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.savara.tools</groupId>
+ <artifactId>org.jboss.savara.tap.validation</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <name>Savara::Tools::Plugins::ToolsTAPValidation</name>
+
+ <parent>
+ <groupId>org.jboss.savara.tools</groupId>
+ <artifactId>plugins</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.savara.tools</groupId>
+ <artifactId>org.jboss.savara.tap.validation</artifactId>
+ <version>${savara.version}</version>
+ </dependency>
+ </dependencies>
+</project>
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/model/admin/eclipse/EclipseResourceLoader.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.tap.model.admin.eclipse;
+
+import java.io.InputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Path;
+import org.jboss.savara.tap.model.Resource;
+import org.jboss.savara.tap.model.URI;
+import org.jboss.savara.tap.model.admin.ResourceLoader;
+
+/**
+ * This class providers the Eclipse resource loader implementation.
+ *
+ */
+public class EclipseResourceLoader implements ResourceLoader {
+
+ private static Logger logger = Logger.getLogger(EclipseResourceLoader.class.getName());
+
+ /**
+ * This method determines whether the resource loader can
+ * retrieve the contents associated with the supplied resource.
+ *
+ * @param resource The resource
+ * @return Whether the contents can be retrieved
+ */
+ public boolean isSupported(Resource resource) {
+ boolean ret=false;
+
+ for (URI uri : resource.getUri()) {
+ if (uri.getType().equalsIgnoreCase("eclipse")) {
+ ret = true;
+ break;
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method retrieves the contents associated with the
+ * supplied resource.
+ *
+ * @param resource The resource
+ * @return The contents, or null if not found
+ */
+ public InputStream getContents(Resource resource) {
+ String projectName=null;
+ String location=null;
+ java.io.InputStream ret=null;
+
+ for (URI uri : resource.getUri()) {
+ if (uri.getType().equalsIgnoreCase("eclipse")) {
+ projectName = uri.getContext();
+ location = uri.getLocator();
+ break;
+ }
+ }
+
+ if (projectName != null) {
+ IProject project=org.eclipse.core.resources.ResourcesPlugin.getWorkspace().
+ getRoot().getProject(projectName);
+
+ if (project == null) {
+ logger.severe("Eclipse context (project) '"+projectName+
+ "' does not exist for resource: "+resource.getId());
+ } else if (location == null) {
+ logger.severe("Eclipse locator has not been defined for resource: "+resource.getId());
+ } else {
+ IFile res=project.getFile(new Path(location));
+
+ if (res == null) {
+ logger.severe("Eclipse locator '"+location+"' for project '"+projectName+
+ "' does not exist for resource: "+resource.getId());
+ } else {
+ try {
+ ret = res.getContents();
+ } catch(Exception e) {
+ logger.log(Level.SEVERE,
+ "Failed to get contents for resource '"+res+"'", e);
+ }
+ }
+ }
+ } else {
+ logger.severe("Unable to determine Eclipse context (project) for resource: "+
+ resource.getId());
+ }
+
+ return(ret);
+ }
+
+}
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/RelationshipValidator.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/RelationshipValidator.java (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/RelationshipValidator.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.tap.validation;
+
+import org.jboss.savara.tap.model.Relationship;
+import org.jboss.savara.tap.model.Resource;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * This interface provides validation for relationships defined within a Testable
+ * Architecture Project (TAP) model.
+ *
+ */
+public interface RelationshipValidator {
+
+ /**
+ * This method determines whether the validator supports the
+ * supplied resource and relationship types.
+ *
+ * @param rel The relationship details
+ * @param fromResource The 'from' resource to be validated
+ * @param toResource The 'to' resource to be validated
+ * @return Whether the validator supports the resource types
+ */
+ public boolean isSupported(Relationship rel, Resource fromResource, Resource toResource);
+
+ /**
+ * This method validates the supplied resources and relationship,
+ * and reports any issues to the supplied model listener.
+ *
+ * @param rel The relationship details
+ * @param fromResource The 'from' resource to be validated
+ * @param fromIS The 'from' resource input stream
+ * @param toResource The 'to' resource to be validated
+ * @param toIS The 'to' resource input stream
+ * @param l The model listener
+ */
+ public void validate(Relationship rel, Resource fromResource, java.io.InputStream fromIS,
+ Resource toResource, java.io.InputStream toIS, ModelListener l);
+
+}
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ResourceValidator.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ResourceValidator.java (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ResourceValidator.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.tap.validation;
+
+import org.jboss.savara.tap.model.Resource;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * This interface provides validation for resources within a Testable
+ * Architecture Project (TAP) model.
+ *
+ */
+public interface ResourceValidator {
+
+ /**
+ * This method determines whether the validator supports the
+ * supplied resource type.
+ *
+ * @param resource The resource to be validated
+ * @return Whether the validator supports the resource type
+ */
+ public boolean isSupported(Resource resource);
+
+ /**
+ * This method validates the supplied resource and reports
+ * any issues to the supplied model listener.
+ *
+ * @param resource The resource
+ * @param is The resource input stream
+ * @param l The model listener
+ */
+ public void validate(Resource resource, java.io.InputStream is, ModelListener l);
+
+}
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/TAPValidator.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,185 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.tap.validation;
+
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.jboss.savara.tap.model.Phase;
+import org.jboss.savara.tap.model.Project;
+import org.jboss.savara.tap.model.Relationship;
+import org.jboss.savara.tap.model.Resource;
+import org.jboss.savara.tap.model.admin.ResourceLoader;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * This class provides the validation control mechanism for a TAP
+ * project file.
+ *
+ */
+public class TAPValidator {
+
+ private static Logger logger = Logger.getLogger(TAPValidator.class.getName());
+
+ private static java.util.List<ResourceLoader> m_resourceLoaders=
+ new java.util.Vector<ResourceLoader>();
+ private static java.util.List<ResourceValidator> m_resourceValidators=
+ new java.util.Vector<ResourceValidator>();
+ private static java.util.List<RelationshipValidator> m_relationshipValidators=
+ new java.util.Vector<RelationshipValidator>();
+
+ /**
+ * This method adds a resource loader.
+ *
+ * @param rl The resource loader
+ */
+ public void addResourceLoader(ResourceLoader rl) {
+ m_resourceLoaders.add(rl);
+ }
+
+ /**
+ * This method removes a resource loader.
+ *
+ * @param rl The resource loader
+ */
+ public void removeResourceLoader(ResourceLoader rl) {
+ m_resourceLoaders.remove(rl);
+ }
+
+ /**
+ * This method adds a resource validator.
+ *
+ * @param rv The resource validator
+ */
+ public void addResourceValidator(ResourceValidator rv) {
+ m_resourceValidators.add(rv);
+ }
+
+ /**
+ * This method removes a resource validator.
+ *
+ * @param rv The resource validator
+ */
+ public void removeResourceValidator(ResourceValidator rv) {
+ m_resourceValidators.remove(rv);
+ }
+
+ /**
+ * This method adds a relationship validator.
+ *
+ * @param rv The relationship validator
+ */
+ public void addRelationshipValidator(RelationshipValidator rv) {
+ m_relationshipValidators.add(rv);
+ }
+
+ /**
+ * This method removes a relationship validator.
+ *
+ * @param rv The relationship validator
+ */
+ public void removeRelationshipValidator(RelationshipValidator rv) {
+ m_relationshipValidators.remove(rv);
+ }
+
+ /**
+ * This method validates a TAP project.
+ *
+ * @param project The TAP project
+ * @param l The model listener
+ */
+ public void validate(Project project, ModelListener l) {
+
+ // Load and validate the individual resources
+ for (Phase phase : project.getPhase()) {
+ for (Resource resource : phase.getResource()) {
+
+ // Validate resource
+ for (ResourceValidator rv : m_resourceValidators) {
+ if (rv.isSupported(resource)) {
+ // Obtain input stream for resource
+ java.io.InputStream is=getResourceContents(resource);
+
+ if (is != null) {
+ rv.validate(resource, is, l);
+
+ try {
+ is.close();
+ } catch(Exception e) {
+ logger.log(Level.SEVERE, "Failed to close resource '"+
+ resource.getId()+"' input stream", e);
+ }
+ } else {
+ // TODO: Log error - resource validator supports resource
+ // but cannot be loaded (or possibly a warning)?
+ }
+ break;
+ }
+ }
+
+ for (Relationship rel : resource.getRelationship()) {
+ Resource toResource=(Resource)rel.getRef();
+
+ if (toResource !=null) {
+ for (RelationshipValidator rv : m_relationshipValidators) {
+
+ if (rv.isSupported(rel, resource, toResource)) {
+ // Obtain input stream for resource
+ java.io.InputStream fromIS=getResourceContents(resource);
+ java.io.InputStream toIS=getResourceContents(toResource);
+
+ rv.validate(rel, resource, fromIS, toResource, toIS, l);
+
+ break;
+ }
+ }
+ } else {
+ logger.severe("Linked resource with id '"+rel.getRef()+
+ "' not found for resource '"+resource.getId()+"'");
+ }
+ }
+ }
+ }
+ }
+
+ protected java.io.InputStream getResourceContents(Resource resource) {
+ java.io.InputStream ret=null;
+
+ try {
+ for (ResourceLoader rl : m_resourceLoaders) {
+ if (rl.isSupported(resource)) {
+ ret = rl.getContents(resource);
+
+ if (ret != null) {
+ break;
+ }
+ }
+ }
+ } catch(Exception e) {
+ logger.log(Level.SEVERE, "Failed to load resource '"+
+ resource.getId()+"'", e);
+ }
+
+ return(ret);
+ }
+}
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/action/ValidateAction.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/action/ValidateAction.java (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/action/ValidateAction.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2005-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 17 Jan, 2008 : Initial version created by gary
+ */
+package org.jboss.savara.tap.validation.action;
+
+import java.util.logging.Logger;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.jboss.savara.tap.model.Project;
+import org.jboss.savara.tap.model.admin.TAPModelUtil;
+import org.jboss.savara.tap.validation.TAPValidator;
+import org.scribble.eclipse.model.admin.OSGIModelListener;
+
+/**
+ * This class invokes the validation action on the selected
+ * TAP file.
+ *
+ */
+public class ValidateAction implements IObjectActionDelegate {
+
+ private static Logger logger = Logger.getLogger(ValidateAction.class.getName());
+
+ private ISelection m_selection=null;
+ private IWorkbenchPart m_targetPart=null;
+ private static TAPValidator m_validator=new TAPValidator();
+
+ public ValidateAction() {
+ }
+
+ /**
+ * This method returns the validator.
+ *
+ * @return The validator
+ */
+ public static TAPValidator getValidator() {
+ return(m_validator);
+ }
+
+ /**
+ * This method implements the action's run method.
+ *
+ * @param action The action
+ */
+ public void run(IAction action) {
+
+ if (m_selection instanceof StructuredSelection) {
+ StructuredSelection sel=(StructuredSelection)m_selection;
+
+ IResource res=(IResource)sel.getFirstElement();
+
+ // Obtain the TAP model from the resource
+ if (res instanceof IFile) {
+ Project project=null;
+
+ try {
+ java.io.InputStream is=((IFile)res).getContents();
+
+ project = TAPModelUtil.deserialize(is);
+
+ is.close();
+ } catch(Exception e) {
+ error("Failed to load TAP project file: "+e);
+ }
+
+ if (project != null) {
+ OSGIModelListener l=new OSGIModelListener(res);
+
+ m_validator.validate(project, l);
+
+ l.finished();
+ }
+ }
+ }
+ }
+
+ /**
+ * This method is used to report an error.
+ *
+ * @param mesg The error message
+ */
+ public void error(String mesg) {
+
+ logger.severe("Error occurred: "+mesg);
+
+ MessageBox mbox=new MessageBox(m_targetPart.getSite().getShell(),
+ SWT.ICON_ERROR|SWT.OK);
+
+ if (mesg == null) {
+ mesg = "Null pointer exception has occurred";
+ }
+
+ mbox.setMessage(mesg);
+ mbox.open();
+ }
+
+ /**
+ * This method indicates that the selection has changed.
+ *
+ * @param action The action
+ * @param selection The selection
+ */
+ public void selectionChanged(IAction action,
+ ISelection selection) {
+ m_selection = selection;
+ }
+
+ /**
+ * This method sets the currently active workbench part.
+ *
+ * @param action The action
+ * @param targetPart The active workbench part
+ */
+ public void setActivePart(IAction action,
+ IWorkbenchPart targetPart) {
+ m_targetPart = targetPart;
+ }
+}
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/osgi/Activator.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/osgi/Activator.java (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/osgi/Activator.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,97 @@
+package org.jboss.savara.tap.validation.osgi;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.savara.tap.model.admin.ResourceLoader;
+import org.jboss.savara.tap.validation.RelationshipValidator;
+import org.jboss.savara.tap.validation.ResourceValidator;
+import org.jboss.savara.tap.validation.action.ValidateAction;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.savara.tap.validation"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ // Get resource loaders
+ ServiceReference sr=context.getServiceReference(ResourceLoader.class.getName());
+
+ // NOTE: May need to cater for multiple resource loader implementations
+ if (sr != null) {
+ ResourceLoader rl=(ResourceLoader)context.getService(sr);
+
+ if (rl != null) {
+ ValidateAction.getValidator().addResourceLoader(rl);
+ } else {
+ System.err.println("ERROR: ResourceLoader does not exist");
+ }
+ }
+
+ // Get resource validators
+ sr = context.getServiceReference(ResourceValidator.class.getName());
+
+ // NOTE: May need to cater for multiple resource validator implementations
+ if (sr != null) {
+ ResourceValidator rv=(ResourceValidator)context.getService(sr);
+
+ if (rv != null) {
+ ValidateAction.getValidator().addResourceValidator(rv);
+ } else {
+ System.err.println("ERROR: ResourceValidator does not exist");
+ }
+ }
+
+ // Get relationship validators
+ sr = context.getServiceReference(RelationshipValidator.class.getName());
+
+ // NOTE: May need to cater for multiple relationship validator implementations
+ if (sr != null) {
+ RelationshipValidator rv=(RelationshipValidator)context.getService(sr);
+
+ if (rv != null) {
+ ValidateAction.getValidator().addRelationshipValidator(rv);
+ } else {
+ System.err.println("ERROR: RelationshipValidator does not exist");
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ws/BPELRelationshipValidator.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ws/BPELRelationshipValidator.java (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tap.validation/src/java/org/jboss/savara/tap/validation/ws/BPELRelationshipValidator.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -0,0 +1,145 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.tap.validation.ws;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.savara.tap.model.Link;
+import org.jboss.savara.tap.model.Relationship;
+import org.jboss.savara.tap.model.Resource;
+import org.jboss.savara.tap.validation.RelationshipValidator;
+import org.scribble.model.Model;
+import org.scribble.model.Role;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+
+public class BPELRelationshipValidator implements RelationshipValidator {
+
+ /**
+ * This method determines whether the validator supports the
+ * supplied resource and relationship types.
+ *
+ * @param rel The relationship details
+ * @param fromResource The 'from' resource to be validated
+ * @param toResource The 'to' resource to be validated
+ * @return Whether the validator supports the resource types
+ */
+ public boolean isSupported(Relationship rel, Resource fromResource, Resource toResource) {
+ boolean ret=false;
+
+ // NOTE: When more than one choreography model is available, we may need to just find
+ // a way to identify whether a parser exists to convert the 'toResource' into a
+ // global protocol model
+ if (fromResource.getId().endsWith(".bpel") && toResource.getId().endsWith(".cdm")) {
+
+ // Check that a link exists with type 'role' and a 'to' field containing the target
+ // role (or participant in CDL case)
+ for (Link link : rel.getLink()) {
+ if (link.getType().equals("role") && link.getTo() != null) {
+ ret = true;
+ break;
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method validates the supplied resources and relationship,
+ * and reports any issues to the supplied model listener.
+ *
+ * @param rel The relationship details
+ * @param fromResource The 'from' resource to be validated
+ * @param fromIS The 'from' resource input stream
+ * @param toResource The 'to' resource to be validated
+ * @param toIS The 'to' resource input stream
+ * @param l The model listener
+ */
+ public void validate(Relationship rel, Resource fromResource, java.io.InputStream fromIS,
+ Resource toResource, java.io.InputStream toIS, ModelListener l) {
+ String roleName=null;
+
+ // Get the 'to' role associated with the link
+ for (Link link : rel.getLink()) {
+ if (link.getType().equals("role") && link.getTo() != null) {
+ roleName = link.getTo();
+ break;
+ }
+ }
+
+ if (roleName == null) {
+ ModelIssue issue=new ModelIssue();
+ issue.setMessage("Role not defined on relationship link");
+ l.error(issue);
+ } else {
+ org.scribble.parser.Parser p=new org.scribble.parser.DefaultParser();
+
+ org.scribble.model.ModelReference fromRef=
+ new org.scribble.model.ModelReference("bpel");
+
+ org.scribble.model.Model fromModel=p.parse(fromRef, fromIS, l);
+
+ if (fromModel == null) {
+ ModelIssue issue=new ModelIssue();
+ issue.setMessage("Failed to parse '"+fromResource.getId()+"'");
+ l.error(issue);
+ } else {
+
+ org.scribble.model.ModelReference toRef=
+ new org.scribble.model.ModelReference("cdm");
+
+ org.scribble.model.Model toModel=p.parse(toRef, toIS, l);
+
+ if (toModel == null) {
+ ModelIssue issue=new ModelIssue();
+ issue.setMessage("Failed to parse related resource '"+toResource.getId()+
+ "' for resource '"+fromResource.getId()+"'");
+ l.error(issue);
+
+ } else {
+ org.scribble.projector.Projector projector=new org.scribble.projector.DefaultProjector();
+
+ Role role=new Role(roleName);
+
+ org.scribble.model.Model toLocalModel=projector.project(toRef, toModel, role, l);
+
+ if (toLocalModel == null) {
+ ModelIssue issue=new ModelIssue();
+ issue.setMessage("Failed to project related resource '"+toResource.getId()+
+ "', role '"+roleName+"', for resource '"+fromResource.getId()+"'");
+ l.error(issue);
+ } else {
+ org.scribble.comparator.Comparator comparator=new org.scribble.comparator.DefaultComparator();
+
+ if (comparator.compare((Model)fromModel, fromRef, (Model)toLocalModel, toRef, l)) {
+ //System.out.println("COMPARE OK");
+ } else {
+ //System.out.println("COMPARE NOT OK");
+ }
+ }
+ }
+ }
+ }
+ }
+
+}
Modified: trunk/tools/plugins/org.scribble.eclipse/src/java/org/scribble/eclipse/model/admin/OSGIModelListener.java
===================================================================
--- trunk/tools/plugins/org.scribble.eclipse/src/java/org/scribble/eclipse/model/admin/OSGIModelListener.java 2010-09-09 17:23:14 UTC (rev 395)
+++ trunk/tools/plugins/org.scribble.eclipse/src/java/org/scribble/eclipse/model/admin/OSGIModelListener.java 2010-09-14 16:35:12 UTC (rev 396)
@@ -60,6 +60,16 @@
}
}
+ /**
+ * This method is the constructor for the validation model
+ * listener.
+ *
+ * @param ref The model reference
+ */
+ public OSGIModelListener(IResource res) {
+ m_resource = res;
+ }
+
public void error(ModelIssue issue) {
reportIssue(issue, ReportEntry.ERROR_TYPE);
}
@@ -167,19 +177,21 @@
marker.setAttribute(SOURCE_MODEL_OBJECT_URI, src.getSource().getModelObjectURI());
marker.setAttribute(SOURCE_COMPONENT_URI, src.getSource().getComponentURI());
- marker.setAttribute(MODEL_NAMESPACE, m_reference.getNamespace());
- marker.setAttribute(MODEL_LOCALPART, m_reference.getLocalpart());
- marker.setAttribute(MODEL_LOCATED_ROLE, m_reference.getLocatedRole());
- marker.setAttribute(MODEL_NOTATION, m_reference.getNotation());
-
- java.util.Iterator<String> propiter=m_reference.getPropertyNames().iterator();
-
- while (propiter.hasNext()) {
- String name=propiter.next();
- Object val=convertValue(m_reference.getProperty(name));
+ if (m_reference != null) {
+ marker.setAttribute(MODEL_NAMESPACE, m_reference.getNamespace());
+ marker.setAttribute(MODEL_LOCALPART, m_reference.getLocalpart());
+ marker.setAttribute(MODEL_LOCATED_ROLE, m_reference.getLocatedRole());
+ marker.setAttribute(MODEL_NOTATION, m_reference.getNotation());
- if (val != null) {
- marker.setAttribute(MODEL_PROP_PREFIX+name, val);
+ java.util.Iterator<String> propiter=m_reference.getPropertyNames().iterator();
+
+ while (propiter.hasNext()) {
+ String name=propiter.next();
+ Object val=convertValue(m_reference.getProperty(name));
+
+ if (val != null) {
+ marker.setAttribute(MODEL_PROP_PREFIX+name, val);
+ }
}
}
13 years, 7 months
savara SVN: r395 - trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/ui.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-09 13:23:14 -0400 (Thu, 09 Sep 2010)
New Revision: 395
Modified:
trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/ui/ChannelJPanel.java
trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/ui/Monitor.java
Log:
Remove channels from the monitor GUI, and changed title to SAVARA Monitor.
Modified: trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/ui/ChannelJPanel.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/ui/ChannelJPanel.java 2010-09-07 16:53:58 UTC (rev 394)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/ui/ChannelJPanel.java 2010-09-09 17:23:14 UTC (rev 395)
@@ -83,7 +83,7 @@
DefaultTreeModel treeModel = null;
DefaultMutableTreeNode rootNode = null;
- DefaultMutableTreeNode channelRoot = null;
+ //DefaultMutableTreeNode channelRoot = null;
DefaultMutableTreeNode issuesRoot = null;
DefaultMutableTreeNode errorsRoot = null;
DefaultMutableTreeNode warningsRoot = null;
@@ -293,7 +293,7 @@
logger.fine("createChannelNodes(new)");
- channelRoot = addObject(null,channelRootName); // was channelRoot
+ //channelRoot = addObject(null,channelRootName); // was channelRoot
org.pi4soa.cdl.TypeDefinitions typeDefinitions = choreography.getTypeDefinitions();
org.eclipse.emf.common.util.EList channelTypes = typeDefinitions.getChannelTypes();
@@ -308,6 +308,7 @@
}
});
+ /*
Iterator listIterator = channelTypes.iterator();
while(listIterator.hasNext()){
org.pi4soa.cdl.ChannelType channelType = (org.pi4soa.cdl.ChannelType) listIterator.next();
@@ -316,6 +317,7 @@
logger.fine("Adding channel type to tree: " + channelType.getName());
addObject(channelRoot,node);
}
+ */
}
Modified: trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/ui/Monitor.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/ui/Monitor.java 2010-09-07 16:53:58 UTC (rev 394)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/ui/Monitor.java 2010-09-09 17:23:14 UTC (rev 395)
@@ -108,7 +108,7 @@
*/
public static void main(String args[]){
Monitor monitor = new Monitor(args.length > 0);
- JFrame jFrame = new JFrame("Choreography Monitor");
+ JFrame jFrame = new JFrame("SAVARA Monitor");
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.getContentPane().setLayout(new BorderLayout());
jFrame.getContentPane().add(monitor, BorderLayout.CENTER);
13 years, 8 months
savara SVN: r394 - in trunk/docs: gettingstartedguide/src/main/en-US/module and 4 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-07 12:53:58 -0400 (Tue, 07 Sep 2010)
New Revision: 394
Modified:
trunk/docs/gettingstartedguide/pom.xml
trunk/docs/gettingstartedguide/src/main/en-US/module/architecture.xml
trunk/docs/gettingstartedguide/src/main/en-US/module/businessanalysis.xml
trunk/docs/gettingstartedguide/src/main/en-US/module/installation.xml
trunk/docs/gettingstartedguide/src/main/en-US/module/runtimevalidation.xml
trunk/docs/gettingstartedguide/src/main/en-US/module/serviceanalysisdesign.xml
trunk/docs/gettingstartedguide/src/main/en-US/module/servicedev.xml
trunk/docs/samplesguide/pom.xml
trunk/docs/samplesguide/src/main/en-US/module/servicevalidator.xml
trunk/docs/userguide/pom.xml
trunk/docs/userguide/src/main/en-US/module/bpel.xml
trunk/docs/userguide/src/main/en-US/module/conversation-validation.xml
Log:
Fixed documentation to include the images which were not included after switching to maven3.
Modified: trunk/docs/gettingstartedguide/pom.xml
===================================================================
--- trunk/docs/gettingstartedguide/pom.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/gettingstartedguide/pom.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -53,7 +53,7 @@
<imageResource>
<directory>${basedir}/src/main</directory>
<includes>
- <include>images/**/*</include>
+ <include>**/images/**/*</include>
</includes>
</imageResource>
<formats>
Modified: trunk/docs/gettingstartedguide/src/main/en-US/module/architecture.xml
===================================================================
--- trunk/docs/gettingstartedguide/src/main/en-US/module/architecture.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/gettingstartedguide/src/main/en-US/module/architecture.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -104,7 +104,7 @@
</para>
<imageobject>
- <imagedata fileref="images/PurchaseGoods.jpg" align="center" width="5in" />
+ <imagedata fileref="en-US/images/PurchaseGoods.jpg" align="center" width="5in" />
</imageobject>
<section>
@@ -120,7 +120,7 @@
</para>
<imageobject>
- <imagedata fileref="images/SuccessfulPurchasePostTest.jpg" align="center" width="5in" />
+ <imagedata fileref="en-US/images/SuccessfulPurchasePostTest.jpg" align="center" width="5in" />
</imageobject>
<para>
@@ -131,7 +131,7 @@
</para>
<imageobject>
- <imagedata fileref="images/InvalidPurchasePostTest.jpg" align="center" width="5in" />
+ <imagedata fileref="en-US/images/InvalidPurchasePostTest.jpg" align="center" width="5in" />
</imageobject>
<para>
@@ -166,7 +166,7 @@
</para>
<imageobject>
- <imagedata fileref="images/ExportHTMLMenu.png" align="center" width="4in" />
+ <imagedata fileref="en-US/images/ExportHTMLMenu.png" align="center" width="4in" />
</imageobject>
<para>
@@ -175,7 +175,7 @@
</para>
<imageobject>
- <imagedata fileref="images/ExportHTMLDialog.png" align="center" width="4in" />
+ <imagedata fileref="en-US/images/ExportHTMLDialog.png" align="center" width="4in" />
</imageobject>
<para>
@@ -186,7 +186,7 @@
</para>
<imageobject>
- <imagedata fileref="images/ExportedHTML.png" align="center" width="6in" />
+ <imagedata fileref="en-US/images/ExportedHTML.png" align="center" width="6in" />
</imageobject>
</section>
Modified: trunk/docs/gettingstartedguide/src/main/en-US/module/businessanalysis.xml
===================================================================
--- trunk/docs/gettingstartedguide/src/main/en-US/module/businessanalysis.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/gettingstartedguide/src/main/en-US/module/businessanalysis.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -23,7 +23,7 @@
</para>
<imageobject>
- <imagedata fileref="images/RolesAndRelationships.png" align="center" width="4in" />
+ <imagedata fileref="en-US/images/RolesAndRelationships.png" align="center" width="4in" />
</imageobject>
<para>
@@ -32,7 +32,7 @@
</para>
<imageobject>
- <imagedata fileref="images/ParticipantAndOtherTypes.png" align="center" width="3in" />
+ <imagedata fileref="en-US/images/ParticipantAndOtherTypes.png" align="center" width="3in" />
</imageobject>
<para>
@@ -64,7 +64,7 @@
</para>
<imageobject>
- <imagedata fileref="images/SuccessfulPurchasePreTest.jpg" align="center" width="5in" />
+ <imagedata fileref="en-US/images/SuccessfulPurchasePreTest.jpg" align="center" width="5in" />
</imageobject>
<para>
Modified: trunk/docs/gettingstartedguide/src/main/en-US/module/installation.xml
===================================================================
--- trunk/docs/gettingstartedguide/src/main/en-US/module/installation.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/gettingstartedguide/src/main/en-US/module/installation.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -147,7 +147,7 @@
panal (Navigator or Package depending on perspective being viewed).
</para>
<imageobject>
- <imagedata fileref="images/ImportMenu.jpg" align="center" width="2in" />
+ <imagedata fileref="en-US/images/ImportMenu.jpg" align="center" width="2in" />
</imageobject>
</listitem>
<listitem>
@@ -156,7 +156,7 @@
option and press the 'Next' button.
</para>
<imageobject>
- <imagedata fileref="images/ImportDialog.jpg" align="center" width="4in" />
+ <imagedata fileref="en-US/images/ImportDialog.jpg" align="center" width="4in" />
</imageobject>
</listitem>
<listitem>
@@ -165,7 +165,7 @@
navigate to the <filename>${SAVARA-Tools}/samples</filename> folder, then press 'Ok'.
</para>
<imageobject>
- <imagedata fileref="images/ImportFileDialog.jpg" align="center" width="3in" />
+ <imagedata fileref="en-US/images/ImportFileDialog.jpg" align="center" width="3in" />
</imageobject>
</listitem>
<listitem>
@@ -174,13 +174,13 @@
will be listed. Press the 'Finish' button to import them all.
</para>
<imageobject>
- <imagedata fileref="images/ImportProjectsDialog.jpg" align="center" width="4in" />
+ <imagedata fileref="en-US/images/ImportProjectsDialog.jpg" align="center" width="4in" />
</imageobject>
<para>
Once imported, the Eclipse navigator will list the sample projects:
</para>
<imageobject>
- <imagedata fileref="images/ImportedProject.jpg" align="center" width="2in" />
+ <imagedata fileref="en-US/images/ImportedProject.jpg" align="center" width="2in" />
</imageobject>
</listitem>
</orderedlist>
Modified: trunk/docs/gettingstartedguide/src/main/en-US/module/runtimevalidation.xml
===================================================================
--- trunk/docs/gettingstartedguide/src/main/en-US/module/runtimevalidation.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/gettingstartedguide/src/main/en-US/module/runtimevalidation.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -38,7 +38,7 @@
</para>
<imageobject>
- <imagedata fileref="images/SVJBossESBEditAnnotation.jpg" align="center" width="3in" />
+ <imagedata fileref="en-US/images/SVJBossESBEditAnnotation.jpg" align="center" width="3in" />
</imageobject>
<para>
@@ -48,7 +48,7 @@
</para>
<imageobject>
- <imagedata fileref="images/SVJBossESBAnnotation.jpg" align="center" width="3in" />
+ <imagedata fileref="en-US/images/SVJBossESBAnnotation.jpg" align="center" width="3in" />
</imageobject>
<para>
@@ -56,7 +56,7 @@
</para>
<imageobject>
- <imagedata fileref="images/SVJBossESBAnnotationTooltip.jpg" align="center" width="3in" />
+ <imagedata fileref="en-US/images/SVJBossESBAnnotationTooltip.jpg" align="center" width="3in" />
</imageobject>
<para>
@@ -147,7 +147,7 @@
</para>
<imageobject>
- <imagedata fileref="images/MonitorMenu.jpg" align="center" width="2in" />
+ <imagedata fileref="en-US/images/MonitorMenu.jpg" align="center" width="2in" />
</imageobject>
<para>
@@ -156,7 +156,7 @@
</para>
<imageobject>
- <imagedata fileref="images/ChoreoMonReady.jpg" align="center" width="4in" />
+ <imagedata fileref="en-US/images/ChoreoMonReady.jpg" align="center" width="4in" />
</imageobject>
</section>
@@ -172,7 +172,7 @@
</para>
<imageobject>
- <imagedata fileref="images/TrailblazerWebPage.jpg" align="center" width="4in" />
+ <imagedata fileref="en-US/images/TrailblazerWebPage.jpg" align="center" width="4in" />
</imageobject>
<para>
@@ -212,7 +212,7 @@
</para>
<imageobject>
- <imagedata fileref="images/TrailBlazerMonitorError.jpg" align="center" width="4in" />
+ <imagedata fileref="en-US/images/TrailBlazerMonitorError.jpg" align="center" width="4in" />
</imageobject>
<para>
Modified: trunk/docs/gettingstartedguide/src/main/en-US/module/serviceanalysisdesign.xml
===================================================================
--- trunk/docs/gettingstartedguide/src/main/en-US/module/serviceanalysisdesign.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/gettingstartedguide/src/main/en-US/module/serviceanalysisdesign.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -45,7 +45,7 @@
</para>
<imageobject>
- <imagedata fileref="images/ExportBPMNMenu.png" align="center" width="4in" />
+ <imagedata fileref="en-US/images/ExportBPMNMenu.png" align="center" width="4in" />
</imageobject>
<para>
@@ -71,7 +71,7 @@
</para>
<imageobject>
- <imagedata fileref="images/ExportedBPMN.png" align="center" width="6in" />
+ <imagedata fileref="en-US/images/ExportedBPMN.png" align="center" width="6in" />
</imageobject>
</section>
Modified: trunk/docs/gettingstartedguide/src/main/en-US/module/servicedev.xml
===================================================================
--- trunk/docs/gettingstartedguide/src/main/en-US/module/servicedev.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/gettingstartedguide/src/main/en-US/module/servicedev.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -47,7 +47,7 @@
</para>
<imageobject>
- <imagedata fileref="images/GenerateBPELMenu.jpg" align="center" width="3in" />
+ <imagedata fileref="en-US/images/GenerateBPELMenu.jpg" align="center" width="3in" />
</imageobject>
<para>
@@ -56,7 +56,7 @@
</para>
<imageobject>
- <imagedata fileref="images/GenerateBPELDialog.jpg" align="center" width="3in" />
+ <imagedata fileref="en-US/images/GenerateBPELDialog.jpg" align="center" width="3in" />
</imageobject>
<para>
@@ -74,7 +74,7 @@
</para>
<imageobject>
- <imagedata fileref="images/GenerateBPELNav.jpg" align="center" width="2in" />
+ <imagedata fileref="en-US/images/GenerateBPELNav.jpg" align="center" width="2in" />
</imageobject>
</section>
@@ -92,7 +92,8 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03" xmlns:ns1="http://www.jboss.org/examples/creditAgency">
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+ xmlns:ns1="http://www.jboss.org/examples/creditAgency">
<process name="ns1:PurchaseGoodsProcess_CreditAgency">
<active>
true
@@ -111,7 +112,7 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
- <service name="ns1:CreditAgencyService" port="CreditAgencyInterfacePort"/>
+<service name="ns1:CreditAgencyService" port="CreditAgencyInterfacePort"/>
]]></programlisting>
</informalexample>
@@ -126,50 +127,49 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
-<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
- xmlns:ca="http://www.jboss.org/examples/creditAgency"
- xmlns:pur="http://www.jboss.org/examples/purchasing"
- xmlns:sto="http://www.jboss.org/examples/store"
- xmlns:tns="http://www.jboss.org/savara/examples"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:ns0="http://www.scribble.org/conversation"
- ns0:conversationType="savara.samples.Common@CreditAgency"
- name="PurchaseGoodsProcess_CreditAgency"
- targetNamespace="http://www.jboss.org/examples/creditAgency"
- xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
- <import importType="http://schemas.xmlsoap.org/wsdl/"
- location="PurchaseGoodsProcess_CreditAgency.wsdl"
- namespace="http://www.jboss.org/examples/creditAgency"/>
- <import importType="http://schemas.xmlsoap.org/wsdl/"
- location="PurchaseGoodsProcess_Store.wsdl"
- namespace="http://www.jboss.org/examples/store"/>
- <import importType="http://schemas.xmlsoap.org/wsdl/"
- location="CreditAgencyPartnerLinkTypes.wsdl"
- namespace="http://www.jboss.org/examples/creditAgency"/>
- <partnerLinks>
- <partnerLink myRole="CreditAgencyService" name="StoreToCreditAgency"
- partnerLinkType="ca:StoreToCreditAgencyServiceLT"/>
- </partnerLinks>
- <variables>
- <variable messageType="ca:CreditCheckRequest" name="creditCheckRequestVar"/>
- <variable messageType="ca:CreditCheckOk" name="creditCheckOkVar"/>
- <variable messageType="ca:CreditCheckInvalid" name="creditCheckInvalidVar"/>
- </variables>
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+ xmlns:ca="http://www.jboss.org/examples/creditAgency"
+ xmlns:sto="http://www.jboss.org/examples/store"
+ xmlns:tns="http://www.jboss.org/savara/examples"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns0="http://www.scribble.org/conversation"
+ ns0:conversationType="savara.samples.Common@CreditAgency"
+ name="PurchaseGoodsProcess_CreditAgency"
+ targetNamespace="http://www.jboss.org/examples/creditAgency"
+ xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+ <import importType="http://schemas.xmlsoap.org/wsdl/"
+ location="PurchaseGoodsProcess_CreditAgency.wsdl"
+ namespace="http://www.jboss.org/examples/creditAgency"/>
+ <import importType="http://schemas.xmlsoap.org/wsdl/"
+ location="PurchaseGoodsProcess_Store.wsdl"
+ namespace="http://www.jboss.org/examples/store"/>
+ <import importType="http://schemas.xmlsoap.org/wsdl/"
+ location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl"
+ namespace="http://www.jboss.org/examples/creditAgency"/>
+ <partnerLinks>
+ <partnerLink myRole="CreditAgencyService" name="StoreToCreditAgency"
+ partnerLinkType="ca:StoreToCreditAgencyServiceLT"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="ca:checkCreditRequest" name="creditCheckRequestVar"/>
+ <variable messageType="ca:checkCreditResponse" name="creditCheckOkVar"/>
+ <variable messageType="ca:CreditCheckFailedFault" name="creditCheckInvalidVar"/>
+ </variables>
<sequence>
- <receive createInstance="yes" operation="checkCredit"
- partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface"
- variable="creditCheckRequestVar"/>
+ <receive createInstance="yes" name="Receive_CreditCheckRequest" operation="checkCredit"
+ partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface"
+ variable="creditCheckRequestVar"/>
<if>
<sequence>
- <reply operation="checkCredit" partnerLink="StoreToCreditAgency"
- portType="ca:CreditAgencyInterface" variable="creditCheckOkVar"/>
+ <reply name="Send_CreditCheckOk" operation="checkCredit"
+ partnerLink="StoreToCreditAgency"
+ portType="ca:CreditAgencyInterface" variable="creditCheckOkVar"/>
</sequence>
<else>
<sequence>
- <reply faultName="ca:CreditCheckFailed" operation="checkCredit"
- partnerLink="StoreToCreditAgency"
- portType="ca:CreditAgencyInterface"
- variable="creditCheckInvalidVar"/>
+ <reply faultName="ca:CreditCheckFailed" name="Send_CreditCheckInvalid"
+ operation="checkCredit" partnerLink="StoreToCreditAgency"
+ portType="ca:CreditAgencyInterface" variable="creditCheckInvalidVar"/>
</sequence>
</else>
</if>
@@ -185,11 +185,11 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
- <if>
- <condition>
- $creditCheckRequestVar.CreditCheckRequest/pur:amount <= 500
- </condition>
- ....
+<if>
+ <bpel:condition>
+ $creditCheckRequestVar.content/@amount <= 500
+ </bpel:condition>
+ ....
]]></programlisting>
</informalexample>
@@ -209,12 +209,24 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
- <assign name="CopyPurchaseDetails">
- <copy>
- <from>$creditCheckRequestVar.CreditCheckRequest</from>
- <to>$creditCheckOkVar.CreditCheckOk</to>
- </copy>
- </assign>
+<assign name="CopyPurchaseDetails">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal xml:space="preserve">
+ <tns:CreditCheckOk xmlns:tns="http://www.jboss.org/examples/creditAgency"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+ id="" amount="" >
+ </tns:CreditCheckOk>
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to variable="creditCheckOkVar" part="content"></bpel:to>
+ </bpel:copy>
+ <copy>
+ <from>$creditCheckRequestVar.content/@id</from>
+ <to>$creditCheckOkVar.content/@id</to>
+ </copy>
+</assign>
]]></programlisting>
</informalexample>
@@ -226,12 +238,24 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
- <assign name="CopyPurchaseDetails">
- <copy>
- <from>$creditCheckRequestVar.CreditCheckRequest</from>
- <to>$creditCheckInvalidVar.CreditCheckInvalid</to>
- </copy>
- </assign>
+<assign name="CopyPurchaseDetails">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal xml:space="preserve">
+ <tns:CreditCheckInvalid xmlns:tns="http://www.jboss.org/examples/creditAgency"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+ id="" amount="" >
+ </tns:CreditCheckInvalid>
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to variable="creditCheckInvalidVar" part="content"></bpel:to>
+ </bpel:copy>
+ <copy>
+ <from>$creditCheckRequestVar.content/@id</from>
+ <to>$creditCheckInvalidVar.content/@id</to>
+ </copy>
+</assign>
]]></programlisting>
</informalexample>
@@ -251,7 +275,8 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03" xmlns:ns1="http://www.jboss.org/examples/store">
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+ xmlns:ns1="http://www.jboss.org/examples/store">
<process name="ns1:PurchaseGoodsProcess_Store">
<active>
true
@@ -273,7 +298,7 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
- xmlns:ns2="http://www.jboss.org/examples/creditAgency"
+xmlns:ns2="http://www.jboss.org/examples/creditAgency"
]]></programlisting>
</informalexample>
@@ -304,59 +329,58 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
- xmlns:ca="http://www.jboss.org/examples/creditAgency"
- xmlns:pur="http://www.jboss.org/examples/purchasing"
- xmlns:sto="http://www.jboss.org/examples/store"
- xmlns:tns="http://www.jboss.org/savara/examples"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:ns0="http://www.scribble.org/conversation"
- ns0:conversationType="savara.samples.Purchasing@Store"
- name="PurchaseGoodsProcess_Store"
- targetNamespace="http://www.jboss.org/examples/store"
- xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+ xmlns:ca="http://www.jboss.org/examples/creditAgency"
+ xmlns:sto="http://www.jboss.org/examples/store"
+ xmlns:tns="http://www.jboss.org/savara/examples"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns0="http://www.scribble.org/conversation"
+ ns0:conversationType="savara.samples.Purchasing@Store"
+ name="PurchaseGoodsProcess_Store"
+ targetNamespace="http://www.jboss.org/examples/store"
+ xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
<import importType="http://schemas.xmlsoap.org/wsdl/"
- location="PurchaseGoodsProcess_Store.wsdl"
- namespace="http://www.jboss.org/examples/store"/>
+ location="PurchaseGoodsProcess_Store.wsdl"
+ namespace="http://www.jboss.org/examples/store"/>
<import importType="http://schemas.xmlsoap.org/wsdl/"
- location="PurchaseGoodsProcess_CreditAgency.wsdl"
- namespace="http://www.jboss.org/examples/creditAgency"/>
+ location="PurchaseGoodsProcess_CreditAgency.wsdl"
+ namespace="http://www.jboss.org/examples/creditAgency"/>
<import importType="http://schemas.xmlsoap.org/wsdl/"
- location="StorePartnerLinkTypes.wsdl"
- namespace="http://www.jboss.org/examples/store"/>
+ location="PurchaseGoodsProcess_StoreArtifacts.wsdl"
+ namespace="http://www.jboss.org/examples/store"/>
<partnerLinks>
- <partnerLink myRole="StoreService" name="BuyerToStore"
- partnerLinkType="sto:BuyerToStoreServiceLT"/>
- <partnerLink name="StoreToCreditAgency"
- partnerLinkType="sto:StoreToCreditAgencyLT"
- partnerRole="CreditAgencyRequester"/>
+ <partnerLink myRole="StoreService" name="BuyerToStore" partnerLinkType="sto:BuyerToStoreServiceLT"/>
+ <partnerLink name="StoreToCreditAgency" partnerLinkType="sto:StoreToCreditAgencyLT"
+ partnerRole="CreditAgencyRequester"/>
</partnerLinks>
<variables>
- <variable messageType="sto:BuyRequest" name="buyRequestVar"/>
- <variable messageType="ca:CreditCheckRequest" name="creditCheckRequestVar"/>
- <variable messageType="ca:CreditCheckOk" name="creditCheckOkVar"/>
- <variable messageType="sto:BuyConfirmed" name="buyConfirmedVar"/>
- <variable messageType="sto:BuyFailed" name="buyFailedVar"/>
+ <variable messageType="sto:buyRequest" name="buyRequestVar"/>
+ <variable messageType="ca:checkCreditRequest" name="creditCheckRequestVar"/>
+ <variable messageType="ca:checkCreditResponse" name="creditCheckOkVar"/>
+ <variable messageType="sto:buyResponse" name="buyConfirmedVar"/>
+ <variable messageType="sto:BuyFailedFault" name="buyFailedVar"/>
</variables>
<sequence>
- <receive createInstance="yes" operation="buy" partnerLink="BuyerToStore"
+ <receive createInstance="yes" name="Receive_BuyRequest" operation="buy"
+ partnerLink="BuyerToStore"
portType="sto:StoreInterface" variable="buyRequestVar"/>
<scope>
<faultHandlers>
- <catch faultMessageType="ca:CreditCheckInvalid"
- faultName="ca:CreditCheckFailed" faultVariable="creditCheckInvalidVar">
+ <catch faultMessageType="ca:CreditCheckFailedFault"
+ faultName="ca:CreditCheckFailed"
+ faultVariable="creditCheckInvalidVar">
<sequence>
- <reply faultName="sto:BuyFailed" operation="buy"
- partnerLink="BuyerToStore" portType="sto:StoreInterface"
- variable="buyFailedVar"/>
+ <reply faultName="sto:BuyFailed" name="Send_BuyFailed" operation="buy"
+ partnerLink="BuyerToStore" portType="sto:StoreInterface"
+ variable="buyFailedVar"/>
</sequence>
</catch>
</faultHandlers>
<sequence>
- <invoke inputVariable="creditCheckRequestVar" operation="checkCredit"
- outputVariable="creditCheckOkVar" partnerLink="StoreToCreditAgency"
- portType="ca:CreditAgencyInterface"/>
- <reply operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface"
- variable="buyConfirmedVar"/>
+ <invoke inputVariable="creditCheckRequestVar" name="Send_CreditCheckRequest"
+ operation="checkCredit" outputVariable="creditCheckOkVar"
+ partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface"/>
+ <reply name="Send_BuyConfirmed" operation="buy" partnerLink="BuyerToStore"
+ portType="sto:StoreInterface" variable="buyConfirmedVar"/>
</sequence>
</scope>
</sequence>
@@ -372,12 +396,23 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
- <assign name="CopyPurchaseDetails">
- <copy>
- <from>$creditCheckInvalidVar.CreditCheckInvalid</from>
- <to>$buyFailedVar.BuyFailed</to>
- </copy>
- </assign>
+<assign name="CopyPurchaseDetails">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal xml:space="preserve">
+ <tns:BuyFailed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:tns="http://www.jboss.org/examples/store"
+ xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd "
+ id="" />
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to variable="buyFailedVar" part="content"></bpel:to>
+ </bpel:copy>
+ <copy>
+ <from>$creditCheckInvalidVar.content/@id</from>
+ <to>$buyFailedVar.content/@id</to>
+ </copy>
+</assign>
]]></programlisting>
</informalexample>
@@ -392,21 +427,48 @@
<informalexample>
<programlisting role="XML" ><![CDATA[
- <assign name="CopyPurchaseDetails">
- <copy>
- <from>$buyRequestVar.BuyRequest</from>
- <to>$creditCheckRequestVar.CreditCheckRequest</to>
- </copy>
- </assign>
- <invoke inputVariable="creditCheckRequestVar" operation="checkCredit"
- outputVariable="creditCheckOkVar" partnerLink="StoreToCreditAgency"
- portType="ca:CreditAgencyInterface"/>
- <assign name="CopyPurchaseDetails">
- <copy>
- <from>$creditCheckOkVar.CreditCheckOk</from>
- <to>$buyConfirmedVar.BuyConfirmed</to>
- </copy>
- </assign>
+<assign name="CopyPurchaseDetails">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal xml:space="preserve">
+ <tns:CreditCheckRequest xmlns:tns="http://www.jboss.org/examples/creditAgency"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+ id="" amount="" >
+ </tns:CreditCheckRequest>
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to variable="creditCheckRequestVar" part="content"></bpel:to>
+ </bpel:copy>
+ <copy>
+ <from>$buyRequestVar.content/@id</from>
+ <to>$creditCheckRequestVar.content/@id</to>
+ </copy>
+ <copy>
+ <from>$buyRequestVar.content/@amount</from>
+ <to>$creditCheckRequestVar.content/@amount</to>
+ </copy>
+</assign>
+<invoke inputVariable="creditCheckRequestVar" name="Send_CreditCheckRequest"
+ operation="checkCredit" outputVariable="creditCheckOkVar"
+ partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface"/>
+<assign name="CopyPurchaseDetails">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal xml:space="preserve">
+ <tns:BuyConfirmed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:tns="http://www.jboss.org/examples/store"
+ xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd "
+ id="" />
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to variable="buyConfirmedVar" part="content"></bpel:to>
+ </bpel:copy>
+ <copy>
+ <from>$creditCheckOkVar.content/@id</from>
+ <to>$buyConfirmedVar.content/@id</to>
+ </copy>
+</assign>
]]></programlisting>
</informalexample>
Modified: trunk/docs/samplesguide/pom.xml
===================================================================
--- trunk/docs/samplesguide/pom.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/samplesguide/pom.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -53,7 +53,7 @@
<imageResource>
<directory>${basedir}/src/main</directory>
<includes>
- <include>images/**/*</include>
+ <include>**/images/**/*</include>
</includes>
</imageResource>
<formats>
Modified: trunk/docs/samplesguide/src/main/en-US/module/servicevalidator.xml
===================================================================
--- trunk/docs/samplesguide/src/main/en-US/module/servicevalidator.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/samplesguide/src/main/en-US/module/servicevalidator.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -80,7 +80,7 @@
</para>
<imageobject>
- <imagedata fileref="images/MonitorMenu.jpg" align="center" width="2in" />
+ <imagedata fileref="en-US/images/MonitorMenu.jpg" align="center" width="2in" />
</imageobject>
<para>
@@ -89,7 +89,7 @@
</para>
<imageobject>
- <imagedata fileref="images/ChoreoMonReady.jpg" align="center" width="4in" />
+ <imagedata fileref="en-US/images/ChoreoMonReady.jpg" align="center" width="4in" />
</imageobject>
</listitem>
@@ -100,7 +100,7 @@
</para>
<imageobject>
- <imagedata fileref="images/TrailblazerWebPage.jpg" align="center" width="4in" />
+ <imagedata fileref="en-US/images/TrailblazerWebPage.jpg" align="center" width="4in" />
</imageobject>
</listitem>
Modified: trunk/docs/userguide/pom.xml
===================================================================
--- trunk/docs/userguide/pom.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/userguide/pom.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -53,7 +53,7 @@
<imageResource>
<directory>${basedir}/src/main</directory>
<includes>
- <include>images/**/*</include>
+ <include>**/images/**/*</include>
</includes>
</imageResource>
<formats>
Modified: trunk/docs/userguide/src/main/en-US/module/bpel.xml
===================================================================
--- trunk/docs/userguide/src/main/en-US/module/bpel.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/userguide/src/main/en-US/module/bpel.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -35,7 +35,7 @@
</para>
<imageobject>
- <imagedata fileref="images/genbpel1.png" width="4in" />
+ <imagedata fileref="en-US/images/genbpel1.png" width="4in" />
</imageobject>
<para>
@@ -45,7 +45,7 @@
</para>
<imageobject>
- <imagedata fileref="images/genbpel2.png" width="4in" />
+ <imagedata fileref="en-US/images/genbpel2.png" width="4in" />
</imageobject>
<para>
@@ -61,7 +61,7 @@
</para>
<imageobject>
- <imagedata fileref="images/genbpel3.png" width="4in" />
+ <imagedata fileref="en-US/images/genbpel3.png" width="4in" />
</imageobject>
</section>
Modified: trunk/docs/userguide/src/main/en-US/module/conversation-validation.xml
===================================================================
--- trunk/docs/userguide/src/main/en-US/module/conversation-validation.xml 2010-09-07 12:53:47 UTC (rev 393)
+++ trunk/docs/userguide/src/main/en-US/module/conversation-validation.xml 2010-09-07 16:53:58 UTC (rev 394)
@@ -130,7 +130,7 @@
</para>
<imageobject>
- <imagedata fileref="images/editvalidatorann.png" width="5in" />
+ <imagedata fileref="en-US/images/editvalidatorann.png" width="5in" />
</imageobject>
<para>
@@ -141,7 +141,7 @@
</para>
<imageobject>
- <imagedata fileref="images/editvalidatoranndiag.png" width="5in" />
+ <imagedata fileref="en-US/images/editvalidatoranndiag.png" width="5in" />
</imageobject>
<para>
@@ -150,7 +150,7 @@
</para>
<imageobject>
- <imagedata fileref="images/editvalidatorannselect.png" width="3in" />
+ <imagedata fileref="en-US/images/editvalidatorannselect.png" width="3in" />
</imageobject>
<para>
@@ -160,7 +160,7 @@
</para>
<imageobject>
- <imagedata fileref="images/validatorannotation.png" width="5in" />
+ <imagedata fileref="en-US/images/validatorannotation.png" width="5in" />
</imageobject>
<para>
@@ -226,7 +226,7 @@
</para>
<imageobject>
- <imagedata fileref="images/monitorui.png" width="5in" />
+ <imagedata fileref="en-US/images/monitorui.png" width="5in" />
</imageobject>
<para>
13 years, 8 months
savara SVN: r393 - in trunk: tools/plugins/org.jboss.savara.tools.validator/src/java/org/jboss/savara/tools/validator/osgi/annotations/cdl and 2 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-07 08:53:47 -0400 (Tue, 07 Sep 2010)
New Revision: 393
Modified:
trunk/samples/purchasing/PurchaseGoods.cdm
trunk/tools/plugins/org.jboss.savara.tools.validator/src/java/org/jboss/savara/tools/validator/osgi/annotations/cdl/validator.presentation
trunk/tools/plugins/org.jboss.savara.tools.validator/src/java/org/jboss/savara/tools/validator/osgi/annotations/cdl/validator.template
trunk/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm
trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/ValidatorConfigGenerator.java
Log:
Added destination type to validator annotation, to distinguish between a service name (where the request and response are associated with the same name) and an endpoint address style, where the request and response may be associated with different addresses.
Modified: trunk/samples/purchasing/PurchaseGoods.cdm
===================================================================
--- trunk/samples/purchasing/PurchaseGoods.cdm 2010-09-06 16:53:49 UTC (rev 392)
+++ trunk/samples/purchasing/PurchaseGoods.cdm 2010-09-07 12:53:47 UTC (rev 393)
@@ -54,36 +54,36 @@
<variableDefinitions description="This is the variable buy" name="buy" type="//@typeDefinitions/(a)informationTypes.2"/>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyRequest" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
<exchangeDetails description="This is the exchange details for the request exchange associated with interaction BuyRequest" name="BuyRequestRequestExchange" type="//@typeDefinitions/(a)informationTypes.2">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
<exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/(a)informationTypes.5">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Choice" description="Is credit ok?">
<activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Valid">
<activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckOk" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
<exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckOk" name="CreditCheckOkRespondExchange" type="//@typeDefinitions/(a)informationTypes.4" action="Respond">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyConfirmed" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
<exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyConfirmed" name="BuyConfirmedRespondExchange" type="//@typeDefinitions/(a)informationTypes.0" action="Respond">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
</activities>
<activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Invalid">
<activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckFailed" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
<exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckFailed" name="CreditCheckFailedRespondExchange" type="//@typeDefinitions/(a)informationTypes.3" action="Respond" faultName="CreditCheckFailed">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyFailed" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
<exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyFailed" name="BuyFailedRespondExchange" type="//@typeDefinitions/(a)informationTypes.1" action="Respond" faultName="BuyFailed">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
</activities>
Modified: trunk/tools/plugins/org.jboss.savara.tools.validator/src/java/org/jboss/savara/tools/validator/osgi/annotations/cdl/validator.presentation
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.validator/src/java/org/jboss/savara/tools/validator/osgi/annotations/cdl/validator.presentation 2010-09-06 16:53:49 UTC (rev 392)
+++ trunk/tools/plugins/org.jboss.savara.tools.validator/src/java/org/jboss/savara/tools/validator/osgi/annotations/cdl/validator.presentation 2010-09-07 12:53:47 UTC (rev 393)
@@ -1,3 +1,3 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
-The Service destination is <xsl:if test="validator/destination/@name != ''" >'<xsl:value-of select="validator/destination/@name" />' </xsl:if><xsl:if test="validator/destination/@name = ''" >'undefined' </xsl:if> [Dynamic Reply-To Destination=<xsl:value-of select="validator/destination/@dynamicReplyTo"/>]</xsl:template></xsl:stylesheet>
\ No newline at end of file
+The Service destination is <xsl:if test="validator/destination/@name != ''" >'<xsl:value-of select="validator/destination/@name" />' </xsl:if><xsl:if test="validator/destination/@name = ''" >'undefined' </xsl:if> [Type=<xsl:value-of select="validator/destination/@type"/>] [Dynamic Reply-To Destination=<xsl:value-of select="validator/destination/@dynamicReplyTo"/>]</xsl:template></xsl:stylesheet>
\ No newline at end of file
Modified: trunk/tools/plugins/org.jboss.savara.tools.validator/src/java/org/jboss/savara/tools/validator/osgi/annotations/cdl/validator.template
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.validator/src/java/org/jboss/savara/tools/validator/osgi/annotations/cdl/validator.template 2010-09-06 16:53:49 UTC (rev 392)
+++ trunk/tools/plugins/org.jboss.savara.tools.validator/src/java/org/jboss/savara/tools/validator/osgi/annotations/cdl/validator.template 2010-09-07 12:53:47 UTC (rev 393)
@@ -1,4 +1,5 @@
<validator>
<destination name="{{Destination;The URI for the destination;string;;}}"
+ type="{{Type;The type of destination;enum;endpoint address,service name;endpoint address}}" />
dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
Modified: trunk/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm
===================================================================
--- trunk/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm 2010-09-06 16:53:49 UTC (rev 392)
+++ trunk/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm 2010-09-07 12:53:47 UTC (rev 393)
@@ -54,36 +54,36 @@
<variableDefinitions description="This is the variable buy" name="buy" type="//@typeDefinitions/(a)informationTypes.2"/>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyRequest" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
<exchangeDetails description="This is the exchange details for the request exchange associated with interaction BuyRequest" name="BuyRequestRequestExchange" type="//@typeDefinitions/(a)informationTypes.2">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
<exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/(a)informationTypes.5">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Choice" description="Is credit ok?">
<activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Valid">
<activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckOk" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
<exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckOk" name="CreditCheckOkRespondExchange" type="//@typeDefinitions/(a)informationTypes.4" action="Respond">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyConfirmed" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
<exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyConfirmed" name="BuyConfirmedRespondExchange" type="//@typeDefinitions/(a)informationTypes.0" action="Respond">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
</activities>
<activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Invalid">
<activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckFailed" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
<exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckFailed" name="CreditCheckFailedRespondExchange" type="//@typeDefinitions/(a)informationTypes.3" action="Respond" faultName="CreditCheckFailed">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyFailed" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
<exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyFailed" name="BuyFailedRespondExchange" type="//@typeDefinitions/(a)informationTypes.1" action="Respond" faultName="BuyFailed">
- <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... type of destination;enum;endpoint address,service name;service name}}" />
		dynamicReplyTo="{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
</exchangeDetails>
</activities>
</activities>
Modified: trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/ValidatorConfigGenerator.java
===================================================================
--- trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/ValidatorConfigGenerator.java 2010-09-06 16:53:49 UTC (rev 392)
+++ trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/ValidatorConfigGenerator.java 2010-09-07 12:53:47 UTC (rev 393)
@@ -23,6 +23,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import org.jboss.util.xml.DOMWriter;
import org.pi4soa.cdl.*;
import org.pi4soa.common.annotations.*;
@@ -70,6 +71,10 @@
e.printStackTrace();
}
+ if (logger.isDebugEnabled()) {
+ logger.debug(DOMWriter.printNode(ret, true));
+ }
+
return(ret);
}
@@ -128,6 +133,8 @@
public class InputOutputAnalyser extends DefaultCDLVisitor {
+ private static final String DESTINATION_TYPE_ENDPOINT_ADDRESS = "endpoint address";
+ private static final String TYPE_ATTR = "type";
private static final String DYNAMIC_REPLY_TO_ATTR = "dynamicReplyTo";
private static final String VALIDATOR_ANNOTATION = "validator";
private static final String VALIDATOR_ELEMENT = "validator";
@@ -240,43 +247,45 @@
if (from) {
if (details.getAction() == ExchangeActionType.REQUEST) {
elemName = OUTPUT_ELEMENT;
- } else {
+ } else if (dest.getAttribute(TYPE_ATTR).equals(DESTINATION_TYPE_ENDPOINT_ADDRESS)) {
elemName = INPUT_ELEMENT;
}
} else {
if (details.getAction() == ExchangeActionType.REQUEST) {
elemName = INPUT_ELEMENT;
- } else {
+ } else if (dest.getAttribute(TYPE_ATTR).equals(DESTINATION_TYPE_ENDPOINT_ADDRESS)) {
elemName = OUTPUT_ELEMENT;
}
}
- org.w3c.dom.Element elem=m_service.getOwnerDocument().createElement(elemName);
-
- // Parameter has been stored in a structured manner
- // to support use of templates and presentations,
- // so need to extract the value
- java.util.List<TemplateParameter> params=
- m_templateProcessor.getTemplateParameters(dest.getAttribute(NAME_ATTR));
-
- if (params != null && params.size() > 0) {
- elem.setAttribute(EPR_ATTR, params.get(0).getValue());
- }
-
- if (dest.hasAttribute(DYNAMIC_REPLY_TO_ATTR)) {
- params=m_templateProcessor.getTemplateParameters(dest.getAttribute(DYNAMIC_REPLY_TO_ATTR));
-
+ if (elemName != null) {
+ org.w3c.dom.Element elem=m_service.getOwnerDocument().createElement(elemName);
+
+ // Parameter has been stored in a structured manner
+ // to support use of templates and presentations,
+ // so need to extract the value
+ java.util.List<TemplateParameter> params=
+ m_templateProcessor.getTemplateParameters(dest.getAttribute(NAME_ATTR));
+
if (params != null && params.size() > 0) {
-
- if (params.get(0).getValue().equalsIgnoreCase("true")) {
- elem.setAttribute(DYNAMIC_REPLY_TO_ATTR, "true");
+ elem.setAttribute(EPR_ATTR, params.get(0).getValue());
+ }
+
+ if (dest.hasAttribute(DYNAMIC_REPLY_TO_ATTR)) {
+ params=m_templateProcessor.getTemplateParameters(dest.getAttribute(DYNAMIC_REPLY_TO_ATTR));
+
+ if (params != null && params.size() > 0) {
+
+ if (params.get(0).getValue().equalsIgnoreCase("true")) {
+ elem.setAttribute(DYNAMIC_REPLY_TO_ATTR, "true");
+ }
}
}
+
+ if (elem.hasAttribute(EPR_ATTR)) {
+ m_service.appendChild(elem);
+ }
}
-
- if (elem.hasAttribute(EPR_ATTR)) {
- m_service.appendChild(elem);
- }
}
}
13 years, 8 months