dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18556
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7860: Created place for sample routes under resources. Added an xml sample.
------------------------------------------------------------
revno: 7860
committer: Bob Jolliffe <bobjolliffe@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-08-05 17:46:27 +0100
message:
Created place for sample routes under resources. Added an xml sample.
added:
resources/routes/
resources/routes/xml/
resources/routes/xml/ou_updater.xml
--
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 directory 'resources/routes'
=== added directory 'resources/routes/xml'
=== added file 'resources/routes/xml/ou_updater.xml'
--- resources/routes/xml/ou_updater.xml 1970-01-01 00:00:00 +0000
+++ resources/routes/xml/ou_updater.xml 2012-08-05 16:46:27 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<route xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://camel.apache.org/schema/spring camel-spring-2.9.1.xsd"
+ xmlns="http://camel.apache.org/schema/spring" id="dataUpdater">
+
+ <description>Synch orgunits every 5 minutes</description>
+ <!-- trigger every 5 minutes ... -->
+ <from uri="quartz://everyHour?cron=0+0/5+*+*+*+%3F"/>
+ <!-- filter required elements from metadata export -->
+ <setHeader headerName="CamelHttpQuery">
+ <constant>assumeTrue=false&organisationUnits=true&organisationUnitGroups=true&organisationUnitGroupSets=true&organisationUnitLevels=true&attributeTypes=true</constant>
+ </setHeader>
+ <!-- send http request -->
+ <to
+ uri="http://apps.dhis2.org/demo/api/metaData.xml?httpClient.authenticationPreemptive=true&authMethod=Basic&authUsername=system&authPassword=System123"/>
+ <log logName="org.hisp.dhis.camel" loggingLevel="INFO" message="Importing orgunits"/>
+ <!-- import to dhis2 component -->
+ <inOut uri="dhis2:metadata"/>
+ <!-- log the import summary -->
+ <log logName="org.hisp.dhis.camel" loggingLevel="INFO" message="${body}"/>
+</route>