airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1210676 - in /incubator/airavata/trunk/modules/commons/gfac-schema: schemas/GFacParameterTypes.xsd src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java
Date Mon, 05 Dec 2011 22:24:51 GMT
Author: lahiru
Date: Mon Dec  5 22:24:50 2011
New Revision: 1210676

URL: http://svn.apache.org/viewvc?rev=1210676&view=rev
Log:
adding new elements to schema.

Modified:
    incubator/airavata/trunk/modules/commons/gfac-schema/schemas/GFacParameterTypes.xsd
    incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java

Modified: incubator/airavata/trunk/modules/commons/gfac-schema/schemas/GFacParameterTypes.xsd
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/schemas/GFacParameterTypes.xsd?rev=1210676&r1=1210675&r2=1210676&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/schemas/GFacParameterTypes.xsd (original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/schemas/GFacParameterTypes.xsd Mon
Dec  5 22:24:50 2011
@@ -38,6 +38,8 @@
 			<enumeration value="FileArray" />
 			<enumeration value="DataID" />
 			<enumeration value="DataIDArray" />
+            <enumeration value="URIArray" />
+            <enumeration value="URI" />
 		</restriction>
 	</simpleType>
 
@@ -52,6 +54,17 @@
 		</complexContent>
 	</complexType>
 
+    <complexType name="URIParameterType">
+		<complexContent>
+			<extension base="gfac:ParameterType">
+				<sequence>
+					<element name="value" nillable="true" type="xsd:anyURI" />
+				</sequence>
+				<attribute name="type" fixed="URI" />
+			</extension>
+		</complexContent>
+	</complexType>
+
 	<complexType name="DoubleParameterType">
 		<complexContent>
 			<extension base="gfac:ParameterType">
@@ -130,6 +143,17 @@
 		</complexContent>
 	</complexType>
 
+    <complexType name="URIArrayType">
+		<complexContent>
+			<extension base="gfac:ParameterType">
+				<sequence >
+					<element name="value" nillable="true" maxOccurs="unbounded" type="xsd:anyURI"/>
+				</sequence>
+				<attribute name="type" fixed="URIArray" />
+			</extension>
+		</complexContent>
+	</complexType>
+
 	<complexType name="DoubleArrayType">
 		<complexContent>
 			<extension base="gfac:ParameterType">

Modified: incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java?rev=1210676&r1=1210675&r2=1210676&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java
(original)
+++ incubator/airavata/trunk/modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java
Mon Dec  5 22:24:50 2011
@@ -21,13 +21,10 @@
 
 package org.apache.airavata.commons.gfac.type;
 
-import org.apache.airavata.schemas.gfac.BooleanParameterType;
-import org.apache.airavata.schemas.gfac.DataType;
-import org.apache.airavata.schemas.gfac.DoubleParameterType;
-import org.apache.airavata.schemas.gfac.FileParameterType;
-import org.apache.airavata.schemas.gfac.FloatParameterType;
-import org.apache.airavata.schemas.gfac.IntegerParameterType;
-import org.apache.airavata.schemas.gfac.StringParameterType;
+import com.sun.xml.internal.fastinfoset.util.StringArray;
+import org.apache.airavata.schemas.gfac.*;
+
+import java.net.URI;
 
 /*
  * TODO use XML meta data instead of static coding
@@ -55,6 +52,22 @@ public class MappingFactory {
             return FileParameterType.class.getSimpleName();
         } else if (type.equals(DataType.FLOAT)) {
             return FloatParameterType.class.getSimpleName();
+        } else if (type.equals(DataType.URI)) {
+            return URIParameterType.class.getSimpleName();
+        } else if (type.equals(DataType.STRING_ARRAY)) {
+            return StringArrayType.class.getSimpleName();
+        } else if (type.equals(DataType.INTEGER_ARRAY)) {
+            return IntegerArrayType.class.getSimpleName();
+        } else if (type.equals(DataType.DOUBLE_ARRAY)) {
+            return DoubleArrayType.class.getSimpleName();
+        } else if (type.equals(DataType.BOOLEAN_ARRAY)) {
+            return BooleanArrayType.class.getSimpleName();
+        } else if (type.equals(DataType.FILE_ARRAY)) {
+            return FileArrayType.class.getSimpleName();
+        } else if (type.equals(DataType.FLOAT_ARRAY)) {
+            return FloatArrayType.class.getSimpleName();
+        } else if (type.equals(DataType.URI_ARRAY)) {
+            return URIArrayType.class.getSimpleName();
         }
         return StringParameterType.class.getSimpleName();
     }
@@ -79,6 +92,22 @@ public class MappingFactory {
             return ((FileParameterType) param.getType()).getValue();
         } else if (param.hasType(DataType.FLOAT)) {
             return String.valueOf(((FloatParameterType) param.getType()).getValue());
+        } else if (param.hasType(DataType.URI)) {
+            return String.valueOf(((URIParameterType) param.getType()).getValue());
+        } else if (param.hasType(DataType.STRING_ARRAY)) {
+            return String.valueOf(((StringArrayType) param.getType()).getValueArray());
+        } else if (param.hasType(DataType.INTEGER_ARRAY)) {
+            return String.valueOf(((IntegerArrayType) param.getType()).getValueArray());
+        } else if (param.hasType(DataType.DOUBLE_ARRAY)) {
+            return String.valueOf(((DoubleArrayType) param.getType()).getValueArray());
+        } else if (param.hasType(DataType.BOOLEAN_ARRAY)) {
+            return String.valueOf(((BooleanArrayType) param.getType()).getValueArray());
+        } else if (param.hasType(DataType.FILE_ARRAY)) {
+            return String.valueOf(((FileArrayType) param.getType()).getValueArray());
+        } else if (param.hasType(DataType.FLOAT_ARRAY)) {
+            return String.valueOf(((FloatArrayType) param.getType()).getValueArray());
+        } else if (param.hasType(DataType.URI_ARRAY)) {
+            return String.valueOf(((URIArrayType) param.getType()).getValueArray());
         }
         return null;
     }
@@ -102,6 +131,8 @@ public class MappingFactory {
             ((FileParameterType) param.getType()).setValue(val);
         } else if (param.hasType(DataType.FLOAT)) {
             ((FloatParameterType) param.getType()).setValue(Float.parseFloat(val));
+        } else if (param.hasType(DataType.URI)) {
+            ((URIParameterType) param.getType()).setValue((val));
         }
     }
 }



Mime
View raw message