Difference between revisions of "Documentation/4.0/Developers/Sandbox"

From Slicer Wiki
Jump to: navigation, search
Line 44: Line 44:
 
url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data
 
url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data
 
|format=CSV with header
 
|format=CSV with header
|data=bananashape=Shape
+
|data=bananashape0=Shape
 
|filters=Name=Banana
 
|filters=Name=Banana
 
}}
 
}}
* {{#external_value:bananashape}}
+
* {{#external_value:bananashape0}}
 
</pre>
 
</pre>
  
Line 53: Line 53:
 
url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data
 
url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data
 
|format=CSV with header
 
|format=CSV with header
|data=bananashape=Shape
+
|data=bananashape0=Shape
 
|filters=Name=Banana
 
|filters=Name=Banana
 
}}
 
}}
* {{#external_value:bananashape}}
+
* {{#external_value:bananashape0}}
  
  
Line 64: Line 64:
 
url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana
 
url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana
 
|format=CSV with header
 
|format=CSV with header
|data=bananashape=Shape
+
|data=bananashape1=Shape
 
}}
 
}}
* {{#external_value:bananashape}}
+
* {{#external_value:bananashape1}}
 
</pre>
 
</pre>
  
Line 72: Line 72:
 
url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana
 
url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana
 
|format=CSV with header
 
|format=CSV with header
|data=bananashape=Shape
+
|data=bananashape1=Shape
 
}}
 
}}
* {{#external_value:bananashape}}
+
* {{#external_value:bananashape1}}
  
  
Line 83: Line 83:
 
url={{fullurl:Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana}}
 
url={{fullurl:Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana}}
 
|format=CSV with header
 
|format=CSV with header
|data=bananashape=Shape
+
|data=bananashape2=Shape
 
}}
 
}}
* {{#external_value:bananashape}}
+
* {{#external_value:bananashape2}}
 
</pre>
 
</pre>
  
Line 93: Line 93:
 
url={{fullurl:Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana}}
 
url={{fullurl:Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana}}
 
|format=CSV with header
 
|format=CSV with header
|data=bananashape=Shape
+
|data=bananashape2=Shape
 
}}
 
}}
* {{#external_value:bananashape}}
+
* {{#external_value:bananashape2}}

Revision as of 08:52, 2 February 2012

Home < Documentation < 4.0 < Developers < Sandbox

Back to Developers Information

Use of get_web_data and for_external_table

The raw set of data retrieved using this URL is reported below:



Name,Color,Shape
Apple,Red,Round
Banana,Yellow,Oblong
Orange,Orange,Round
Pear,Yellow,"Pear-shaped"
{{#get_web_data:url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data|format=CSV with header|data=name=Name,color=Color,shape=Shape}}
{| class="wikitable"
! Name
! Color {{#for_external_table:<nowiki/>
{{!}}-
{{!}} [[{{{name}}}]]
{{!}} {{{color}}} }}
|}

Use of get_web_data and external_value

Using filter as template parameter

{{#get_web_data:
url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data
|format=CSV with header
|data=bananashape0=Shape
|filters=Name=Banana
}}
* {{#external_value:bananashape0}}


  • Error: no local variable "bananashape0" was set.


Using filter as URL parameter

{{#get_web_data:
url=http://wiki.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana
|format=CSV with header
|data=bananashape1=Shape
}}
* {{#external_value:bananashape1}}


  • Error: no local variable "bananashape1" was set.


Using fullurl

{{#get_web_data:
url={{fullurl:Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana}}
|format=CSV with header
|data=bananashape2=Shape
}}
* {{#external_value:bananashape2}}

https://www.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name%3DBanana

Error: No contents found at URL https://www.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name%3DBanana.

  • Error: no local variable "bananashape2" was set.