airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1361362 - in /incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya: registrybrowser/nodes/ ui/ ui/dialogs/graph/dynamic/ ui/experiment/
Date Fri, 13 Jul 2012 20:02:51 GMT
Author: samindaw
Date: Fri Jul 13 20:02:51 2012
New Revision: 1361362

URL: http://svn.apache.org/viewvc?rev=1361362&view=rev
Log:
trim parameter values in browser node + allow specifying a workflow instance name

Modified:
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java?rev=1361362&r1=1361361&r2=1361362&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
Fri Jul 13 20:02:51 2012
@@ -53,7 +53,11 @@ public class ParameterNode extends Abstr
 	public String getCaption(boolean selected, boolean expanded, boolean leaf,
 			boolean hasFocus) {
 		if (getParameter().getValue()!=null){
-			return wrapAsHtml("<b>"+getParameter().getName()+"</b>",": ",""+getParameter().getValue().toString()+"");
+			String parameterValue = getParameter().getValue().toString();
+			if (parameterValue.length()>200){
+				parameterValue=parameterValue.substring(0, 200)+"...";
+			}
+			return wrapAsHtml("<b>"+getParameter().getName()+"</b>",": ",""+parameterValue+"");
 		}else{
 			return getParameter().getName();
 		}

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java?rev=1361362&r1=1361361&r2=1361362&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
Fri Jul 13 20:02:51 2012
@@ -653,7 +653,7 @@ public class XBayaGUI implements EventLi
 			jcrBrowserPanel = new JCRBrowserPanel(engine);
 			this.componentTabbedPane.add(jcrBrowserPanel);
 			int index=this.componentTabbedPane.getTabCount()-1;
-			this.componentTabbedPane.setTitleAt(1, "JCR Registry Browser");
+			this.componentTabbedPane.setTitleAt(1, "Airavata Registry");
 			TabLabelButton tabLabelButton = new TabLabelButton(componentTabbedPane, "Close JCR Browser");
 			tabLabelButton.setCloseButtonListener(new ActionListener(){
 				@Override

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java?rev=1361362&r1=1361361&r2=1361362&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
Fri Jul 13 20:02:51 2012
@@ -25,6 +25,7 @@ import java.awt.event.ActionEvent;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -101,6 +102,8 @@ public class DynamicWorkflowRunnerWindow
 
 	private JCheckBox chkRunWithCrossProduct;
 
+	private XBayaTextField instanceNameTextField;
+
     protected final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
 
     /**
@@ -185,6 +188,8 @@ public class DynamicWorkflowRunnerWindow
         }
         this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE, 2);
 
+        this.instanceNameTextField.setText(workflow.getName()+"_"+Calendar.getInstance().getTime().toString());
+
         this.topicTextField.setText(UUID.randomUUID().toString());
 
         // XBayaConfiguration config = this.engine.getConfiguration();
@@ -236,6 +241,8 @@ public class DynamicWorkflowRunnerWindow
 
         // reinitHostComboBox();
         // this.resourceSelectionLabel = new XBayaLabel("Select a Compute Resource", this.resourceSelectionComboBox);
+        this.instanceNameTextField = new XBayaTextField();
+        XBayaLabel instanceNameLabel = new XBayaLabel("Experiment name", this.instanceNameTextField);
 
         this.topicTextField = new XBayaTextField();
         XBayaLabel topicLabel = new XBayaLabel("Notification topic", this.topicTextField);
@@ -253,6 +260,8 @@ public class DynamicWorkflowRunnerWindow
         GridPanel infoPanel = new GridPanel();
         // infoPanel.add(this.resourceSelectionLabel);
         // infoPanel.add(this.resourceSelectionComboBox);
+        infoPanel.add(instanceNameLabel);
+        infoPanel.add(this.instanceNameTextField);
         infoPanel.add(topicLabel);
         infoPanel.add(this.topicTextField);
         // infoPanel.add(xRegistryLabel);
@@ -266,14 +275,14 @@ public class DynamicWorkflowRunnerWindow
         infoPanel.add(crossProductLabel);
         infoPanel.add(chkRunWithCrossProduct);
         
-        infoPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);
+        infoPanel.layout(5, 2, GridPanel.WEIGHT_NONE, 1);
 
         GridPanel mainPanel = new GridPanel();
         mainPanel.add(this.parameterPanel);
         mainPanel.add(infoPanel);
         mainPanel.layout(2, 1, 0, 0);
 
-        JButton okButton = new JButton("OK");
+        JButton okButton = new JButton("Run");
         okButton.addActionListener(new AbstractAction() {
             public void actionPerformed(ActionEvent e) {
                 execute();
@@ -297,7 +306,11 @@ public class DynamicWorkflowRunnerWindow
 
     private void execute() {
         final List<String> arguments = new ArrayList<String>();
-
+        String instanceName = this.instanceNameTextField.getText();
+        if (instanceName.equals("")){
+        	instanceName=workflow.getName();
+        }
+        final String instanceNameFinal=instanceName;
         String topic = this.topicTextField.getText();
         if (topic.length() == 0) {
             this.engine.getGUI().getErrorWindow().error(ErrorMessages.TOPIC_EMPTY_ERROR);
@@ -411,6 +424,11 @@ public class DynamicWorkflowRunnerWindow
                         workflowInterpreter.setResourceMapping(resourceMapping);
 
                     workflowInterpreter.scheduleDynamically();
+                    try {
+						engine.getConfiguration().getJcrComponentRegistry().getRegistry().saveWorkflowExecutionName(topicString,
instanceNameFinal);
+					} catch (RegistryException e) {
+						e.printStackTrace();
+					}
                 } catch (WorkflowException e) {
                     try {
                         workflowInterpreter.cleanup();

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java?rev=1361362&r1=1361361&r2=1361362&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
Fri Jul 13 20:02:51 2012
@@ -25,6 +25,7 @@ import java.awt.event.ActionEvent;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Collection;
 import java.util.List;
 import java.util.UUID;
@@ -90,6 +91,8 @@ public class WorkflowInterpreterLaunchWi
 
     private XBayaTextField gfacTextField;
 
+	private XBayaTextField instanceNameTextField;
+
     protected final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
 
     /**
@@ -146,7 +149,7 @@ public class WorkflowInterpreterLaunchWi
             this.parameterTextFields.add(paramField);
         }
         this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE, 2);
-
+        this.instanceNameTextField.setText(workflow.getName()+"_"+Calendar.getInstance().getTime().toString());
         this.topicTextField.setText(UUID.randomUUID().toString());
 
         XBayaConfiguration config = this.engine.getConfiguration();
@@ -181,6 +184,9 @@ public class WorkflowInterpreterLaunchWi
     private void initGUI() {
         this.parameterPanel = new GridPanel(true);
 
+        this.instanceNameTextField = new XBayaTextField();
+        XBayaLabel instanceNameLabel = new XBayaLabel("Experiment name", this.instanceNameTextField);
+        
         this.topicTextField = new XBayaTextField();
         XBayaLabel topicLabel = new XBayaLabel("Notification topic", this.topicTextField);
         this.workflowInterpreterTextField = new XBayaTextField();
@@ -192,6 +198,8 @@ public class WorkflowInterpreterLaunchWi
         XBayaLabel gfacLabel = new XBayaLabel("GFac URL", this.gfacTextField);
 
         GridPanel infoPanel = new GridPanel();
+        infoPanel.add(instanceNameLabel);
+        infoPanel.add(this.instanceNameTextField);
         infoPanel.add(topicLabel);
         infoPanel.add(this.topicTextField);
         infoPanel.add(workflowInterpreterLabel);
@@ -201,14 +209,14 @@ public class WorkflowInterpreterLaunchWi
         infoPanel.add(gfacLabel);
         infoPanel.add(this.gfacTextField);
 
-        infoPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);
+        infoPanel.layout(5, 2, GridPanel.WEIGHT_NONE, 1);
 
         GridPanel mainPanel = new GridPanel();
         mainPanel.add(this.parameterPanel);
         mainPanel.add(infoPanel);
         mainPanel.layout(2, 1, 0, 0);
 
-        JButton okButton = new JButton("OK");
+        JButton okButton = new JButton("Run");
         okButton.addActionListener(new AbstractAction() {
             public void actionPerformed(ActionEvent e) {
                 execute();
@@ -234,6 +242,11 @@ public class WorkflowInterpreterLaunchWi
         final List<String> arguments = new ArrayList<String>();
 
         String topic = this.topicTextField.getText();
+        String instanceName = this.instanceNameTextField.getText();
+        if (instanceName.equals("")){
+        	instanceName=workflow.getName();
+        }
+        final String instanceNameFinal=instanceName;
         if (topic.length() == 0) {
             this.engine.getGUI().getErrorWindow().error(ErrorMessages.TOPIC_EMPTY_ERROR);
             return;
@@ -349,6 +362,7 @@ public class WorkflowInterpreterLaunchWi
                             ,null,configuration.getMessageBoxURL().toASCIIString());
                     stub._getServiceClient().addHeader(AXIOMUtil.stringToOM(XMLUtil.xmlElementToString(builder.getXml())));
                     stub.launchWorkflow(workflow.toXMLText(), topicString,inputNameVals);
+                    engine.getConfiguration().getJcrComponentRegistry().getRegistry().saveWorkflowExecutionName(topicString,
instanceNameFinal);
                 } catch (Exception e) {
                     WorkflowInterpreterLaunchWindow.this.engine.getGUI().getErrorWindow().error(e);
                 }



Mime
View raw message