Author: lahiru
Date: Thu Feb  7 17:20:35 2013
New Revision: 1443609

URL: http://svn.apache.org/viewvc?rev=1443609&view=rev
Log:
integrating new gfac with xbaya.

Modified:
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java?rev=1443609&r1=1443608&r2=1443609&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
 Thu Feb  7 17:20:35 2013
@@ -812,7 +812,6 @@ public class XBayaConfiguration extends 
         notifyObservers(o);
     }
 
-    @Override
     public void update(Observable observable, Object o) {
         triggerObservers(observable);
     }

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java?rev=1443609&r1=1443608&r2=1443609&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
 Thu Feb  7 17:20:35 2013
@@ -262,10 +262,10 @@ public class XBayaEngine {
                                        this.getConfiguration()
                                                        
.setWorkflowInterpreterURL(interpreterServiceURLList.get(0));
                                }
-                               List<URI> gfacURLList = 
airavataManager.getGFaCURLs();
-                               if (gfacURLList.size()>0) {
-                                       
this.getConfiguration().setGFacURL(gfacURLList.get(0));
-                               }
+//                             List<URI> gfacURLList = 
airavataManager.getGFaCURLs();
+//                             if (gfacURLList.size()>0) {
+//                                     
this.getConfiguration().setGFacURL(gfacURLList.get(0));
+//                             }
                        }
         } catch (Exception e) {
                        e.printStackTrace();

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java?rev=1443609&r1=1443608&r2=1443609&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
 Thu Feb  7 17:20:35 2013
@@ -1074,8 +1074,14 @@ public class WorkflowInterpreter {
                                invoker = new 
WorkflowInvokerWrapperForGFacInvoker(portTypeQName, gfacURLString, 
this.getConfig().getConfiguration().getMessageBoxURL()
                                                .toString(), leadCtxHeader, 
this.config.getNotifier().createServiceNotificationSender(foreachWSNode.getID()));
                        } else {
-                               invoker = new GenericInvoker(portTypeQName, 
wsdlLocation, foreachWSNode.getID(), 
this.getConfig().getConfiguration().getMessageBoxURL()
-                                               .toString(), gfacURLString, 
this.config.getNotifier());
+                if (this.config.isGfacEmbeddedMode()) {
+                                       invoker = new 
EmbeddedGFacInvoker(portTypeQName, 
WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(((WSNode)foreachWSNode).getComponent().getWSDL()),
 foreachWSNode.getID(),
+                                                       
this.config.getMessageBoxURL().toASCIIString(), 
this.config.getMessageBrokerURL().toASCIIString(), this.config.getNotifier(),
+                                                       this.config.getTopic(), 
this.config.getAiravataAPI(), portTypeQName.getLocalPart(), 
this.config.getConfiguration());
+                               } else {
+                                       invoker = new 
GenericInvoker(portTypeQName, 
WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(((WSNode)foreachWSNode).getComponent().getWSDL()),
 foreachWSNode.getID(),
+                                                       
this.config.getMessageBoxURL().toASCIIString(), gfacURLString, 
this.config.getNotifier());
+                               }
                        }
 
                } else {

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java?rev=1443609&r1=1443608&r2=1443609&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
 Thu Feb  7 17:20:35 2013
@@ -288,9 +288,9 @@ public class WorkflowInterpretorSkeleton
                 msgBroker = 
getAiravataAPI().getAiravataManager().getEventingServiceURL().toASCIIString();
             }
             String gfac =  
parse.getContextHeader().getSoaServiceEprs().getGfacUrl();
-            if(gfac == null || "".equals(gfac)){
-                gfac = 
getAiravataAPI().getAiravataManager().getGFaCURLs().get(0).toString();
-            }
+//            if(gfac == null || "".equals(gfac)){
+//                gfac = 
getAiravataAPI().getAiravataManager().getGFaCURLs().get(0).toString();
+//            }
             configuration.put(BROKER, msgBroker);
             configuration.put(GFAC, gfac);
             configuration.put(MSGBOX, msgBox);

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java?rev=1443609&r1=1443608&r2=1443609&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
 Thu Feb  7 17:20:35 2013
@@ -20,7 +20,9 @@
 */
 package org.apache.airavata.xbaya.invoker;
 
+import java.io.File;
 import java.io.StringReader;
+import java.net.URL;
 import java.util.*;
 
 import javax.xml.namespace.QName;
@@ -30,20 +32,20 @@ import javax.xml.stream.XMLStreamReader;
 
 import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.client.api.AiravataAPIInvocationException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.commons.gfac.type.*;
 import org.apache.airavata.core.gfac.exception.ProviderException;
+import org.apache.airavata.gfac.Constants;
+import org.apache.airavata.gfac.GFacAPI;
+import org.apache.airavata.gfac.GFacConfiguration;
+import org.apache.airavata.gfac.context.ApplicationContext;
+import org.apache.airavata.gfac.context.JobExecutionContext;
+import org.apache.airavata.gfac.context.MessageContext;
+import org.apache.airavata.gfac.provider.GFacProviderException;
+import org.apache.airavata.gfac.utils.GFacUtils;
 import org.apache.airavata.registry.api.exception.RegistryException;
 import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.core.gfac.GfacAPI;
-import org.apache.airavata.core.gfac.context.GFacConfiguration;
-import org.apache.airavata.core.gfac.context.JobContext;
-import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
-import org.apache.airavata.core.gfac.context.message.impl.ParameterContextImpl;
-import org.apache.airavata.core.gfac.utils.GfacUtils;
-import org.apache.airavata.schemas.gfac.InputParameterType;
-import org.apache.airavata.schemas.gfac.Parameter;
-import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
+import org.apache.airavata.schemas.gfac.*;
 import org.apache.airavata.workflow.model.exceptions.WorkflowException;
 import org.apache.airavata.xbaya.XBayaConfiguration;
 import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
@@ -108,7 +110,7 @@ public class EmbeddedGFacInvoker impleme
 
     private Object outPut;
 
-    Map<Parameter, ActualParameter> actualParameters = new 
LinkedHashMap<Parameter, ActualParameter>();
+    Map<String, Object> actualParameters = new LinkedHashMap<String, Object>();
 
     /**
      * Creates an InvokerWithNotification.
@@ -242,66 +244,66 @@ public class EmbeddedGFacInvoker impleme
      */
     public synchronized boolean invoke() throws WorkflowException {
         try {
-            OMElement inputMessage = createActualParameters();
+
+            //todo This is the basic scheduling, have to do proper scheduling 
implementation
+            ServiceDescription serviceDescription = 
airavataAPI.getApplicationManager().getServiceDescription(serviceName);
+            HostDescription registeredHost = getRegisteredHost(airavataAPI, 
this.serviceName);
+            ApplicationDescription applicationDescription = 
airavataAPI.getApplicationManager().getApplicationDescription(serviceName, 
registeredHost.getType().getHostName());
+
+            // When we run getInParameters we set the actualParameter object, 
this has to be fixed
+            URL resource = 
EmbeddedGFacInvoker.class.getClassLoader().getResource("gfac-config.xml");
+            OMElement inputMessage = getInParameters();
             Object wsifMessageElement = new 
WSIFMessageElement(XMLUtil.stringToXmlElement3(inputMessage.toStringWithConsume()));
-            this.notifier.invokingService(new 
WSIFMessageElement((XmlElement)wsifMessageElement));
-            JobContext jobContext = new JobContext(actualParameters, 
EmbeddedGFacInvoker.this.topic,
-                    EmbeddedGFacInvoker.this.serviceName, 
EmbeddedGFacInvoker.this.gfacURL);
-            GFacConfiguration gFacConfiguration = new 
GFacConfiguration(EmbeddedGFacInvoker.this.configuration.getMyProxyServer(),
-                    
EmbeddedGFacInvoker.this.configuration.getMyProxyUsername(),
-                    
EmbeddedGFacInvoker.this.configuration.getMyProxyPassphrase(), 
EmbeddedGFacInvoker.this.configuration.getMyProxyLifetime(),
-                    EmbeddedGFacInvoker.this.airavataAPI, 
EmbeddedGFacInvoker.this.configuration.getTrustedCertLocation());
-
-            GfacAPI gfacAPI1 = new GfacAPI();
-            InvocationContext defaultInvocationContext = 
gfacAPI1.gridJobSubmit(jobContext,
-                    gFacConfiguration, this.nodeID, 
this.notifier.getWorkflowID().toASCIIString());
-            ParameterContextImpl outputParamContext = (ParameterContextImpl) 
defaultInvocationContext
-                    .<ActualParameter>getMessageContext("output");
-            if (outputParamContext.getNames().hasNext()) {
+            this.notifier.invokingService(new WSIFMessageElement((XmlElement) 
wsifMessageElement));
+            GFacConfiguration gFacConfiguration = GFacConfiguration.create(new 
File(resource.getPath()), airavataAPI, ServerSettings.getProperties());
+            JobExecutionContext jobExecutionContext = new 
JobExecutionContext(gFacConfiguration, serviceName);
+
+            
jobExecutionContext.setProperty(Constants.PROP_WORKFLOW_NODE_ID,this.nodeID);
+            
jobExecutionContext.setProperty(Constants.PROP_TOPIC,this.configuration.getTopic());
+            
jobExecutionContext.setProperty(Constants.PROP_BROKER_URL,this.configuration.getBrokerURL().toASCIIString());
+            
jobExecutionContext.setProperty(Constants.PROP_WORKFLOW_INSTANCE_ID,this.configuration.getTopic());
+
+            ApplicationContext applicationContext = new ApplicationContext();
+            
applicationContext.setApplicationDeploymentDescription(applicationDescription);
+            applicationContext.setHostDescription(registeredHost);
+            applicationContext.setServiceDescription(serviceDescription);
+
+            jobExecutionContext.setApplicationContext(applicationContext);
+
+            
jobExecutionContext.setOutMessageContext(getOutParameters(serviceDescription));
+            jobExecutionContext.setInMessageContext(new 
MessageContext(actualParameters));
+
+            GFacAPI gfacAPI1 = new GFacAPI();
+            gfacAPI1.submitJob(jobExecutionContext);
+
+            OMFactory fac = OMAbstractFactory.getOMFactory();
+            OMNamespace omNs = 
fac.createOMNamespace("http://ws.apache.org/axis2/xsd";, "ns1");
+            OMElement outputElement = fac.createOMElement("invokeResponse", 
omNs);
+            MessageContext outMessageContext = 
jobExecutionContext.getOutMessageContext();
+            Set<String> paramNames = 
outMessageContext.getParameters().keySet();
+            for (String paramName : paramNames) {
                 /*
                 * Process Output
                 */
-                OMFactory fac = OMAbstractFactory.getOMFactory();
-                OMNamespace omNs = 
fac.createOMNamespace("http://ws.apache.org/axis2/xsd";, "ns1");
-                OMElement outputElement = 
fac.createOMElement("invokeResponse", omNs);
-
-                for (Iterator<String> iterator = 
outputParamContext.getNames(); iterator.hasNext(); ) {
-                    String name = iterator.next();
-                    String outputString = 
outputParamContext.getValue(name).toXML().replaceAll("GFacParameter", name);
-                    XMLStreamReader reader = 
XMLInputFactory.newInstance().createXMLStreamReader(new 
StringReader(outputString));
-                    StAXOMBuilder builder = new StAXOMBuilder(reader);
-                    outputElement.addChild(builder.getDocumentElement());
-                }
-                // Send notification
-                logger.debug("outputMessage: " + outputElement.toString());
-                outPut = new 
WSIFMessageElement(XMLUtil.stringToXmlElement3(outputElement.toStringWithConsume()));
-                this.result = true;
-                EmbeddedGFacInvoker.this.notifier.serviceFinished(new 
WSIFMessageElement((XmlElement) outPut));
-            } else {
-                // An implementation of WSIFMessage,
-                // WSIFMessageElement, implements toString(), which
-                // serialize the message XML.
-                EmbeddedGFacInvoker.this.notifier.receivedFault(new 
WSIFMessageElement(XMLUtil.stringToXmlElement3("<Message>Invocation 
Failed</Message>")));
-                EmbeddedGFacInvoker.this.failerSent = true;
+                String outputString = ((ActualParameter) 
outMessageContext.getParameter(paramName)).toXML().replaceAll("GFacParameter", 
paramName);
+                XMLStreamReader reader = 
XMLInputFactory.newInstance().createXMLStreamReader(new 
StringReader(outputString));
+                StAXOMBuilder builder = new StAXOMBuilder(reader);
+                outputElement.addChild(builder.getDocumentElement());
             }
-
-
-            // Check if the invocation itself fails. This happens immediately.
-//            try {
-//                this.result.get(100, TimeUnit.MILLISECONDS);
-//            } catch (InterruptedException e) {
-//                logger.error(e.getMessage(), e);
-//            } catch (TimeoutException e) {
-//                // The job is probably running fine.
-//                // The normal case.
-//                return true;
-//            } catch (ExecutionException e) {
-//                // The service-failed notification should have been sent
-//                // already.
-//                logger.error(e.getMessage(), e);
-//                String message = "Error in invoking a service: " + 
this.serviceInformation;
-//                throw new WorkflowException(message, e);
+            // Send notification
+            logger.debug("outputMessage: " + outputElement.toString());
+            outPut = new 
WSIFMessageElement(XMLUtil.stringToXmlElement3(outputElement.toStringWithConsume()));
+            this.result = true;
+            EmbeddedGFacInvoker.this.notifier.serviceFinished(new 
WSIFMessageElement((XmlElement) outPut));
+            //todo check whether ActualParameter values are set or not, if 
they are null have to through an error or handle this in gfac level.
+//             {
+//                // An implementation of WSIFMessage,
+//                // WSIFMessageElement, implements toString(), which
+//                // serialize the message XML.
+//                EmbeddedGFacInvoker.this.notifier.receivedFault(new 
WSIFMessageElement(XMLUtil.stringToXmlElement3("<Message>Invocation 
Failed</Message>")));
+//                EmbeddedGFacInvoker.this.failerSent = true;
 //            }
+
         } catch (RuntimeException e) {
             logger.error(e.getMessage(), e);
             String message = "Error in invoking a service: " + 
this.serviceInformation;
@@ -312,13 +314,6 @@ public class EmbeddedGFacInvoker impleme
             String message = "Unexpected error: " + this.serviceInformation;
             this.notifier.invocationFailed(message, e);
             throw new WorkflowException(message, e);
-        } catch(ProviderException e){
-            if (e.getAditionalInfo().length > 0) {
-                this.notifier.invocationFailed(e.getMessage() + "\n" + 
e.getAditionalInfo()[0], e);
-            } else {
-                this.notifier.invocationFailed(e.getMessage(), e);
-            }
-            throw new WorkflowException(e.getMessage(), e);
         } catch (Exception e) {
             this.notifier.invocationFailed(e.getMessage(), e);
             throw new WorkflowException(e.getMessage(), e);
@@ -373,8 +368,8 @@ public class EmbeddedGFacInvoker impleme
         try {
             waitToFinish();
             if (outPut instanceof XmlElement) {
-                    return ((XmlElement)((XmlElement)((XmlElement) 
outPut).children().next()).children().next()).children().next();
-            } else  {
+                return ((XmlElement) ((XmlElement) ((XmlElement) 
outPut).children().next()).children().next()).children().next();
+            } else {
                 return outPut;
             }
         } catch (WorkflowException e) {
@@ -405,22 +400,19 @@ public class EmbeddedGFacInvoker impleme
         return this.invoker.getOutputs();
     }
 
-    @Override
     public WSIFClient getClient() {
         return null;
     }
 
-    @Override
     public WSIFMessage getInputs() throws WorkflowException {
         return null;
     }
 
-    @Override
     public WSIFMessage getFault() throws WorkflowException {
         return null;
     }
 
-    private OMElement createActualParameters() throws 
AiravataAPIInvocationException, RegistryException, XMLStreamException {
+    private OMElement getInParameters() throws AiravataAPIInvocationException, 
RegistryException, XMLStreamException {
         OMFactory omFactory = OMAbstractFactory.getOMFactory();
         OMElement invoke_inputParams = omFactory.createOMElement(new 
QName("invoke_InputParams"));
         ServiceDescription serviceDescription = 
airavataAPI.getApplicationManager().getServiceDescription(this.serviceName);
@@ -434,17 +426,74 @@ public class EmbeddedGFacInvoker impleme
             Object value = this.inputValues.get(index);
             InputParameterType parameter = 
serviceDescriptionType.getInputParametersArray(index);
             if (value instanceof XmlElement) {
-                    
omElement.setText((String)((XmlElement)((XmlElement)((XmlElement) 
value).children().next()).children().next()).children().next());
+                omElement.setText((String) ((XmlElement) ((XmlElement) 
((XmlElement) value).children().next()).children().next()).children().next());
                 XMLStreamReader reader = 
XMLInputFactory.newInstance().createXMLStreamReader(new 
StringReader(XMLUtil.xmlElementToString((XmlElement) value)));
                 StAXOMBuilder builder = new StAXOMBuilder(reader);
                 OMElement input = builder.getDocumentElement();
-                actualParameters.put(parameter, 
GfacUtils.getInputActualParameter(parameter, input));
+                actualParameters.put(parameter.getParameterName(), 
GFacUtils.getInputActualParameter(parameter, input));
             } else if (value instanceof String) {
-                omElement.setText((String)value);
-                actualParameters.put(parameter, 
GfacUtils.getInputActualParameter(parameter, AXIOMUtil.stringToOM("<value>" + 
value + "</value>")));
+                omElement.setText((String) value);
+                actualParameters.put(parameter.getParameterName(), 
GFacUtils.getInputActualParameter(parameter, AXIOMUtil.stringToOM("<value>" + 
value + "</value>")));
             }
             invoke_inputParams.addChild(omElement);
         }
         return invoke_inputParams;
     }
+
+    private HostDescription getRegisteredHost(AiravataAPI regService, String 
serviceName) {
+        HostDescription result = null;
+        try {
+            Map<String, ApplicationDescription> applicationDescriptors = 
regService.getApplicationManager().getApplicationDescriptors(serviceName);
+            for (String hostDescName : applicationDescriptors.keySet()) {
+                HostDescription hostDescriptor = 
regService.getApplicationManager().getHostDescription(hostDescName);
+                result = hostDescriptor;
+                logger.info("Found service on: " + 
result.getType().getHostAddress());
+            }
+        } catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+    private MessageContext getOutParameters(ServiceDescription 
serviceDescription) {
+        MessageContext outContext = new MessageContext();
+        for (OutputParameterType parameter : 
serviceDescription.getType().getOutputParametersArray()) {
+            ActualParameter actualParameter = new ActualParameter();
+            if ("String".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(StringParameterType.type);
+            } else if 
("Double".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(DoubleParameterType.type);
+            } else if 
("Integer".equals(parameter.getParameterType().getName())) {
+                
actualParameter.getType().changeType(IntegerParameterType.type);
+            } else if ("Float".equals(parameter.getParameterType().getName())) 
{
+                actualParameter.getType().changeType(FloatParameterType.type);
+            } else if 
("Boolean".equals(parameter.getParameterType().getName())) {
+                
actualParameter.getType().changeType(BooleanParameterType.type);
+            } else if ("File".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(FileParameterType.type);
+            } else if ("URI".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(URIParameterType.type);
+            } else if 
("StringArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(StringArrayType.type);
+            } else if 
("DoubleArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(DoubleArrayType.type);
+            } else if 
("IntegerArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(IntegerArrayType.type);
+            } else if 
("FloatArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(FloatArrayType.type);
+            } else if 
("BooleanArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(BooleanArrayType.type);
+            } else if 
("FileArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(FileArrayType.type);
+            } else if 
("URIArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(URIArrayType.type);
+            } else if 
("StdOut".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(StdOutParameterType.type);
+            } else if 
("StdErr".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(StdErrParameterType.type);
+            }
+            outContext.addParameter(parameter.getParameterName(), 
actualParameter);
+        }
+        return outContext;
+    }
 }

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java?rev=1443609&r1=1443608&r2=1443609&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
 Thu Feb  7 17:20:35 2013
@@ -45,12 +45,12 @@ public class GFacURLs {
         this.airavataAPI = airavataAPI;
     }
 
-    public List<GFacURL> getURLS() throws AiravataAPIInvocationException {
-        List<GFacURL> urls = new ArrayList<GFacURL>();
-        List<URI> gfacDescriptorList = 
getAiravataAPI().getAiravataManager().getGFaCURLs();
-               for (URI url : gfacDescriptorList) {
-                   urls.add(new GFacURL(getAiravataAPI(), url));
-               }
-        return urls;
-    }
+//    public List<GFacURL> getURLS() throws AiravataAPIInvocationException {
+//        List<GFacURL> urls = new ArrayList<GFacURL>();
+//        List<URI> gfacDescriptorList = 
getAiravataAPI().getAiravataManager().getGFaCURLs();
+//             for (URI url : gfacDescriptorList) {
+//                 urls.add(new GFacURL(getAiravataAPI(), url));
+//             }
+//        return urls;
+//    }
 }

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java?rev=1443609&r1=1443608&r2=1443609&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
 Thu Feb  7 17:20:35 2013
@@ -47,7 +47,7 @@ public class AiravataConfigurationsNode 
     @Override
     protected List<TreeNode> getChildren() {
        List<Object> children=new ArrayList<Object>();
-       children.add(new GFacURLs(getRegistry()));
+//     children.add(new GFacURLs(getRegistry()));
        children.add(new InterpreterServiceURLs(getRegistry()));
        children.add(new MessageBoxURLs(getRegistry()));
        children.add(new EventingServiceURLs(getRegistry()));

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java?rev=1443609&r1=1443608&r2=1443609&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
 Thu Feb  7 17:20:35 2013
@@ -57,8 +57,8 @@ public class AiravataTreeNodeFactory {
             return new RegistryNode((XBayaEngine)o,parent);
         }else if (o instanceof AiravataConfigurations){
                        return new 
AiravataConfigurationsNode((AiravataConfigurations)o,parent);
-               }else if (o instanceof GFacURLs){
-                       return new GFacURLsNode((GFacURLs)o,parent);
+//             }else if (o instanceof GFacURLs){
+//                     return new GFacURLsNode((GFacURLs)o,parent);
                }else if (o instanceof GFacURL){
                        return new GFacURLNode((GFacURL)o,parent);
                }else if (o instanceof InterpreterServiceURLs){

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java?rev=1443609&r1=1443608&r2=1443609&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
 Thu Feb  7 17:20:35 2013
@@ -32,59 +32,60 @@ import org.apache.airavata.xbaya.model.r
 import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
 import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
 
-public class GFacURLsNode extends AbstractAiravataTreeNode {
-    private GFacURLs gfacURLs;
-
-    public GFacURLsNode(GFacURLs gfacURLs, TreeNode parent) {
-        super(parent);
-        setGfacURLs(gfacURLs);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        try {
-            return getTreeNodeList(getGfacURLs().getURLS().toArray(), this);
-        } catch (AiravataAPIInvocationException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, 
boolean hasFocus) {
-        return "GFac Locations";
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, 
boolean hasFocus) {
-        return JCRBrowserIcons.GFAC_URLS_ICON;
-    }
-
-    public GFacURLs getGfacURLs() {
-        return gfacURLs;
-    }
-
-    public void setGfacURLs(GFacURLs gfacURLs) {
-        this.gfacURLs = gfacURLs;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(RefreshAction.ID);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
+public class GFacURLsNode{
+//        extends AbstractAiravataTreeNode {
+//    private GFacURLs gfacURLs;
+//
+//    public GFacURLsNode(GFacURLs gfacURLs, TreeNode parent) {
+//        super(parent);
+//        setGfacURLs(gfacURLs);
+//    }
+//
+//    @Override
+//    protected List<TreeNode> getChildren() {
+//        try {
+//            return getTreeNodeList(getGfacURLs().getURLS().toArray(), this);
+//        } catch (AiravataAPIInvocationException e) {
+//            e.printStackTrace();
+//        }
+//        return null;
+//    }
+//
+//    @Override
+//    public String getCaption(boolean selected, boolean expanded, boolean 
leaf, boolean hasFocus) {
+//        return "GFac Locations";
+//    }
+//
+//    @Override
+//    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, 
boolean hasFocus) {
+//        return JCRBrowserIcons.GFAC_URLS_ICON;
+//    }
+//
+//    public GFacURLs getGfacURLs() {
+//        return gfacURLs;
+//    }
+//
+//    public void setGfacURLs(GFacURLs gfacURLs) {
+//        this.gfacURLs = gfacURLs;
+//    }
+//
+//    @Override
+//    public List<String> getSupportedActions() {
+//        return Arrays.asList(RefreshAction.ID);
+//    }
+//
+//    @Override
+//    public String getActionCaption(AbstractBrowserActionItem action) {
+//        return action.getDefaultCaption();
+//    }
+//
+//    @Override
+//    public Icon getActionIcon(AbstractBrowserActionItem action) {
+//        return null;
+//    }
+//
+//    @Override
+//    public String getActionDescription(AbstractBrowserActionItem action) {
+//        return null;
+//    }
 }

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java?rev=1443609&r1=1443608&r2=1443609&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
 Thu Feb  7 17:20:35 2013
@@ -93,7 +93,7 @@ public class DynamicWorkflowRunnerWindow
 
     // private XBayaComboBox resourceSelectionComboBox;
 
-    private JComboBox gfacUrlListField;
+//    private JComboBox gfacUrlListField;
 
     private JCheckBox interactChkBox;
 
@@ -121,20 +121,20 @@ public class DynamicWorkflowRunnerWindow
      */
     public void show() {
         this.workflow = this.engine.getGUI().getWorkflow();
-        List<URI> urlList=null;
-        try {
-            urlList = 
this.engine.getConfiguration().getAiravataAPI().getAiravataManager().getGFaCURLs();
-        } catch (AiravataAPIInvocationException e) {
-            e.printStackTrace();
-        }
+//        List<URI> urlList=null;
+//        try {
+//            urlList = 
this.engine.getConfiguration().getAiravataAPI().getAiravataManager().getGFaCURLs();
+//        } catch (AiravataAPIInvocationException e) {
+//            e.printStackTrace();
+//        }
         // When run xbaya continously urls can be repeating, so first remove 
everything and then add
-        this.gfacUrlListField.removeAllItems();
-        for (URI gfacUrl : urlList) {
-            if (XBayaUtil.isURLExists(gfacUrl + "?wsdl")) {
-                this.gfacUrlListField.addItem(gfacUrl);
-            }
-        }
-        this.gfacUrlListField.setEditable(true);
+//        this.gfacUrlListField.removeAllItems();
+//        for (URI gfacUrl : urlList) {
+//            if (XBayaUtil.isURLExists(gfacUrl + "?wsdl")) {
+//                this.gfacUrlListField.addItem(gfacUrl);
+//            }
+//        }
+//        this.gfacUrlListField.setEditable(true);
         MonitorConfiguration notifConfig = 
this.engine.getMonitor().getConfiguration();
         if (notifConfig.getBrokerURL() == null) {
             
this.engine.getGUI().getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
@@ -222,8 +222,8 @@ public class DynamicWorkflowRunnerWindow
 
         this.topicTextField = new XBayaTextField();
         XBayaLabel topicLabel = new XBayaLabel("Notification topic", 
this.topicTextField);
-        this.gfacUrlListField = new JComboBox();
-        XBayaLabel gfacURLLabel = new XBayaLabel("GFac URL", 
this.gfacUrlListField);
+//        this.gfacUrlListField = new JComboBox();
+//        XBayaLabel gfacURLLabel = new XBayaLabel("GFac URL", 
this.gfacUrlListField);
         this.interactChkBox = new JCheckBox();
         this.interactChkBox.setSelected(false);
         XBayaLabel interactLabel = new XBayaLabel("Enable Service 
Interactions", this.interactChkBox);
@@ -238,8 +238,8 @@ public class DynamicWorkflowRunnerWindow
         infoPanel.add(this.instanceNameTextField);
         infoPanel.add(topicLabel);
         infoPanel.add(this.topicTextField);
-        infoPanel.add(gfacURLLabel);
-        infoPanel.add(this.gfacUrlListField);
+//        infoPanel.add(gfacURLLabel);
+//        infoPanel.add(this.gfacUrlListField);
         infoPanel.add(interactLabel);
         infoPanel.add(this.interactChkBox);
         infoPanel.add(crossProductLabel);
@@ -332,14 +332,14 @@ public class DynamicWorkflowRunnerWindow
             inputNode.setDefaultValue(value);
         }
 
-        final String gFacUrl = ((URI) 
this.gfacUrlListField.getSelectedItem()).toASCIIString();
-        if (null != gFacUrl && !"".equals(gFacUrl)) {
-            try {
-                this.engine.getConfiguration().setGFacURL(new URI(gFacUrl));
-            } catch (URISyntaxException e) {
-                this.engine.getGUI().getErrorWindow().error(e);
-            }
-        }
+//        final String gFacUrl = ((URI) 
this.gfacUrlListField.getSelectedItem()).toASCIIString();
+//        if (null != gFacUrl && !"".equals(gFacUrl)) {
+//            try {
+//                this.engine.getConfiguration().setGFacURL(new URI(gFacUrl));
+//            } catch (URISyntaxException e) {
+//                this.engine.getGUI().getErrorWindow().error(e);
+//            }
+//        }
         this.engine.getConfiguration().setTopic(topic);
 
         /*


Reply via email to