[Dhis2-devs] DHIS Analytics Schedule

2015-07-31 Thread Rodolfo Melia
Hi - by default, once you schedule the analytics in DHIS, they run at
midnight every night.

The project that I'm working on has 10 years of data, and it takes about
60secs to run. The users would like to schedule the analtyics every 60min -
how can I set the server to run hourly? The UI doesn't allow this setting,
but there must be a way of hacking the associated task. Have anyone do it?

R
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] DHIS Analytics Schedule

2015-07-31 Thread Jason Pickering
Hi Rodolfo,
You can just use a cron job to start the analytics. You can ready about it
here

https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s29.html

Most any scripting language (bash, python, NodeJS, R) to do fancy stuff or
just plain call to curl should work fine.

Regards,
Jason


On Fri, Jul 31, 2015 at 10:43 AM, Rodolfo Melia  wrote:

> Hi - by default, once you schedule the analytics in DHIS, they run at
> midnight every night.
>
> The project that I'm working on has 10 years of data, and it takes about
> 60secs to run. The users would like to schedule the analtyics every 60min -
> how can I set the server to run hourly? The UI doesn't allow this setting,
> but there must be a way of hacking the associated task. Have anyone do it?
>
> R
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Jason P. Pickering
email: jason.p.picker...@gmail.com
tel:+46764147049
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19692: Externalized CacheStrategy and added Cacheable interface plus implementation thereof in Cacheable...

2015-07-31 Thread noreply
Merge authors:
  Halvdan Hoem Grelland (halvdanhg)

revno: 19692 [merge]
committer: Halvdan Hoem Grelland 
branch nick: dhis2
timestamp: Fri 2015-07-31 14:37:41 +0200
message:
  Externalized CacheStrategy and added Cacheable interface plus implementation 
thereof in CacheableBaseIdentifiableObject. Made Report and SqlView extends 
Cacheable, allowing web request caching to be set on a per object basis. Also 
made changes in Report and SqlView web UIs to set the cacheStrategy property on 
object creation or update. Any other object which should have the option of 
detailed cache control can extend CacheableBaseIdentifiableObject or implement 
Cacheable, as well as making sure the CacheStrategy is honored in the 
respective controllers.
added:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/cache/
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/cache/CacheStrategy.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/cache/Cacheable.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/cache/CacheableBaseIdentifiableObject.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java
  
dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/sqlview/hibernate/SqlView.hbm.xml
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  
dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties
  
dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml
  
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AnalyticsController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ChartController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DocumentController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EventAnalyticsController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/FileController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/FilteredMetaDataController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/MetaDataController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/PdfFormController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ReportController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ReportTableController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SqlViewController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SvgConversionController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventChartController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/TrackedEntityInstanceController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/mapping/MapController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/mapping/MapViewController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/ContextUtils.java
  
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/GetMessageRecipientsAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/AddSqlViewAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/UpdateSqlViewAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemGeneralSettings.vm
  
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java
  
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportAction.java
  
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/ExportTableAction.java
  
dhi

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19693: Minor: indentation consistency (use 4 spaces)

2015-07-31 Thread noreply

revno: 19693
committer: Halvdan Hoem Grelland 
branch nick: dhis2
timestamp: Fri 2015-07-31 14:46:03 +0200
message:
  Minor: indentation consistency (use 4 spaces)
modified:
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm
  
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm


--
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
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm	2015-07-31 10:51:43 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm	2015-07-31 12:46:03 +
@@ -5,52 +5,39 @@
 #sharingCreateNotification( "sqlView" )
 
 
-	
-		
-			$i18n.getString( "details" )
-		
-		
-			$encoder.htmlEncode( $i18n.getString( "name" ) ) *
-			
-		
-		
-			$encoder.htmlEncode( $i18n.getString( "description" ) )
-			
-		
-		
-			$encoder.htmlEncode( $i18n.getString( "sql_type" ) )
-			
-
-	$i18n.getString( "sql_view_type" ) ($i18n.getString( "created_in_database" ))
-	$i18n.getString( "materialized_sql_view_type" ) ($i18n.getString( "materialized_in_database" ))
-	$i18n.getString( "sql_query_type" ) ($i18n.getString( "allows_for_variables" ))
-
-			
-		
-		
-			$encoder.htmlEncode( $i18n.getString( "sql_statement" ) ) *
-			select 
-		
-		
-			$encoder.htmlEncode( $i18n.getString( "cache_strategy" ) )
-			
-
-	$i18n.getString( "respect_system_setting" )
-	$i18n.getString( "no_cache" )
-	$i18n.getString( "cache_for_one_hour" )
-	$i18n.getString( "cache_until_6am_tomorrow" )
-	$i18n.getString( "cache_for_two_weeks" )
-
-			
-		
-		
-			
-			
-
-
-			
-		
-	
+
+
+$i18n.getString( "details" )
+
+
+$encoder.htmlEncode( $i18n.getString( "name" ) ) *
+
+
+
+$encoder.htmlEncode( $i18n.getString( "description" ) )
+
+
+
+$encoder.htmlEncode( $i18n.getString( "sql_type" ) )
+
+
+$i18n.getString( "sql_view_type" ) ($i18n.getString( "created_in_database" ))
+$i18n.getString( "materialized_sql_view_type" ) ($i18n.getString( "materialized_in_database" ))
+$i18n.getString( "sql_query_type" ) ($i18n.getString( "allows_for_variables" ))
+
+
+
+
+$encoder.htmlEncode( $i18n.getString( "sql_statement" ) ) *
+select 
+
+
+
+
+
+
+
+
+
 
 
-

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm	2015-07-31 10:51:43 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm	2015-07-31 12:46:03 +
@@ -10,60 +10,49 @@
 #set( $type = $i18n.getString( "sql_query_type" ) )
 #end
 
-#set( $cacheStrategy = $sqlViewObject.cacheStrategy.name() )
-
 
 
-	
-		
-		
-		
-	
-
-	
-		
-			$i18n.getString( "details" )
-		
-		
-			$encoder.htmlEncode( $i18n.getString( "name" ) ) *
-			
-
-			
-		
-		
-			$encoder.htmlEncode( $i18n.getString( "description" ) )
-			
-$!encoder.htmlEncode( $!sqlViewObject.description )
-			
-		
-		
-			$encoder.htmlEncode( $i18n.getString( "sql_type" ) )
-			
-		
-		
-			$encoder.htmlEncode( $i18n.getString( "sql_statement" ) ) *
-			
-$!encoder.htmlEncode( $!sqlViewObject.sqlQuery )
-			
-		
-		
-			$encoder.htmlEncode( $i18n.getString( "cache_strategy" ) )
-			
-			
-$i18n.getString( "respect_system_setting" )
-$i18n.getString( "no_cache" )
-$i18n.getString( "cache_for_one_hour" )
-$i18n.getString( "cache_until_6am_tomorrow" )
-$i18n.getString( "cache_for_two_weeks" )
-			
-			
-		
-		
-			
-			
-
-
-			
-		
-	
+
+
+
+
+
+
+
+
+$i18n.getString( "details" )
+
+
+$encoder.htmlEncode( $i18n.getString( "name" ) )

Re: [Dhis2-devs] DHIS2 Docs

2015-07-31 Thread Halvdan Grelland
Yes, eventually we could probably do that.

First order of business is really to allow (external) files to be stored in
lieu of the value field of DataValue. The details of how the model will
look in the end is still to be decided and is very much dependent on the
requirements of the storage backend (I'm experimenting with Apache jClouds
to do this at the moment) and the range of uses we envision within DHIS2.

I would not recommend hacking a solution together using the datavalue.value
field. It might work (kind of), but is hardly scalable and will be (I
assure you) a complete pain to maintain and will be hard to migrate when we
eventually get a more integrated solution to this requirement.

As for ETA It's a bit up in the air currently. As said, it's proven to be
complex to implement properly.

Btw. Morten, there is an api/files endpoint (it's used to manage custom
css/js). ;)

2015-07-29 11:38 GMT+02:00 Morten Olav Hansen :

> We also already have the /api/documents endpoint, is the idea to somehow
> merge these similar functionalities? Maybe we need a /api/files endpoint..
> and we can deprecate /api/documents (and then later replace it with a
> document store as it has been discussed before... always wanted to remove
> /api/documents)
>
> --
> Morten
>
> On Wed, Jul 29, 2015 at 6:16 AM, Halvdan Grelland 
> wrote:
>
>> Definitely agree! The working title at the moment is 'file resource',
>> which seems to be descriptive enough and not too generic.
>>
>> 'Document' as it exists right now in dhis2 is really only local storage
>> with a relative path in the DB. 'File resources' could potentially replace
>> that (as a more flexible back end).
>>
>> (There are other questions brought up that I'd like to address but I'm on
>> my phone on terrible hotel wifi at the moment so will come back to those).
>> On 28 Jul 2015 4:45 pm, "Morten Olav Hansen"  wrote:
>>
>>> I don't like that we at naming the bp document. Let's file it a file api.
>>>
>>> As much as possible I want to save the wording document until we
>>> implement a proper nosql document storage.
>>>
>>> We already have /api:documents which I want to remove (I doubt many
>>> external apps depend on it)
>>>
>>> On Tuesday, July 28, 2015, Elmarie Claasen  wrote:
>>>
 Hi all, there is a blueprint for this already


 https://blueprints.launchpad.net/dhis2/+spec/document-dataelement-attribute-type

 Elmarie
 On 28 Jul 2015 11:27 AM, "Greg Rowles"  wrote:

> Hi Halvdan
>
> Sounds great and a good alternative! I'd like to work through an
> example or two:
>
> We have annual performance plans made up of multiple quarterly reports
> so I would expect there to be 2 data sets:
>  - Annual Performance Plans (fYear)
>  - Quarterly Performance Reports (fQuarter)
>
> If we configure these data sets to include a single data element of
> type 'Text' what name would we give to this element? 'Document' or 'File'?
>
> We're currently experimenting with ownCloud for document storage as an
> interim solution. I guess nothing stops us from loading the ownCloud URL
> into datavalue.value?
>
> Regards,
> Greg
>
>
>
> On Tue, Jul 28, 2015 at 10:49 AM, Harsh Atal 
> wrote:
>
>> Hello Halvdan,
>>
>> *We are planning on introducing files as a type for data values, as
>> well as data elements supporting this (document, images). You would then
>> use the datavalue model to implement these types of requirements.*
>>
>> ^^This is exactly what is needed by us. I didn't know this was
>> already in the works!!
>>
>> May be its a bit early to ask but.for which version is this
>> planned for? It will be of immense use in one of our projects.
>>
>> regards
>> harsh
>>
>> On 28 July 2015 at 14:10, Halvdan Grelland 
>> wrote:
>>
>>> We are planning on introducing files as a type for data values, as
>>> well as data elements supporting this (document, images). You would then
>>> use the datavalue model to implement these types of requirements.
>>>
>>> The implementation is in the works but is a fairly complex beast as
>>> we're juggling actual files outside of the database (we consider in-db
>>> storage of large blobs uscalable and a generally bad idea). We're also
>>> planning to enable offloading this to third party cloud storage (eg 
>>> amazon
>>> s3).
>>>
>>> I'm on holiday at the moment but please respond if you have any
>>> comments and I'll get back to you when I can.
>>> On 28 Jul 2015 10:02 am, "Greg Rowles" 
>>> wrote:
>>>
 Hi All

 These are the concepts we've been thinking about:

 DocumentSet, DocumentSetLevel, Document.


 [DocumentSet] would similar to data sets in that they are cyclical.
 They may have different periodTypes (e.g. yearly, fYe

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19694: minor

2015-07-31 Thread noreply

revno: 19694
committer: Markus Bekken 
branch nick: dhis2
timestamp: Fri 2015-07-31 23:45:44 +0200
message:
  minor
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js


--
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
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2015-07-13 07:37:11 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2015-07-31 21:45:44 +
@@ -725,7 +725,11 @@
 formattedTei.attributes = attributes;
 var promise = $http.post( '../api/trackedEntityInstances' , formattedTei ).then(function(response){
 return response.data;
-});
+}, function(response) {
+//Necessary now that import errors gives a 409 response from the server.
+//The 409 response is treated as an error response.
+return response.data;
+});
 return promise;
 },
 processAttributes: function(selectedTei, selectedProgram, selectedEnrollment){

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] DHIS Analytics Schedule

2015-07-31 Thread Rodolfo Melia
Jason - this is great. The load can be significantly reduced by skipping
the resource tables, and only regenerating the last year of data. Thanks so
much !

*Rodolfo MeliĆ”*
*Principal  |  *rme...@knowming.com
Skype: rod.melia  |  +44 777 576 4090  |  +1 708 872 7636
www.knowming.com

On Fri, Jul 31, 2015 at 9:57 AM, Jason Pickering <
jason.p.picker...@gmail.com> wrote:

> Hi Rodolfo,
> You can just use a cron job to start the analytics. You can ready about it
> here
>
> https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s29.html
>
> Most any scripting language (bash, python, NodeJS, R) to do fancy stuff or
> just plain call to curl should work fine.
>
> Regards,
> Jason
>
>
> On Fri, Jul 31, 2015 at 10:43 AM, Rodolfo Melia 
> wrote:
>
>> Hi - by default, once you schedule the analytics in DHIS, they run at
>> midnight every night.
>>
>> The project that I'm working on has 10 years of data, and it takes about
>> 60secs to run. The users would like to schedule the analtyics every 60min -
>> how can I set the server to run hourly? The UI doesn't allow this setting,
>> but there must be a way of hacking the associated task. Have anyone do it?
>>
>> R
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Jason P. Pickering
> email: jason.p.picker...@gmail.com
> tel:+46764147049
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp