changeset 3:ae644a724667 draft

add r-curl
author mingchen0919
date Sun, 18 Mar 2018 18:38:17 -0400
parents 739268ec80df
children 5ca75e914699
files get_content_types.Rmd get_content_types.xml get_content_types_render.R
diffstat 3 files changed, 31 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/get_content_types.Rmd	Sun Mar 18 17:48:33 2018 -0400
+++ b/get_content_types.Rmd	Sun Mar 18 18:38:17 2018 -0400
@@ -18,7 +18,7 @@
 
 
 ```{r echo=FALSE}
-tripal_content = fromJSON()
+tripal_content = fromJSON(opt$X_u)
 ```
 
 ```{r}
--- a/get_content_types.xml	Sun Mar 18 17:48:33 2018 -0400
+++ b/get_content_types.xml	Sun Mar 18 18:38:17 2018 -0400
@@ -1,11 +1,19 @@
-<tool id="get_content_types" name="Get content types" version="1.0.0">
-  <description>Tripal database explorer: get content types&#xD;
+<tool id="tool_1" name="Get content types" version="1.0.0">
+    <description>Tripal database explorer: get content types&#xD;
     </description>
-  <requirements>
-        <requirement type="package" version="1.15.0.6-0">pandoc</requirement><requirement type="package" version="1.20.0">r-getopt</requirement><requirement type="package" version="1.6">r-rmarkdown</requirement><requirement type="package" version="1.5">r-jsonlite</requirement><requirement type="package" version="0.2">r-dt</requirement></requirements>
-  <stdio>
-        <regex match="XXX" source="stderr" level="warning" description="Check the warnings_and_errors.txt file for more details."/></stdio>
-  <command><![CDATA[export TOOL_DIR='${__tool_directory__}' &&
+    <requirements>
+        <requirement type="package" version="1.15.0.6-0">pandoc</requirement>
+        <requirement type="package" version="1.20.0">r-getopt</requirement>
+        <requirement type="package" version="1.6">r-rmarkdown</requirement>
+        <requirement type="package" version="1.5">r-jsonlite</requirement>
+        <requirement type="package" version="0.2">r-dt</requirement>
+        <requirement type="package" version="3.1">r-curl</requirement>
+    </requirements>
+    <stdio>
+        <regex match="XXX" source="stderr" level="warning"
+               description="Check the warnings_and_errors.txt file for more details."/>
+    </stdio>
+    <command><![CDATA[export TOOL_DIR='${__tool_directory__}' &&
 
 Rscript '${__tool_directory__}/'get_content_types_render.R
 
@@ -14,11 +22,15 @@
 	-s '$sink_message'
 	-u '$web_services_root_url'
 ]]></command>
-  <inputs>
-        <param type="text" name="web_services_root_url" label="Web services root URL" optional="False"/></inputs>
-  <outputs>
-        <data name="report" format="html" label="${tool.name} report" hidden="false"/><data name="sink_message" format="txt" label="${tool.name} log" from_work_dir="warnings_and_errors.txt" hidden="false"/></outputs>
-  <citations>
+    <inputs>
+        <param type="text" name="web_services_root_url" label="Web services root URL" optional="False"/>
+    </inputs>
+    <outputs>
+        <data name="report" format="html" label="${tool.name} report" hidden="false"/>
+        <data name="sink_message" format="txt" label="${tool.name} log" from_work_dir="warnings_and_errors.txt"
+              hidden="false"/>
+    </outputs>
+    <citations>
         <citation type="bibtex"><![CDATA[
             @article{allaire2016rmarkdown,
             title={rmarkdown: Dynamic Documents for R, 2016},
@@ -28,7 +40,8 @@
             volume={6},
             year={2016}
             }
-        ]]></citation><citation type="bibtex"><![CDATA[
+        ]]></citation>
+        <citation type="bibtex"><![CDATA[
             @book{xie2015dynamic,
             title={Dynamic Documents with R and knitr},
             author={Xie, Yihui},
@@ -36,5 +49,6 @@
             year={2015},
             publisher={CRC Press}
             }
-        ]]></citation></citations>
+        ]]></citation>
+    </citations>
 </tool>
--- a/get_content_types_render.R	Sun Mar 18 17:48:33 2018 -0400
+++ b/get_content_types_render.R	Sun Mar 18 18:38:17 2018 -0400
@@ -18,8 +18,8 @@
 # load helper function
 source(paste0(Sys.getenv('TOOL_DIR'), '/helper.R'))
 # import getopt specification matrix from a csv file
-spec_csv = paste0(Sys.getenv('TOOL_DIR'), '/get_content_types.csv')
-opt = getopt(getopt_specification_matrix(spec_csv))
+print(Sys.getenv('TOOL_DIR'))
+opt = getopt(getopt_specification_matrix('/get_content_types.csv'))
 opt$X_t = Sys.getenv('TOOL_DIR')
 #----------------------------------------------------