← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-documenters/dhis2/dhis2-docbook-docs] Rev 558: Link function docs

 

------------------------------------------------------------
revno: 558
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2-docbook-docs
timestamp: Tue 2012-07-31 12:14:22 +0200
message:
  Link function docs
modified:
  src/docbkx/en/dhis2_user_man_web_api.xml


--
lp:~dhis2-documenters/dhis2/dhis2-docbook-docs
https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs

Your team DHIS 2 developers is subscribed to branch lp:~dhis2-documenters/dhis2/dhis2-docbook-docs.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs/+edit-subscription
=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml'
--- src/docbkx/en/dhis2_user_man_web_api.xml	2012-07-31 09:35:01 +0000
+++ src/docbkx/en/dhis2_user_man_web_api.xml	2012-07-31 10:14:22 +0000
@@ -628,11 +628,21 @@
       <tgroup cols="5">
         <tbody>
           <row>
-            <entry>Param</entry>
-            <entry>Type</entry>
-            <entry>Required</entry>
-            <entry>Options (default first)</entry>
-            <entry>Description</entry>
+            <entry>
+              <emphasis role="italic">Param</emphasis>
+            </entry>
+            <entry>
+              <emphasis role="italic">Type</emphasis>
+            </entry>
+            <entry>
+              <emphasis role="italic">Required</emphasis>
+            </entry>
+            <entry>
+              <emphasis role="italic">Options (default first)</emphasis>
+            </entry>
+            <entry>
+              <emphasis role="italic">Description</emphasis>
+            </entry>
           </row>
           <row>
             <entry>indicators</entry>
@@ -663,7 +673,7 @@
             <entry>Names of relative periods to include in table</entry>
           </row>
           <row>
-            <entry>organisationunits</entry>
+            <entry>orgunits</entry>
             <entry>[string]</entry>
             <entry>Yes</entry>
             <entry/>
@@ -698,13 +708,6 @@
             <entry>Whether the table should be rendered as plain HTML or as an Ext JS Grid</entry>
           </row>
           <row>
-            <entry>format</entry>
-            <entry>string</entry>
-            <entry>No</entry>
-            <entry>html | xls | csv | pdf | json | xml</entry>
-            <entry>The representation format of the table, can be HTML, Excel, CSV, PDF, JSON and XML</entry>
-          </row>
-          <row>
             <entry>el</entry>
             <entry>string</entry>
             <entry>Yes</entry>
@@ -723,31 +726,78 @@
     </table>
     <para>In the following are examples on how the table plugin can be used.</para>
     <screen>DHIS.getTable({
-    indicators: [&apos;Uvn6LCg7dVU&apos;],
-    periods: [&apos;last12Months&apos;],
-    orgunits: [&apos;ImspTQPwCqd&apos;],
-    crosstab: [&apos;periods&apos;],
-    orgUnitIsParent: true,
-    useExtGrid: false,
-    callbackName: &apos;table1&apos;,
-    hiddenCols: [0],
-    el: &apos;table1&apos;,
-    url: base
-  });
+  indicators: [&apos;Uvn6LCg7dVU&apos;],
+  periods: [&apos;last12Months&apos;],
+  orgunits: [&apos;ImspTQPwCqd&apos;],
+  crosstab: [&apos;periods&apos;],
+  orgUnitIsParent: true,
+  useExtGrid: false,
+  callbackName: &apos;table1&apos;,
+  hiddenCols: [0],
+  el: &apos;table1&apos;,
+  url: base
+});
 
 DHIS.getTable({
-    dataelements: [&apos;s46m5MS0hxu&apos;, &apos;YtbsuPPo010&apos;, &apos;xc8gmAKfO95&apos;, &apos;UOlfIjgN8X6&apos;],
-    periods: [&apos;last4Quarters&apos;],
-    orgunits: [&apos;ImspTQPwCqd&apos;],
-    crosstab: [&apos;data&apos;],
-    useExtGrid: false,
-    callbackName: &apos;table2&apos;,
-    el: &apos;table2&apos;,
-    url: base
-  });</screen>
+  dataelements: [&apos;s46m5MS0hxu&apos;, &apos;YtbsuPPo010&apos;, &apos;xc8gmAKfO95&apos;, &apos;UOlfIjgN8X6&apos;],
+  periods: [&apos;last4Quarters&apos;],
+  orgunits: [&apos;ImspTQPwCqd&apos;],
+  crosstab: [&apos;data&apos;],
+  useExtGrid: false,
+  callbackName: &apos;table2&apos;,
+  el: &apos;table2&apos;,
+  url: base
+});</screen>
     <para>Finally we insert in the Web page the div elements which are referred to in the table configuration and used to render the tables.</para>
     <screen>&lt;div id=&quot;table1&quot;&gt;&lt;/div&gt;
 &lt;div id=&quot;table2&quot;&gt;&lt;/div&gt;</screen>
     <para>To view a complete working example please visit <ulink url="http://apps.dhis2.org/portal/table.html"/>.</para>
+    <para>You can also choose to provide a link to the report table instead of rendering it directly on the web page. The configuration of the link function is very similar to the table function and shares the <emphasis role="italic">indicators</emphasis>, <emphasis role="italic">dataelements</emphasis>, <emphasis role="italic">datasets</emphasis>, <emphasis role="italic">periods</emphasis>, <emphasis role="italic">orgunits</emphasis>, <emphasis role="italic">orgUnitIsParent</emphasis>, <emphasis role="italic">crosstab</emphasis> and <emphasis role="italic">url</emphasis> properties. There is only one additional parameter which is listed in the table below.</para>
+    <table>
+      <title>Link plugin (additional) configuration</title>
+      <tgroup cols="5">
+        <tbody>
+          <row>
+            <entry>
+              <emphasis role="italic">Param</emphasis>
+            </entry>
+            <entry>
+              <emphasis role="italic">Type</emphasis>
+            </entry>
+            <entry>
+              <emphasis role="italic">Required</emphasis>
+            </entry>
+            <entry>
+              <emphasis role="italic">Options (default first)</emphasis>
+            </entry>
+            <entry>
+              <emphasis role="italic">Description</emphasis>
+            </entry>
+          </row>
+          <row>
+            <entry>format</entry>
+            <entry>string</entry>
+            <entry>No</entry>
+            <entry>html | xls | csv | pdf | json | xml</entry>
+            <entry>The representation format of the table, can be HTML, Excel, CSV, PDF, JSON and XML</entry>
+          </row>
+        </tbody>
+      </tgroup>
+    </table>
+    <para>Below is an example on how to use the link function. The link URL is retrieved from the <emphasis role="italic">getUrl</emphasis> function and later set as target for a link the HTML document.</para>
+    <screen>var url1 = DHIS.getUrl({
+  indicators: [&apos;Uvn6LCg7dVU&apos;],
+  periods: [&apos;last12Months&apos;],
+  orgunits: [&apos;ImspTQPwCqd&apos;],
+  crosstab: [&apos;periods&apos;],
+  orgUnitIsParent: true,
+  format: &apos;xls&apos;,
+  url: base
+});
+
+Ext.get(&apos;link1&apos;).set({href: url1});</screen>
+    <para>The link HTML element can be defined in the body section of the document like below.</para>
+    <screen>&lt;a id=&quot;link1&quot;&gt;Download as Excel&lt;/a&gt;</screen>
+    <para>To view a complete working example please visit <ulink url="http://apps.dhis2.org/portal/table.html"/>.</para>
   </section>
 </chapter>