RISE UI: Choose User Workspace
Created: 2012-03-05 22:05:36
Last updated: 2012-03-05 22:06:25
This workflow ask the user to select a user workspace among those present on the RISE server.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (0)
Titles (0)
Descriptions (0)
Dependencies (0)
Inputs (2)
Name |
Description |
server_port |
|
server_url |
|
Processors (5)
Name |
Type |
Description |
ListWorkspaces |
rest |
|
ListUserWorkspace |
xpath |
Xpath Expression/Workspaces/workspace |
ChooseUserWorkspaceMessage |
stringconstant |
ValueSelect a user workspace |
ChooseUserWorkspaceTitle |
stringconstant |
ValueUser workspace |
ChooseUserWorkspace |
localworker |
Scriptimport javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
if ((selectionValues == void) || (selectionValues == null) || (selectionValues.isEmpty())) {
throw new RuntimeException("selectionValues must be specified and non-empty");
}
ButtonGroup group = new ButtonGroup();
JPanel messagePanel = new JPanel();
messagePanel.setLayout(new BoxLayout(messagePanel,BoxLayout.Y_AXIS));
messagePanel.add(new JLabel((message == void ? null : message)));
JRadioButton[] buttonArray = new JRadioButton[selectionValues.size()];
for (int i = 0; i < buttonArray.length; i++) {
buttonArray[i] = new JRadioButton(selectionValues.get(i));
if (i==0) buttonArray[i].setSelected(true);
group.add(buttonArray[i]);
messagePanel.add(buttonArray[i]);
}
JOptionPane.showOptionDialog(null, messagePanel, (title == void ? null : title),
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"OK"}, null);
String answer="";
for (JRadioButton button : buttonArray) {
if (button.isSelected()) {
answer=button.getText();
}
}
|
Outputs (1)
Name |
Description |
UserWorkspace |
|
Datalinks (7)
Source |
Sink |
server_port |
ListWorkspaces:port |
server_url |
ListWorkspaces:url |
ListWorkspaces:responseBody |
ListUserWorkspace:xml_text |
ChooseUserWorkspaceMessage:value |
ChooseUserWorkspace:message |
ChooseUserWorkspaceTitle:value |
ChooseUserWorkspace:title |
ListUserWorkspace:nodelist |
ChooseUserWorkspace:selectionValues |
ChooseUserWorkspace:answer |
UserWorkspace |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (0)
None
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment