airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject svn commit: r1470292 - in /airavata/sandbox/grid-tools/jsdl-generator: ./ src/main/java/org/apache/airavata/gridtools/jsdl/ src/main/resources/
Date Sun, 21 Apr 2013 12:31:22 GMT
Author: smarru
Date: Sun Apr 21 12:31:22 2013
New Revision: 1470292

URL: http://svn.apache.org/r1470292
Log:
Changing to XMlBeans as discussed in - AIRAVATA-656

Added:
    airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-hpcpa.xsd   (with props)
    airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-schemas.xsdconfig
    airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-spmd.xsd   (with props)
Modified:
    airavata/sandbox/grid-tools/jsdl-generator/pom.xml
    airavata/sandbox/grid-tools/jsdl-generator/src/main/java/org/apache/airavata/gridtools/jsdl/GenerateJSDLExample.java

Modified: airavata/sandbox/grid-tools/jsdl-generator/pom.xml
URL: http://svn.apache.org/viewvc/airavata/sandbox/grid-tools/jsdl-generator/pom.xml?rev=1470292&r1=1470291&r2=1470292&view=diff
==============================================================================
--- airavata/sandbox/grid-tools/jsdl-generator/pom.xml (original)
+++ airavata/sandbox/grid-tools/jsdl-generator/pom.xml Sun Apr 21 12:31:22 2013
@@ -1,15 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you 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. -->
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements. See the NOTICE file 
+	distributed with this work for additional information regarding copyright ownership. The
ASF licenses this file to you 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. -->
 
 <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">
@@ -23,53 +20,111 @@
 	<packaging>jar</packaging>
 	<url>http://airavata.apache.org/</url>
 
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+		<org.slf4j.version>1.7.2</org.slf4j.version>
+		<axiom.version>1.2.8</axiom.version>
+		<surefire.version>2.12</surefire.version>
+		<junit.version>4.7</junit.version>
+		<xmlbeans.version>2.5.0</xmlbeans.version>
+		<xpp3.version>1.1.3_7</xpp3.version>
+		<skipTests>false</skipTests>
+	</properties>
+
 	<dependencies>
 
 		<dependency>
-			<groupId>javax.xml.bind</groupId>
-			<artifactId>jaxb-api</artifactId>
-			<version>2.2.7</version>
+			<groupId>org.apache.xmlbeans</groupId>
+			<artifactId>xmlbeans</artifactId>
+			<version>${xmlbeans.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>wsdl4j</groupId>
+			<artifactId>wsdl4j</artifactId>
+			<version>1.6.2</version>
+		</dependency>
+
+		<dependency>
+			<groupId>xpp3</groupId>
+			<artifactId>xpp3</artifactId>
+			<version>1.1.4c</version>
 		</dependency>
 
 		<dependency>
-			<groupId>com.sun.xml.bind</groupId>
-			<artifactId>jaxb-impl</artifactId>
-			<version>2.2.7-b41</version>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+			<version>${org.slf4j.version}</version>
 		</dependency>
 
+		<!-- Testing -->
 		<dependency>
-			<groupId>com.sun.xml.bind</groupId>
-			<artifactId>jaxb-xjc</artifactId>
-			<version>2.2.7-b41</version>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
 		</dependency>
 
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>jcl-over-slf4j</artifactId>
+			<version>${org.slf4j.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+			<version>${org.slf4j.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+
 	</dependencies>
 
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<version>3.0</version>
-			</plugin>
-			<plugin>
-				<groupId>org.codehaus.mojo</groupId>
-				<artifactId>jaxb2-maven-plugin</artifactId>
-				<version>1.5</version>
-				<executions>
-					<execution>
-						<id>jsdl-schemas</id>
-						<goals>
-							<goal>xjc</goal>
-						</goals>
-					</execution>
-				</executions>
-				<configuration>
-					<schemaDirectory>src/main/resources</schemaDirectory>
-					<packageName>org.ogf.jsdl</packageName>
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
+   <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.7</version>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>${basedir}/target/generated-sources/xmlbeans</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>xmlbeans-maven-plugin</artifactId>
+                <version>2.3.3</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>xmlbeans</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <inherited>true</inherited>
+                <configuration>
+                    <schemaDirectory>src/main/resources</schemaDirectory>
+                    <xmlConfigs>
+                        <xmlConfig implementation="java.io.File">src/main/resources/jsdl-schemas.xsdconfig</xmlConfig>
+                    </xmlConfigs>
+                    <outputJar>target/generated/${project.artifactId}-${project.version}.jar</outputJar>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 
 </project>

Modified: airavata/sandbox/grid-tools/jsdl-generator/src/main/java/org/apache/airavata/gridtools/jsdl/GenerateJSDLExample.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/grid-tools/jsdl-generator/src/main/java/org/apache/airavata/gridtools/jsdl/GenerateJSDLExample.java?rev=1470292&r1=1470291&r2=1470292&view=diff
==============================================================================
--- airavata/sandbox/grid-tools/jsdl-generator/src/main/java/org/apache/airavata/gridtools/jsdl/GenerateJSDLExample.java
(original)
+++ airavata/sandbox/grid-tools/jsdl-generator/src/main/java/org/apache/airavata/gridtools/jsdl/GenerateJSDLExample.java
Sun Apr 21 12:31:22 2013
@@ -23,18 +23,14 @@ package org.apache.airavata.gridtools.js
 
 import java.io.StringWriter;
 
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-
-import org.ogf.jsdl.ApplicationType;
-import org.ogf.jsdl.FileNameType;
-import org.ogf.jsdl.JobDefinitionType;
-import org.ogf.jsdl.JobDescriptionType;
-import org.ogf.jsdl.JobIdentificationType;
-import org.ogf.jsdl.ObjectFactory;
-import org.ogf.jsdl.POSIXApplicationType;
+import org.apache.xmlbeans.ObjectFactory;
+import org.ogf.schemas.jsdl.ApplicationType;
+import org.ogf.schemas.jsdl.JobDefinitionDocument;
+import org.ogf.schemas.jsdl.JobDefinitionType;
+import org.ogf.schemas.jsdl.JobDescriptionType;
+import org.ogf.schemas.jsdl.JobIdentificationType;
+import org.ogf.schemas.jsdl.posix.FileNameType;
+import org.ogf.schemas.jsdl.posix.POSIXApplicationType;
 
 public class GenerateJSDLExample {
 
@@ -43,45 +39,50 @@ public class GenerateJSDLExample {
      */
     public static void main(String[] args) {
 
-        try {
-
-            ObjectFactory jsdlObjFact = new ObjectFactory();
-            JobDefinitionType jsdlJobDefType = jsdlObjFact.createJobDefinitionType();
-            JobDescriptionType jsdlJobDescType = jsdlObjFact.createJobDescriptionType();
-            
-            
-            JobIdentificationType jsdlJobIdenType = jsdlObjFact.createJobIdentificationType();
-            jsdlJobIdenType.setJobName("Airavata Test");
-            jsdlJobIdenType.setDescription("Airavata JSDL Test Job");
-            jsdlJobDescType.setJobIdentification(jsdlJobIdenType);
-            
-            POSIXApplicationType jsdlPosixAppType = jsdlObjFact.createPOSIXApplicationType();
-            FileNameType execFileType = jsdlObjFact.createFileNameType();
-            execFileType.setValue("/bin/date");
-            jsdlPosixAppType.setExecutable(execFileType);
-            JAXBElement<POSIXApplicationType> jsdlPosixApp = jsdlObjFact.createPOSIXApplication(jsdlPosixAppType);
-            
-            ApplicationType jsdlAppType = jsdlObjFact.createApplicationType();
-            jsdlAppType.setApplicationName("Test Date");
-            jsdlAppType.setApplicationVersion("v1.0");
-            jsdlAppType.setDescription("Testing Date");
-            jsdlAppType.getAny().add(jsdlPosixApp);
-            jsdlJobDescType.setApplication(jsdlAppType);          
-            
-            jsdlJobDefType.setJobDescription(jsdlJobDescType);
-            JAXBElement<JobDefinitionType> jsdlJobDef = jsdlObjFact.createJobDefinition(jsdlJobDefType);
-
-            //generate the required jsdl
-            JAXBContext jaxbContext = JAXBContext.newInstance(new Class[] { JobDefinitionType.class
});
-            StringWriter jsdlXMLString = new StringWriter();
-            Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
-            jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
-            jaxbMarshaller.marshal(jsdlJobDef, jsdlXMLString);
-            System.out.println(jsdlXMLString.toString());
-         
-        } catch (JAXBException e) {
-            e.printStackTrace();
-        }
+//        try {
+//
+//            JobDefinitionDocument jobDefDoc = JobDefinitionDocument.Factory
+//                    .newInstance();
+//            JobDefinitionType jobDef = jobDefDoc.addNewJobDefinition();
+//            
+//            jobDef.addNewJobDescription().addNewResources() addNewJobDescription();
+//            
+//            ObjectFactory jsdlObjFact = new ObjectFactory();
+//            JobDefinitionType jsdlJobDefType = jsdlObjFact.createJobDefinitionType();
+//            JobDescriptionType jsdlJobDescType = jsdlObjFact.createJobDescriptionType();
+//                   
+//            JobIdentificationType jsdlJobIdenType = jsdlObjFact.createJobIdentificationType();
+//            jsdlJobIdenType.setJobName("Airavata Test");
+//            jsdlJobIdenType.setDescription("Airavata JSDL Test Job");
+//            jsdlJobDescType.setJobIdentification(jsdlJobIdenType);
+//            
+//            POSIXApplicationType jsdlPosixAppType = jsdlObjFact.createPOSIXApplicationType();
+//            FileNameType execFileType = jsdlObjFact.
+//            execFileType.setValue("/bin/date");
+//            jsdlPosixAppType.setExecutable(execFileType);
+//            JAXBElement<POSIXApplicationType> jsdlPosixApp = jsdlObjFact.createPOSIXApplication(jsdlPosixAppType);
+//            
+//            ApplicationType jsdlAppType = jsdlObjFact.createApplicationType();
+//            jsdlAppType.setApplicationName("Test Date");
+//            jsdlAppType.setApplicationVersion("v1.0");
+//            jsdlAppType.setDescription("Testing Date");
+//            jsdlAppType.getAny().add(jsdlPosixApp);
+//            jsdlJobDescType.setApplication(jsdlAppType);          
+//            
+//            jsdlJobDefType.setJobDescription(jsdlJobDescType);
+//            JAXBElement<JobDefinitionType> jsdlJobDef = jsdlObjFact.createJobDefinition(jsdlJobDefType);
+//
+//            //generate the required jsdl
+//            JAXBContext jaxbContext = JAXBContext.newInstance(new Class[] { JobDefinitionType.class
});
+//            StringWriter jsdlXMLString = new StringWriter();
+//            Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
+//            jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+//            jaxbMarshaller.marshal(jsdlJobDef, jsdlXMLString);
+//            System.out.println(jsdlXMLString.toString());
+//         
+//        } catch (JAXBException e) {
+//            e.printStackTrace();
+//        }
 
     }
 

Added: airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-hpcpa.xsd
URL: http://svn.apache.org/viewvc/airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-hpcpa.xsd?rev=1470292&view=auto
==============================================================================
Binary file - no diff available.

Propchange: airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-hpcpa.xsd
------------------------------------------------------------------------------
    svn:mime-type = application/xml

Added: airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-schemas.xsdconfig
URL: http://svn.apache.org/viewvc/airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-schemas.xsdconfig?rev=1470292&view=auto
==============================================================================
--- airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-schemas.xsdconfig (added)
+++ airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-schemas.xsdconfig Sun
Apr 21 12:31:22 2013
@@ -0,0 +1,27 @@
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements. See the NOTICE file 
+	distributed with this work for additional information regarding copyright ownership. The
ASF licenses this file to you 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. -->
+	
+<xb:config  xmlns:xb="http://www.bea.com/2002/09/xbean/config">
+    
+    <xb:namespace uri="http://schemas.ggf.org/jsdl/2005/11/jsdl">
+        <xb:package>org.ogf.schemas.jsdl</xb:package>
+    </xb:namespace>
+    
+    <xb:namespace uri="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix">
+        <xb:package>org.ogf.schemas.jsdl.posix</xb:package>
+    </xb:namespace>
+    
+    <xb:namespace uri="http://schemas.ogf.org/jsdl/2007/02/jsdl-spmd">
+        <xb:package>org.ogf.schemas.jsdl.spmd</xb:package>
+    </xb:namespace>
+  
+    <xb:namespace uri="http://schemas.ggf.org/jsdl/2006/07/jsdl-hpcpa">
+        <xb:package>org.ogf.schemas.jsdl.hpcpa</xb:package>
+    </xb:namespace>
+      
+</xb:config>
\ No newline at end of file

Added: airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-spmd.xsd
URL: http://svn.apache.org/viewvc/airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-spmd.xsd?rev=1470292&view=auto
==============================================================================
Binary file - no diff available.

Propchange: airavata/sandbox/grid-tools/jsdl-generator/src/main/resources/jsdl-spmd.xsd
------------------------------------------------------------------------------
    svn:mime-type = application/xml



Mime
View raw message