retrieving solar monitor urls for votable events
Created: 2009-11-12 14:02:59
Last updated: 2009-11-12 14:34:33
No description has been set
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (0)
Titles (0)
Descriptions (0)
Dependencies (0)
Processors (5)
Name |
Type |
Description |
Beanshell2 |
beanshell |
Scriptimport java.io.StringReader;
import org.w3c.dom.*;
import org.xml.sax.InputSource;
import org.apache.xerces.parsers.DOMParser;
private getNodeValues(Node rootnode){
NodeList nodes = rootnode.getChildNodes();
for(int i=0; i |
query_v1_solar_monitor |
wsdl |
Wsdlhttp://helio.i4ds.technik.fhnw.ch:8080/core/services/frontend?wsdlWsdl Operationquery_v1 |
query_v1_input |
xmlsplitter |
|
SolarMonitor |
stringconstant |
Valuesm-seit |
retrieveDates |
beanshell |
Scriptimport java.io.StringReader;
import org.w3c.dom.*;
import org.xml.sax.InputSource;
import org.apache.xerces.parsers.DOMParser;
import java.util.Date;
import java.text.SimpleDateFormat;
private void getPositions(){
NodeList nodesVO = docVO.getElementsByTagName("FIELD");
for(int i=0; i< nodesVO.getLength(); i++){
Element voFieldNode = nodesVO.item(i);
String name = voFieldNode.getAttribute("name");
if(name.trim().equals("time_start")){
posStart = i;
} else if(name.trim().equals("time_end")){
posEnd = i;
} else if(name.trim().equals("time_peak")){
posPeak = i;
}
}
}
private void findDates() {
NodeList dataListVO = docVO.getElementsByTagName("TR");
for(int i = 0; i < dataListVO.getLength(); i++) {
NodeList voDataChilds = dataListVO.item(i).getChildNodes();
String date=voDataChilds.item(posPeak*2+1).getFirstChild().getNodeValue().trim();
startDate.add(date.replaceAll("..:..:..", "00:00:00"));
endDate.add(date.replaceAll("..:..:..", "23:59:59"));
/* SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date start = date.parse(voDataChilds.item(posPeak*2+1).getFirstChild().getNodeValue().trim());
Date temp=new Date();
temp.setTime((long)(start.getTime()-(long)(12*60*60*1000)));
startDate.add(date.format(temp));
Date temp2=new Date();
temp2.setTime((long)(start.getTime()+(long)(12*60*60*1000)));
endDate.add(date.format(temp2));*/
}
}
List startDate = new ArrayList();
List endDate = new ArrayList();
debug = new String("debug\n");
StringReader reader2 = new StringReader(voTable);
InputSource source2 = new InputSource(reader2);
DOMParser parser2 = new DOMParser();
Document docVO;
int posStart=-1;
int posEnd=-1;
int posPeak=-1;
parser2.parse(source2);
docVO = parser2.getDocument();
getPositions();
debug=debug.concat("startpoint " + posStart + " endpoint " + posEnd + " \n");
if(posStart >= 0 && posEnd >= 0){
findDates();
}
reader2.close();
|
Beanshells (2)
Name |
Description |
Inputs |
Outputs |
Beanshell2 |
|
string
|
urlList
|
retrieveDates |
|
voTable
|
startDate
endDate
debug
|
Datalinks (7)
Source |
Sink |
query_v1_solar_monitor:parameters |
Beanshell2:string |
query_v1_input:output |
query_v1_solar_monitor:parameters |
SolarMonitor:value |
query_v1_input:instrument |
retrieveDates:startDate |
query_v1_input:date_from |
retrieveDates:endDate |
query_v1_input:date_to |
VOTable |
retrieveDates:voTable |
Beanshell2:urlList |
urls |
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 (1)
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (1)
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (1)
Log in to make a comment
Deprecated
This workflow uses a web service which is no longer supported