← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-documenters/dhis2/dhis2-docbook-docs] Rev 1130: Web api, files resource

 

------------------------------------------------------------
revno: 1130
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2-docbook-docs
timestamp: Wed 2014-07-09 10:10:45 +0200
message:
  Web api, files resource
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	2014-07-07 09:14:05 +0000
+++ src/docbkx/en/dhis2_user_man_web_api.xml	2014-07-09 08:10:45 +0000
@@ -5028,6 +5028,37 @@
     <para>Example 3: Get JSON schema for a specific class:<screen>GET /api/schemas/dataElement.json</screen></para>
   </section>
   <section>
+    <title>UI Customization</title>
+    <para>To customize the UI of the DHIS 2 application you can insert custom Javascript and CSS
+      styles through the <emphasis role="italic">files</emphasis> resource. The Javascript and CSS
+      content inserted through this resource will be loaded by the DHIS 2 web application. This can
+      be particularly useful in certain situations:</para>
+    <itemizedlist>
+      <listitem>
+        <para>Overriding the CSS styles of the DHIS 2 application, such as the login page or main
+          page.</para>
+      </listitem>
+      <listitem>
+        <para>Defining Javascript functions which are common to several custom data entry forms and
+          HTML-based reports.</para>
+      </listitem>
+      <listitem>
+        <para>Including CSS styles which are used in custom data entry forms and HTML-based
+          reports.</para>
+      </listitem>
+    </itemizedlist>
+    <para>To insert Javascript from a file called <emphasis role="italic">script.js</emphasis> you
+      can interact with the <emphasis role="italic">files/script</emphasis> resource:</para>
+    <screen>curl -d @script.js "localhost/api/files/script" -H "Content-Type:application/javascript" -u system:System123 -v</screen>
+    <para>You can fetch the Javascript content with a GET-request:</para>
+    <screen>localhost/api/files/script</screen>
+    <para>To insert CSS from a file called <emphasis role="italic">style.css</emphasis> you can
+      interact with the <emphasis role="italic">files/style</emphasis> resource:</para>
+    <screen>curl -d @style.css "localhost/api/files/style" -H "Content-Type:text/css" -u system:System123 -v</screen>
+    <para>You can fetch the CSS content with a GET-request:</para>
+    <screen>localhost/api/files/style</screen>
+  </section>
+  <section>
     <title>FRED API</title>
     <para>DHIS 2 from version 2.11 implements support for the current draft
       of the FRED API version 1.0. The project defines itself as <quote>open standard for sharing and updating