You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2011/12/18 17:31:37 UTC

svn commit: r1220451 - in /incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya: XBayaConstants.java ode/ODEClient.java ode/ODEClientUtil.java

Author: lahiru
Date: Sun Dec 18 16:31:37 2011
New Revision: 1220451

URL: http://svn.apache.org/viewvc?rev=1220451&view=rev
Log:
fixing https://issues.apache.org/jira/browse/AIRAVATA-222.

Added:
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEClientUtil.java
Modified:
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEClient.java

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java?rev=1220451&r1=1220450&r2=1220451&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java Sun Dec 18 16:31:37 2011
@@ -193,6 +193,7 @@ public class XBayaConstants {
     public static final String REGISTRY_TYPE_APPLICATION_DESC = "ApplicationDesc";
     public static final String REGISTRY_TYPE_SERVICE_DESC = "ServiceDesc";
     public static final String REGISTRY_TYPE_WORKFLOW = "workflow";
+    public static final String HTTP_SCHEMAS_AIRAVATA_APACHE_ORG_GFAC_TYPE = "http://schemas.airavata.apache.org/gfac/type";
 
     /**
      * XRegistry Resource Types for OGCE Resource

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEClient.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEClient.java?rev=1220451&r1=1220450&r2=1220451&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEClient.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEClient.java Sun Dec 18 16:31:37 2011
@@ -22,7 +22,6 @@
 package org.apache.airavata.xbaya.ode;
 
 import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -42,8 +41,6 @@ import org.apache.airavata.xbaya.graph.s
 import org.apache.airavata.xbaya.graph.system.OutputNode;
 import org.apache.airavata.xbaya.lead.LEADTypes;
 import org.apache.airavata.xbaya.lead.LEADWorkflowInvoker;
-import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
-import org.apache.airavata.xbaya.monitor.MonitorConfiguration;
 import org.apache.airavata.xbaya.security.XBayaSecurity;
 import org.apache.airavata.xbaya.wf.Workflow;
 import org.ietf.jgss.GSSCredential;
@@ -51,7 +48,6 @@ import org.ietf.jgss.GSSCredential;
 import xsul.XmlConstants;
 import xsul.invoker.gsi.GsiInvoker;
 import xsul.lead.LeadContextHeader;
-import xsul.lead.LeadResourceMapping;
 import xsul5.wsdl.WsdlDefinitions;
 
 public class ODEClient {
@@ -142,7 +138,11 @@ public class ODEClient {
             value = valueString;
         } else {
             try {
-                value = XMLUtil.stringToXmlElement3(valueString);
+                if(XBayaConstants.HTTP_SCHEMAS_AIRAVATA_APACHE_ORG_GFAC_TYPE.equals(input.getType().getNamespaceURI())){
+                    value = XMLUtil.stringToXmlElement3(ODEClientUtil.createInputForGFacService(input,valueString));
+                }else {
+                    throw new XBayaRuntimeException("Input parameter, " + name + ", Unkown Type");
+                }
             } catch (RuntimeException e) {
                 throw new XBayaRuntimeException("Input parameter, " + name + ", is not valid XML", e);
             }

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEClientUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEClientUtil.java?rev=1220451&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEClientUtil.java (added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ode/ODEClientUtil.java Sun Dec 18 16:31:37 2011
@@ -0,0 +1,51 @@
+/*
+ *
+ * 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.
+ *
+*/
+package org.apache.airavata.xbaya.ode;
+
+import org.apache.airavata.xbaya.component.ws.WSComponentPort;
+
+public class ODEClientUtil {
+
+    public static String createInputForGFacService(WSComponentPort port,String input){
+        String paramType = port.getType().getLocalPart();
+        StringBuffer inputString = new StringBuffer("<");
+        if("StringParameterType".equals(paramType) || "URIParameterType".equals(paramType) ||
+                "DoubleParameterType".equals(paramType) || "IntegerParameterType".equals(paramType)
+                || "FloatParameterType".equals(paramType)|| "BooleanParameterType".equals(paramType)
+                || "FileParameterType".equals(paramType)){
+            inputString.append(port.getName()).append(">").
+                    append(getValueElement(input)).append("</").append(port.getName()).append(">");
+        }else if(paramType.endsWith("ArrayType")){
+            inputString.append(port.getName()).append(">");
+            String[] valueList = input.split(",");
+            for(String inputValue:valueList){
+                inputString.append(getValueElement(inputValue));
+            }
+            inputString.append(getValueElement(port.getName()));
+        }
+        inputString.append(">");
+        return inputString.toString();
+    }
+
+    private static String getValueElement(String value){
+       return "<value>" + value + "</value>";
+    }
+}