airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1190466 - in /incubator/airavata/trunk/modules: commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/ xbaya-gui/src/main/java/org/apache/airavata...
Date Fri, 28 Oct 2011 17:29:17 GMT
Author: lahiru
Date: Fri Oct 28 17:29:17 2011
New Revision: 1190466

URL: http://svn.apache.org/viewvc?rev=1190466&view=rev
Log:
fixing minor issue.

Modified:
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java?rev=1190466&r1=1190465&r2=1190466&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
(original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
Fri Oct 28 17:29:17 2011
@@ -239,7 +239,9 @@ public class JCRRegistry extends Observa
 				Property prop = app.getProperty(XML_PROPERTY_NAME);
 				result = ApplicationDeploymentDescription.fromXML(prop.getString());
 			}
-		} catch (Exception e) {
+		} catch (PathNotFoundException e){
+            return null;
+        }catch (Exception e) {
 			log.error("Cannot get Deployment Description", e);
 			throw new DeploymentDescriptionRetrieveException(e);
 		} finally {
@@ -276,7 +278,11 @@ public class JCRRegistry extends Observa
 			if (node != null) {
 				result = getHostDescriptor(node);
 			}
-		} catch (Exception e) {
+		} catch (PathNotFoundException e){
+            return null;
+        }catch (Exception e) {
+            log.debug(e.getMessage());
+            e.printStackTrace();
 			throw new HostDescriptionRetrieveException(e);
 		} finally {
 			closeSession(session);
@@ -516,9 +522,9 @@ public class JCRRegistry extends Observa
 		try {
 			session = getSession();
 			Node deploymentNode = getDeploymentNode(session);
-			Node serviceNode = deploymentNode.getNode(serviceName);
-			Node hostNode = serviceNode.getNode(hostName);
-			NodeIterator nodes = hostNode.getNodes();
+            Node serviceNode = deploymentNode.getNode(serviceName);
+            Node hostNode = serviceNode.getNode(hostName);
+            NodeIterator nodes = hostNode.getNodes();
 			for (; nodes.hasNext();) {
 				Node app = nodes.nextNode();
 				Property prop = app.getProperty(XML_PROPERTY_NAME);
@@ -527,7 +533,9 @@ public class JCRRegistry extends Observa
 					result.add(appDesc);
 				}
 			}
-		} catch (Exception e) {
+		}catch (PathNotFoundException e){
+            return result;
+        }catch (Exception e) {
 			throw new DeploymentDescriptionRetrieveException(e);
 		} finally {
 			closeSession(session);
@@ -550,7 +558,9 @@ public class JCRRegistry extends Observa
 				Property prop = app.getProperty(XML_PROPERTY_NAME);
 				result.add(ApplicationDeploymentDescription.fromXML(prop.getString()));
 			}
-		} catch (Exception e) {
+		}catch (PathNotFoundException e){
+            return result;
+        } catch (Exception e) {
 			throw new DeploymentDescriptionRetrieveException(e);
 		} finally {
 			closeSession(session);

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java?rev=1190466&r1=1190465&r2=1190466&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java
(original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java
Fri Oct 28 17:29:17 2011
@@ -1,5 +1,7 @@
 package org.apache.airavata.registry.api.util;
 
+import org.apache.airavata.schemas.gfac.InputParameterType;
+import org.apache.airavata.schemas.gfac.OutputParameterType;
 import org.apache.airavata.schemas.gfac.Parameter;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
 import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
@@ -25,7 +27,7 @@ public class WebServiceUtil {
             ServiceDescriptionType p = service.getType();
 
             for (int i = 0; i < p.getInputParametersArray().length; i++) {
-                generateElementFromType(p.getInputParametersArray(i), builder);
+                generateElementFromInputType(p.getInputParametersArray(i), builder);
             }
 
             builder.append("</xs:sequence>");
@@ -43,7 +45,7 @@ public class WebServiceUtil {
             ServiceDescriptionType p = service.getType();
 
             for (int i = 0; i < p.getOutputParametersArray().length; i++) {
-                generateElementFromType(p.getOutputParametersArray(i), builder);
+                generateElementFromOutputType(p.getOutputParametersArray(i), builder);
             }
 
             builder.append("</xs:sequence>");
@@ -81,28 +83,28 @@ public class WebServiceUtil {
         return builder.toString();
     }
 
-    private static void generateElementFromType(Parameter parameter, StringBuilder builder)
{
-    	/*
-        String type = parameter.getType().getType().toString();
+    private static void generateElementFromInputType(InputParameterType parameter, StringBuilder
builder) {
+
+        String type = parameter.getParameterType().getName();
         if (type.equals("String")) {
             builder.append("<xs:element minOccurs=\"0\" name=\"");
-            builder.append(parameter.getName());
+            builder.append(parameter.getParameterName());
             builder.append("\" nillable=\"true\" type=\"xs:string\"/>");
         } else if (type.equals("Integer")) {
             builder.append("<xs:element minOccurs=\"0\" name=\"");
-            builder.append(parameter.getName());
+            builder.append(parameter.getParameterName());
             builder.append("\" type=\"xs:int\"/>");
         } else if (type.equals("Boolean")) {
             builder.append("<xs:element minOccurs=\"0\" name=\"");
-            builder.append(parameter.getName());
+            builder.append(parameter.getParameterName());
             builder.append("\" type=\"xs:boolean\"/>");
         } else if (type.equals("Double")) {
             builder.append("<xs:element minOccurs=\"0\" name=\"");
-            builder.append(parameter.getName());
+            builder.append(parameter.getParameterName());
             builder.append("\" type=\"xs:double\"/>");
         } else if (type.equals("Float")) {
             builder.append("<xs:element minOccurs=\"0\" name=\"");
-            builder.append(parameter.getName());
+            builder.append(parameter.getParameterName());
             builder.append("\" type=\"xs:float\"/>");
         } else if (type.equals("File")) {
             // TODO adding this means adding a new complex type for File type
@@ -110,7 +112,39 @@ public class WebServiceUtil {
             // builder.append(parameter.getName());
             // builder.append("\"  nillable=\"true\" type=\"ax22:File\"/>");
         }
-	*/
+
+    }
+
+        private static void generateElementFromOutputType(OutputParameterType parameter,
StringBuilder builder) {
+
+        String type = parameter.getParameterType().getName();
+        if (type.equals("String")) {
+            builder.append("<xs:element minOccurs=\"0\" name=\"");
+            builder.append(parameter.getParameterName());
+            builder.append("\" nillable=\"true\" type=\"xs:string\"/>");
+        } else if (type.equals("Integer")) {
+            builder.append("<xs:element minOccurs=\"0\" name=\"");
+            builder.append(parameter.getParameterName());
+            builder.append("\" type=\"xs:int\"/>");
+        } else if (type.equals("Boolean")) {
+            builder.append("<xs:element minOccurs=\"0\" name=\"");
+            builder.append(parameter.getParameterName());
+            builder.append("\" type=\"xs:boolean\"/>");
+        } else if (type.equals("Double")) {
+            builder.append("<xs:element minOccurs=\"0\" name=\"");
+            builder.append(parameter.getParameterName());
+            builder.append("\" type=\"xs:double\"/>");
+        } else if (type.equals("Float")) {
+            builder.append("<xs:element minOccurs=\"0\" name=\"");
+            builder.append(parameter.getParameterName());
+            builder.append("\" type=\"xs:float\"/>");
+        } else if (type.equals("File")) {
+            // TODO adding this means adding a new complex type for File type
+            // builder.append("<xs:element minOccurs=\"0\" name=\"");
+            // builder.append(parameter.getName());
+            // builder.append("\"  nillable=\"true\" type=\"ax22:File\"/>");
+        }
+
     }
 
 }

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java?rev=1190466&r1=1190465&r2=1190466&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
Fri Oct 28 17:29:17 2011
@@ -446,6 +446,9 @@ public class ApplicationDescriptionDialo
     }
 
     public ApplicationDeploymentDescription getShellApplicationDescription() {
+        if(shellApplicationDescription == null){
+            shellApplicationDescription = new ApplicationDeploymentDescription();
+        }
         return shellApplicationDescription;
     }
 

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java?rev=1190466&r1=1190465&r2=1190466&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java
Fri Oct 28 17:29:17 2011
@@ -196,7 +196,7 @@ public class ServiceDescriptionDialog ex
             public void tableChanged(TableModelEvent arg0) {
                 int selectedRow = tblParameters.getSelectedRow();
                 if (selectedRow != -1) {
-                    Object parameterIOType = defaultTableModel.getValueAt(selectedRow, 0);
+                        Object parameterIOType = defaultTableModel.getValueAt(selectedRow,
0);
                     Object parameterDataType = defaultTableModel.getValueAt(selectedRow,
2);
                     if (parameterIOType == null || parameterIOType.equals("")) {
                         defaultTableModel.setValueAt(getIOStringList()[0], selectedRow, 0);
@@ -361,25 +361,32 @@ public class ServiceDescriptionDialog ex
 		List<OutputParameterType> outputParameters=new ArrayList<OutputParameterType>();
 		
 		for(int i=0;i<defaultTableModel.getRowCount();i++){
-			Parameter parameter = Parameter.Factory.newInstance();
-			String parameterName = (String)defaultTableModel.getValueAt(i, 1);
-			if (parameterName!=null && !parameterName.trim().equals("")) {
-				DataType parameterDataType = (DataType) defaultTableModel
-						.getValueAt(i, 2);
-				String parameterDescription = (String) defaultTableModel
-						.getValueAt(i, 3);
-				parameter.setParameterName(parameterName);
-				parameter.setParameterDescription(parameterDescription);
+            String parameterName = (String)defaultTableModel.getValueAt(i, 1);
+            String paramType = (String)defaultTableModel.getValueAt(i, 2);
+            String parameterDescription = (String) defaultTableModel
+                    .getValueAt(i, 3);
+            if (parameterName!=null && !parameterName.trim().equals("")) {
                 //todo how to handle Enum
-				if (getIOStringList()[0].equals(defaultTableModel.getValueAt(i,
+                if (getIOStringList()[0].equals(defaultTableModel.getValueAt(i,
 						0))) {
-					inputParameters.add((InputParameterType)parameter);
+                    InputParameterType parameter = InputParameterType.Factory.newInstance();
+                    parameter.setParameterName(parameterName);
+                    parameter.setParameterDescription(parameterDescription);
+                    ParameterType parameterType = parameter.addNewParameterType();
+                    parameterType.setName(paramType);
+                    inputParameters.add(parameter);
+
 				} else {
-					outputParameters.add((OutputParameterType)parameter);
+                    OutputParameterType parameter = OutputParameterType.Factory.newInstance();
+                    parameter.setParameterName(parameterName);
+                    parameter.setParameterDescription(parameterDescription);
+                    ParameterType parameterType = parameter.addNewParameterType();
+                    parameterType.setName(paramType);
+					outputParameters.add(parameter);
 				}
 			}
 		}
-		(getServiceDescriptionType()).setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
+		getServiceDescriptionType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
 		getServiceDescriptionType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
 		
 		getRegistry().saveServiceDescription(getServiceDescription());



Mime
View raw message