← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15943: Added script for updating custom forms through web api

 

------------------------------------------------------------
revno: 15943
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-07-02 18:28:40 +0200
message:
  Added script for updating custom forms through web api
added:
  resources/util/put_custom_form.sh
renamed:
  resources/util/putdesign.sh => resources/util/put_report_design.sh


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== added file 'resources/util/put_custom_form.sh'
--- resources/util/put_custom_form.sh	1970-01-01 00:00:00 +0000
+++ resources/util/put_custom_form.sh	2014-07-02 16:28:40 +0000
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Requires cURL
+
+# Set these variables to your environment
+
+DATASET_UID="MoIMRSiNqHR" # UID on server, look up in Web API
+BASE_URL="http://localhost:8080"; # To DHIS instance
+USER="admin" # DHIS username
+PWD="district" # DHIS password
+FILENAME="form.html"
+
+# Constants, do not change
+
+URL="${BASE_URL}/api/dataSets/${DATASET_UID}/customDataEntryForm"
+
+echo "Using URL: ${URL}"
+
+# PUT to server
+
+`curl -d @${FILENAME} "${URL}" -H "Content-Type:text/html" -u ${USER}:${PWD} -X PUT -v`
+
+echo "Done"
+

=== renamed file 'resources/util/putdesign.sh' => 'resources/util/put_report_design.sh'