Name |
Type |
Description |
Workflow1 |
workflow |
|
SeasonFlattener |
localworker |
Scriptflatten(inputs, outputs, depth) {
for (i = inputs.iterator(); i.hasNext();) {
element = i.next();
if (element instanceof Collection && depth > 0) {
flatten(element, outputs, depth - 1);
} else {
outputs.add(element);
}
}
}
outputlist = new ArrayList();
flatten(inputlist, outputlist, 1); |
GrabDistances |
beanshell |
Scriptdata = new ArrayList();
data.add(distLog); |
Grapher |
beanshell |
ScriptStringBuilder sb = new StringBuilder();
sb.append("http://chart.apis.google.com/chart?");
// Chart type = bar chart //
sb.append("cht=bvg");
// Chart size //
sb.append("&chs=520x300");
sb.append("&ch=");
// Axes: current order is y, x; was x, y, y //
sb.append("&chxt=y,x,y,x");
// Size of bar chart bars; a = autosize //
sb.append("&chbh=a");
// Chart scale //
sb.append("&chxr=0,0,7");
// Chart marking style //
sb.append("&chxtc=1,1");
// Literal axis values //
sb.append("&chxs=1,676767,11.5,0,lt,676767");
// Scale numeric display //
sb.append("&chds=0,7");
// Value labels for bars //
sb.append("&chm=N*f4*,000000,0,-1,11");
// Attempting the axis labels //
sb.append("&chxl=0:|0|10e0|10e1|10e2|10e3|10e4|10e5|10e6|2:||Distance+(log10)||");
sb.append("1:||");
// sb.append(names1.get(j)); //
sb.append(namedat);
sb.append("|3:||Object%20Names%20Above%20in%20Input%20Order");
sb.append("&chxp=50");
sb.append("&chco=336666");
// Chart Title //
sb.append("&chtt=Distance+Comparison");
// Chart Title Formatting //
sb.append("&chts=000000,20,c");
// Add the data //
if (data != void) {
sb.append("&chd=t:");
for (int i = 0; i < data.size(); i++) {
List data1 = (List) data.get(i);
for (int j = 0; j < data1.size(); j++) {
Float value = Float.parseFloat(data1.get(j));
sb.append(value.floatValue());
if (j+1 < data1.size()) {
sb.append(",");
}
}
if (i+1 < data.size()) {
sb.append("|");
}
}
}
// Graph the URL //
graphURL = sb.toString(); |
DistFlattener |
localworker |
Scriptflatten(inputs, outputs, depth) {
for (i = inputs.iterator(); i.hasNext();) {
element = i.next();
if (element instanceof Collection && depth > 0) {
flatten(element, outputs, depth - 1);
} else {
outputs.add(element);
}
}
}
outputlist = new ArrayList();
flatten(inputlist, outputlist, 1); |
Get_Image_From_URL |
localworker |
Scriptif ((url == void) || (url == null)) {
throw new RuntimeException("The url must be specified");
}
URL inputURL = null;
if (base != void) {
inputURL = new URL(new URL(base), url);
} else {
inputURL = new URL(url);
}
int bytesRead = 0;
int totalBytesRead = 0;
InputStream is = inputURL.openStream();
ByteArrayOutputStream os = new ByteArrayOutputStream();
byte[] buffer = new byte[2048];
while (true) {
bytesRead = is.read(buffer);
if (bytesRead == -1) {
break;
}
os.write(buffer, 0, bytesRead);
}
image = os.toByteArray();
is.close();
os.close();
|
NameFlattener |
localworker |
Scriptflatten(inputs, outputs, depth) {
for (i = inputs.iterator(); i.hasNext();) {
element = i.next();
if (element instanceof Collection && depth > 0) {
flatten(element, outputs, depth - 1);
} else {
outputs.add(element);
}
}
}
outputlist = new ArrayList();
flatten(inputlist, outputlist, 1); |
Merge_String_List_to_a_String |
localworker |
Script/* There is not really a string separator. This is just a
slightly modified version of the "Merge String List to a String"
service included in Taverna. */
String seperatorString = "";
if (seperator != void) {
seperatorString = seperator;
}
StringBuffer sb = new StringBuffer();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
sb.append(item);
if (i.hasNext()) {
sb.append(seperatorString);
}
}
// THIS IS THE NEW CODE AREA //
concatenated = sb.toString();
/* The string above will have new lines between all of the
values. We need to strip new lines from the strings and pass
the stripped single string down the pipeline. */
String newlinecon;
newlinecon = concatenated.replaceAll("\n", "");
|
String_constant |
stringconstant |
Value, |
Comments (0)
No comments yet
Log in to make a comment