Get survey data from SurveyMapper
Created: 2010-04-21 18:13:04
Last updated: 2010-06-18 11:51:29
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (0)
Titles (0)
Descriptions (0)
Dependencies (0)
Processors (14)
Name |
Type |
Description |
Get_Survey |
localworker |
ScriptURL inputURL = null;
if (base != void) {
inputURL = new URL(new URL(base), url);
}
else {
inputURL = new URL(url);
}
URLConnection con = inputURL.openConnection();
InputStream in = con.getInputStream();
InputStreamReader isr = new InputStreamReader(in);
Reader inReader = new BufferedReader(isr);
StringBuffer buf = new StringBuffer();
int ch;
while ((ch = inReader.read()) > -1) {
buf.append((char)ch);
}
inReader.close();
contents = buf.toString();
//String NEWLINE = System.getProperty("line.separator");
//
//URL inputURL = null;
//if (base != void) {
// inputURL = new URL(new URL(base), url);
//} else {
// inputURL = new URL(url);
//}
//StringBuffer result = new StringBuffer();
//BufferedReader reader = new BufferedReader(new InputStreamReader(inputURL.openStream()));
//String line = null;
//while ((line = reader.readLine()) != null) {
// result.append(line);
// result.append(NEWLINE);
//}
//
//contents = result.toString();
|
survey_url |
stringconstant |
Valuehttp://www.surveymapper.com/datafarm.svc/list |
XPath_Get_Surveys |
localworker |
Scriptimport org.dom4j.Document;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
SAXReader reader = new SAXReader(false);
reader.setIncludeInternalDTDDeclarations(false);
reader.setIncludeExternalDTDDeclarations(false);
Document document = reader.read(new StringReader(xmltext));
List nodelist = document.selectNodes(xpath);
// Process the elements in the nodelist
ArrayList outputList = new ArrayList();
ArrayList outputXmlList = new ArrayList();
String val = null;
String xmlVal = null;
for (Iterator iter = nodelist.iterator(); iter.hasNext();) {
Node element = (Node) iter.next();
xmlVal = element.asXML();
val = element.getStringValue();
if (val != null && !val.equals("")) {
outputList.add(val);
outputXmlList.add(xmlVal);
}
}
List nodelist=outputList;
List nodelistAsXML=outputXmlList; |
getSurveys |
stringconstant |
Value/SurveyMapper/survey |
getSurveyTitle |
stringconstant |
Value/SurveyMapper/survey/surveytitle |
XPath_Get_Survey_Titles |
localworker |
Scriptimport org.dom4j.Document;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
SAXReader reader = new SAXReader(false);
reader.setIncludeInternalDTDDeclarations(false);
reader.setIncludeExternalDTDDeclarations(false);
Document document = reader.read(new StringReader(xmltext));
List nodelist = document.selectNodes(xpath);
// Process the elements in the nodelist
ArrayList outputList = new ArrayList();
ArrayList outputXmlList = new ArrayList();
String val = null;
String xmlVal = null;
for (Iterator iter = nodelist.iterator(); iter.hasNext();) {
Node element = (Node) iter.next();
xmlVal = element.asXML();
val = element.getStringValue();
if (val != null && !val.equals("")) {
outputList.add(val);
outputXmlList.add(xmlVal);
}
}
List nodelist=outputList;
List nodelistAsXML=outputXmlList; |
getSurveyLastUpdate |
stringconstant |
Value/survey/question/lastUpdate |
XPath_Get_Survey_Question_LastUpdatedDates |
localworker |
Scriptimport org.dom4j.Document;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
SAXReader reader = new SAXReader(false);
reader.setIncludeInternalDTDDeclarations(false);
reader.setIncludeExternalDTDDeclarations(false);
Document document = reader.read(new StringReader(xmltext));
List nodelist = document.selectNodes(xpath);
// Process the elements in the nodelist
ArrayList outputList = new ArrayList();
ArrayList outputXmlList = new ArrayList();
String val = null;
String xmlVal = null;
for (Iterator iter = nodelist.iterator(); iter.hasNext();) {
Node element = (Node) iter.next();
xmlVal = element.asXML();
val = element.getStringValue();
if (val != null && !val.equals("")) {
outputList.add(val);
outputXmlList.add(xmlVal);
}
}
List nodelist=outputList;
List nodelistAsXML=outputXmlList; |
getSurveyQuestions |
stringconstant |
Value/survey/question |
XPath_Get_Survey_Questions |
localworker |
Scriptimport org.dom4j.Document;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
SAXReader reader = new SAXReader(false);
reader.setIncludeInternalDTDDeclarations(false);
reader.setIncludeExternalDTDDeclarations(false);
Document document = reader.read(new StringReader(xmltext));
List nodelist = document.selectNodes(xpath);
// Process the elements in the nodelist
ArrayList outputList = new ArrayList();
ArrayList outputXmlList = new ArrayList();
String val = null;
String xmlVal = null;
for (Iterator iter = nodelist.iterator(); iter.hasNext();) {
Node element = (Node) iter.next();
xmlVal = element.asXML();
val = element.getStringValue();
if (val != null && !val.equals("")) {
outputList.add(val);
outputXmlList.add(xmlVal);
}
}
List nodelist=outputList;
List nodelistAsXML=outputXmlList; |
XPath_Get_Survey_Question_File_URLs |
localworker |
Scriptimport org.dom4j.Document;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
SAXReader reader = new SAXReader(false);
reader.setIncludeInternalDTDDeclarations(false);
reader.setIncludeExternalDTDDeclarations(false);
Document document = reader.read(new StringReader(xmltext));
List nodelist = document.selectNodes(xpath);
// Process the elements in the nodelist
ArrayList outputList = new ArrayList();
ArrayList outputXmlList = new ArrayList();
String val = null;
String xmlVal = null;
for (Iterator iter = nodelist.iterator(); iter.hasNext();) {
Node element = (Node) iter.next();
xmlVal = element.asXML();
val = element.getStringValue();
if (val != null && !val.equals("")) {
outputList.add(val);
outputXmlList.add(xmlVal);
}
}
List nodelist=outputList;
List nodelistAsXML=outputXmlList; |
xpath_value |
stringconstant |
Value/survey/question/file |
XPath_Get_Survey_Question_Titles |
localworker |
Scriptimport org.dom4j.Document;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
SAXReader reader = new SAXReader(false);
reader.setIncludeInternalDTDDeclarations(false);
reader.setIncludeExternalDTDDeclarations(false);
Document document = reader.read(new StringReader(xmltext));
List nodelist = document.selectNodes(xpath);
// Process the elements in the nodelist
ArrayList outputList = new ArrayList();
ArrayList outputXmlList = new ArrayList();
String val = null;
String xmlVal = null;
for (Iterator iter = nodelist.iterator(); iter.hasNext();) {
Node element = (Node) iter.next();
xmlVal = element.asXML();
val = element.getStringValue();
if (val != null && !val.equals("")) {
outputList.add(val);
outputXmlList.add(xmlVal);
}
}
List nodelist=outputList;
List nodelistAsXML=outputXmlList; |
xpath_value_1 |
stringconstant |
Value/survey/question/questiontitle |
Outputs (7)
Name |
Description |
xml_content |
|
surveyXMLElements |
|
surveyTitles |
|
surveyQuestionXMLElements |
|
surveyQuestionLastUpdated |
|
surveyQuestionFileURLs |
|
surveyQuestionTitles |
|
Datalinks (20)
Source |
Sink |
survey_url:value |
Get_Survey:url |
Get_Survey:contents |
XPath_Get_Surveys:xml-text |
getSurveys:value |
XPath_Get_Surveys:xpath |
getSurveyTitle:value |
XPath_Get_Survey_Titles:xpath |
Get_Survey:contents |
XPath_Get_Survey_Titles:xml-text |
getSurveyLastUpdate:value |
XPath_Get_Survey_Question_LastUpdatedDates:xpath |
XPath_Get_Surveys:nodelistAsXML |
XPath_Get_Survey_Question_LastUpdatedDates:xml-text |
getSurveyQuestions:value |
XPath_Get_Survey_Questions:xpath |
XPath_Get_Surveys:nodelistAsXML |
XPath_Get_Survey_Questions:xml-text |
XPath_Get_Surveys:nodelistAsXML |
XPath_Get_Survey_Question_File_URLs:xml-text |
xpath_value:value |
XPath_Get_Survey_Question_File_URLs:xpath |
XPath_Get_Surveys:nodelistAsXML |
XPath_Get_Survey_Question_Titles:xml-text |
xpath_value_1:value |
XPath_Get_Survey_Question_Titles:xpath |
Get_Survey:contents |
xml_content |
XPath_Get_Surveys:nodelistAsXML |
surveyXMLElements |
XPath_Get_Survey_Titles:nodelist |
surveyTitles |
XPath_Get_Survey_Questions:nodelistAsXML |
surveyQuestionXMLElements |
XPath_Get_Survey_Question_LastUpdatedDates:nodelist |
surveyQuestionLastUpdated |
XPath_Get_Survey_Question_File_URLs:nodelist |
surveyQuestionFileURLs |
XPath_Get_Survey_Question_Titles:nodelist |
surveyQuestionTitles |
Uploader
License
All versions of this Workflow are
licensed under:
Version 2 (latest)
(of 2)
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 (0)
No comments yet
Log in to make a comment