[savara-commits] savara SVN: r396 - in trunk/tools/plugins: org.jboss.savara.tap.model/META-INF and 20 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Sep 14 12:35:13 EDT 2010


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 @@
  * &lt;complexType name="Link">
  *   &lt;complexContent>
  *     &lt;extension base="{http://www.savara.org/ta/project}Root">
- *       &lt;attribute name="fromModelName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       &lt;attribute name="toModelName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       &lt;attribute name="modelType" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="from" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="to" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
  *       &lt;anyAttribute processContents='lax' namespace='##other'/>
  *     &lt;/extension>
  *   &lt;/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 @@
  *       &lt;sequence>
  *         &lt;element name="resource" type="{http://www.savara.org/ta/project}Resource" maxOccurs="unbounded" minOccurs="0"/>
  *       &lt;/sequence>
- *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
  *       &lt;anyAttribute processContents='lax' namespace='##other'/>
  *     &lt;/extension>
  *   &lt;/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 @@
  *       &lt;sequence>
  *         &lt;element name="phase" type="{http://www.savara.org/ta/project}Phase" maxOccurs="unbounded" minOccurs="0"/>
  *       &lt;/sequence>
- *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
  *       &lt;anyAttribute processContents='lax' namespace='##other'/>
  *     &lt;/extension>
  *   &lt;/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 @@
  *       &lt;sequence>
  *         &lt;element name="link" type="{http://www.savara.org/ta/project}Link" maxOccurs="unbounded" minOccurs="0"/>
  *       &lt;/sequence>
- *       &lt;attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
- *       &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
+ *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
  *       &lt;anyAttribute processContents='lax' namespace='##other'/>
  *     &lt;/extension>
  *   &lt;/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 @@
  *         &lt;element name="uri" type="{http://www.savara.org/ta/project}URI" maxOccurs="unbounded" minOccurs="0"/>
  *         &lt;element name="relationship" type="{http://www.savara.org/ta/project}Relationship" maxOccurs="unbounded" minOccurs="0"/>
  *       &lt;/sequence>
- *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
  *       &lt;anyAttribute processContents='lax' namespace='##other'/>
  *     &lt;/extension>
  *   &lt;/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 @@
  * &lt;complexType name="URI">
  *   &lt;complexContent>
  *     &lt;extension base="{http://www.savara.org/ta/project}Root">
- *       &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       &lt;attribute name="context" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       &lt;attribute name="locator" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="context" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="locator" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
  *       &lt;anyAttribute processContents='lax' namespace='##other'/>
  *     &lt;/extension>
  *   &lt;/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);
+					}
 				}
 			}
 



More information about the savara-commits mailing list