Re: [Dhis2-devs] DHIS2 - Indicator calculation over dimensions

2014-10-05 Thread Dapo Adejumo
Hi Jason and Robin ( and Devs) ,

I decided to raise this question here since it is remotely related to the 
discussions below.

I want an indicator that has inputs beyond what is currently available for 
indicator definitions – for example

 

-Percentage of Health facilities with BCG coverage below 50%

Number of Health facilities can be pulled in using the orgunit count but the 
challenge is the numerator (number of health facilities with coverage less than 
50%) The BCG Coverage is calculated as a separate indicator but can technically 
be recalculated in the numerator definition – how can the 50% logic be 
introduced in the numerator formula?. The only work around I have thought of is 
the creation of a  dataelement like “ BCG Coverage less than 50%” that is 
populated by a script with a value 1 when coverage is less than 50% for the 
facility and then used as the numerator in the indicator calculation.

Jason and Robin have talked below on the possibility of extending the current 
configuration possibilities of  indicators probably including some Logic 
functions similar to what is in the Validation rules.

 

Has anybody dealt with similar scenarios like the  example above or any ideas 
on possible solutions.

Thanks!

 

 

………

Regards,

Dapo Adejumo

+2348033683677

Skype : dapojorge

 

From: Dhis2-devs 
[mailto:dhis2-devs-bounces+dapo_adejumo=yahoo@lists.launchpad.net] On 
Behalf Of Jason Pickering
Sent: 16 September, 2014 9:06 AM
To: Robin Martens
Cc: dhis2-us...@lists.launchpad.net; dhis2-devs
Subject: Re: [Dhis2-devs] DHIS2 - Indicator calculation over dimensions

 

Hi Robin,

 

I think that is the real issue, namely that you are applying DHIS2 in a domain 
which is slightly different than it's typical domain, namely health. I have 
been involved in some other projects with DHIS2 on the fringes of what it can 
do out of the box in food security, water and sanitation, even using it for 
recording golf handicap scores. What I have seen in each of these domains is 
that there are some challenges with the way that the data is aggregated. Lots 
of things work out of the box, like data collection, user management and 
security, etc. But sometimes, the analysis needs to be done externally through 
other means. Of course, it would be great if DHIS2 could do all of this for all 
domains, but since its primary focus is on collection and management of health 
data, that is where things work most often (although there are some challenges 
there as well, particular on data which needs to be averaged or handled 
different in time or across orgunits, such as ART current count).  
Contributions from the community are of course welcome! :)

 

Regards,

Jason

 

 

On Fri, Sep 12, 2014 at 8:55 AM, Robin Martens mailto:mart...@sher.be> > wrote:

Hi Jason,

 

Thanks for taking the time to read through my email.

 

I'll have a look at the different possibilities you proposed, and we'll be 
looking forward to any future upgrade of the calculation method (for now or 
later). I guess it's just that some sectors need more complex indicators than 
others (our project is in forest management).

 

Have a nice day,

 

Robin

 

From: Jason Pickering [mailto:jason.p.picker...@gmail.com 
 ] 
Sent: 11 September 2014 19:00


To: Robin Martens
Cc: Lars Helge Øverland; dhis2-us...@lists.launchpad.net 
 ; dhis2-devs
Subject: Re: [Dhis2-devs] DHIS2 - Indicator calculation over dimensions

 

Hi Robin,

 

Your mail is dense and will need some digestion. :)

 

 You give a very good level of detail however of you problem in this mail and 
will be very useful as this type of functionality is attempted to be 
implemented. 

 

To respond immediately to how you might be able to solve the issue, you should 
possibly consider using the WebAPI to extract your data, process it as you 
need, and then inject it back into DHIS2. The WebAPI is described in detail 
here  . I have also 
written a chapter on the use of the R programming language with DHIS2, which is 
particularly well suited to do the type of custom calculations you are 
describing here. It is available here 
 . Of course, other 
language/methods may also be more suited to your situation, such as Python. 
Lastly, you can have a look at the DHIS2 Ad-hoc tool 

  which would allow interaction with the service layer of DHIS2. Another 
approach could be SQL which interacts directly with the database. I am sure 
there are many other means as well. So short answer is, right now there is no 
in-built way to achieve what you need I think, and it will take some coding on 
your side.

 

We have run into similar issues in the water and sanitation sector, where we 
need to work w

Re: [Dhis2-devs] DHIS2 - Indicator calculation over dimensions

2014-10-05 Thread Jason Pickering
Hi Dapo,

I think it is related in that it shows how we cannot calculate more
"complicated" indicators. In this case, it is really a case of having some
operator like "IF" in spreadhseet programs. E.g...

IF(logical_test ,true_value,false_value)

In your case, it would be something like IF (BCG coverage < 50%, 1, 0 )

This need for this operator has come up a few times, and it would be good
to see how this could be improved. Even better would be the ability to
support a standard scripting language/syntax which could be used to support
different types of indicators which we may not have thought of yet.

I think the only solution would be some type of report which would pull all
of the BCG values at the desired OU level, apply the formula above, and
return the result (or of course, some sort of database script which could
automatically calculate the value ).

Regards,
Jason




On Sun, Oct 5, 2014 at 11:55 AM, Dapo Adejumo 
wrote:

> Hi Jason and Robin ( and Devs) ,
>
> I decided to raise this question here since it is remotely related to the
> discussions below.
>
> I want an indicator that has inputs beyond what is currently available for
> indicator definitions – for example
>
>
>
> -Percentage of Health facilities with BCG coverage below 50%
>
> Number of Health facilities can be pulled in using the orgunit count but
> the challenge is the numerator (number of health facilities with coverage
> less than 50%) The BCG Coverage is calculated as a separate indicator but
> can technically be recalculated in the numerator definition – how can the
> 50% logic be introduced in the numerator formula?. The only work around I
> have thought of is the creation of a  dataelement like “ BCG Coverage less
> than 50%” that is populated by a script with a value 1 when coverage is
> less than 50% for the facility and then used as the numerator in the
> indicator calculation.
>
> Jason and Robin have talked below on the possibility of extending the
> current configuration possibilities of  indicators probably including some
> Logic functions similar to what is in the Validation rules.
>
>
>
> Has anybody dealt with similar scenarios like the  example above or any
> ideas on possible solutions.
>
> Thanks!
>
>
>
>
>
> ………
>
> *Regards,*
>
> *Dapo Adejumo*
>
> *+2348033683677 <%2B2348033683677>*
>
> *Skype : dapojorge*
>
>
>
> *From:* Dhis2-devs [mailto:dhis2-devs-bounces+dapo_adejumo=
> yahoo@lists.launchpad.net] *On Behalf Of *Jason Pickering
> *Sent:* 16 September, 2014 9:06 AM
> *To:* Robin Martens
> *Cc:* dhis2-us...@lists.launchpad.net; dhis2-devs
>
> *Subject:* Re: [Dhis2-devs] DHIS2 - Indicator calculation over dimensions
>
>
>
> Hi Robin,
>
>
>
> I think that is the real issue, namely that you are applying DHIS2 in a
> domain which is slightly different than it's typical domain, namely health.
> I have been involved in some other projects with DHIS2 on the fringes of
> what it can do out of the box in food security, water and sanitation, even
> using it for recording golf handicap scores. What I have seen in each of
> these domains is that there are some challenges with the way that the data
> is aggregated. Lots of things work out of the box, like data collection,
> user management and security, etc. But sometimes, the analysis needs to be
> done externally through other means. Of course, it would be great if DHIS2
> could do all of this for all domains, but since its primary focus is on
> collection and management of health data, that is where things work most
> often (although there are some challenges there as well, particular on data
> which needs to be averaged or handled different in time or across orgunits,
> such as ART current count).  Contributions from the community are of course
> welcome! :)
>
>
>
> Regards,
>
> Jason
>
>
>
>
>
> On Fri, Sep 12, 2014 at 8:55 AM, Robin Martens  wrote:
>
> Hi Jason,
>
>
>
> Thanks for taking the time to read through my email.
>
>
>
> I'll have a look at the different possibilities you proposed, and we'll be
> looking forward to any future upgrade of the calculation method (for now or
> later). I guess it's just that some sectors need more complex indicators
> than others (our project is in forest management).
>
>
>
> Have a nice day,
>
>
>
> Robin
>
>
>
> *From:* Jason Pickering [mailto:jason.p.picker...@gmail.com]
> *Sent:* 11 September 2014 19:00
>
>
> *To:* Robin Martens
> *Cc:* Lars Helge Øverland; dhis2-us...@lists.launchpad.net; dhis2-devs
> *Subject:* Re: [Dhis2-devs] DHIS2 - Indicator calculation over dimensions
>
>
>
> Hi Robin,
>
>
>
> Your mail is dense and will need some digestion. :)
>
>
>
>  You give a very good level of detail however of you problem in this mail
> and will be very useful as this type of functionality is attempted to be
> implemented.
>
>
>
> To respond immediately to how you might be able to solve the issue, you
> should possibly consider using the WebAPI to extract your data, process it
> as you need, and then inje

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 16958: SQL

2014-10-05 Thread noreply

revno: 16958
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Sun 2014-10-05 16:09:41 +0200
message:
  SQL
modified:
  resources/sql/div.sql
  resources/sql/integritychecks.sql


--
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 'resources/sql/div.sql'
--- resources/sql/div.sql	2014-10-04 12:27:48 +
+++ resources/sql/div.sql	2014-10-05 14:09:41 +
@@ -149,11 +149,12 @@
 
 -- Display overview of data elements and related category option combos
 
-select de.uid as deuid, de.name as dename, coc.uid as cocuid, con.categoryoptioncomboname
-from dataelement de
-join categorycombos_optioncombos cc using(categorycomboid)
-join categoryoptioncombo coc using(categoryoptioncomboid)
-join _categoryoptioncomboname con using(categoryoptioncomboid);
+select de.uid as dataelement_uid, de.name as dataelement_name, de.code as dataelement_code, coc.uid as optioncombo_uid, cocn.categoryoptioncomboname as optioncombo_name 
+from _dataelementcategoryoptioncombo dcoc 
+inner join dataelement de on dcoc.dataelementuid=de.uid 
+inner join categoryoptioncombo coc on dcoc.categoryoptioncombouid=coc.uid 
+inner join _categoryoptioncomboname cocn on coc.categoryoptioncomboid=cocn.categoryoptioncomboid 
+order by de.name;
 
 -- Display category option combo identifier and name
 
@@ -162,6 +163,16 @@
 join _categoryoptioncomboname cn
 on (cc.categoryoptioncomboid=cn.categoryoptioncomboid);
 
+-- Display overview of category option combo
+
+select coc.categoryoptioncomboid as coc_id, coc.uid as coc_uid, co.categoryoptionid as co_id, co.name as co_name, cc.categorycomboid as cc_id, cc.name as cc_name
+from categoryoptioncombo coc 
+inner join categoryoptioncombos_categoryoptions coo on coc.categoryoptioncomboid=coo.categoryoptioncomboid
+inner join dataelementcategoryoption co on coo.categoryoptionid=co.categoryoptionid
+inner join categorycombos_optioncombos cco on coc.categoryoptioncomboid=cco.categoryoptioncomboid
+inner join categorycombo cc on cco.categorycomboid=cc.categorycomboid
+where coc.categoryoptioncomboid=2118430;
+
 -- Display data out of reasonable time range
 
 select *

=== modified file 'resources/sql/integritychecks.sql'
--- resources/sql/integritychecks.sql	2014-09-30 08:04:49 +
+++ resources/sql/integritychecks.sql	2014-10-05 14:09:41 +
@@ -133,6 +133,10 @@
 
 select * from categorycombo where categorycomboid not in (select distinct categorycomboid from categorycombos_categories);
 
+-- Get category options with more than one membership for a category 
+
+select categoryid, categoryoptionid, count(*) from categories_categoryoptions group by categoryid, categoryoptionid having count(*) > 1;
+
 -- Get category options with count of memberships in categories
 
 select cc.categoryoptionid, co.name, (

___
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] Clearing DHIS2 cache via the Web API

2014-10-05 Thread Farai Mutero
Hi Guys

Is there any way to clear the DHIS2 cache using the Web API?

Regards

-- 
Farai Mutero
___
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] Clearing DHIS2 cache via the Web API

2014-10-05 Thread Knut Staring
https://www.dhis2.org/doc/snapshot/en/user/html/ch32s25.html

On Sun, Oct 5, 2014 at 5:08 PM, Farai Mutero  wrote:

> Hi Guys
>
> Is there any way to clear the DHIS2 cache using the Web API?
>
> Regards
>
> --
> Farai Mutero
>
>
> ___
> 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
>
>


-- 
Knut Staring
Dept. of Informatics, University of Oslo
+4791880522
Skype: knutstar
http://dhis2.org
___
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] Clearing DHIS2 cache via the Web API

2014-10-05 Thread Knut Staring
Not the same thing of course, but wanted to also mention this new tutorial:
https://www.dhis2.org/tutorials/how-to-really-clear-browser-cache

Knut

On Sun, Oct 5, 2014 at 5:41 PM, Knut Staring  wrote:

> https://www.dhis2.org/doc/snapshot/en/user/html/ch32s25.html
>
> On Sun, Oct 5, 2014 at 5:08 PM, Farai Mutero  wrote:
>
>> Hi Guys
>>
>> Is there any way to clear the DHIS2 cache using the Web API?
>>
>> Regards
>>
>> --
>> Farai Mutero
>>
>>
>> ___
>> 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
>>
>>
>
>
> --
> Knut Staring
> Dept. of Informatics, University of Oslo
> +4791880522
> Skype: knutstar
> http://dhis2.org
>



-- 
Knut Staring
Dept. of Informatics, University of Oslo
+4791880522
Skype: knutstar
http://dhis2.org
___
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] Cannot get datafrom API and ask for api version

2014-10-05 Thread winhtaik aung
Dear devs,
I cannot grab api data via this URL(http://localhost:8082/api/dashboardItems) 
it just only shows "Object not found for uid: dashboardItems".
And i also put ".json" .
So i pass the uid parameter as dashboard uid. then its didin't show the above 
error. And also didn't return any data.

Once i checked in database it was existed.
API VersionIs there any api versions for old builds of DHIS like dhis 2.15. 
I Recently update my dhis version from 2.15 to 2.16 and most of my working 
webapps in 2.15 are almost crashed.

RegardsWin Htaik Aung(WHA)Contact on Skype winhtaikaung28
  ___
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] DHIS2 - Indicator calculation over dimensions

2014-10-05 Thread Dapo Adejumo
Thanks Jason – Was shying away from a report solution to a more permanent one. 

Extra operators or tools to extend the functionality of indicator calculations 
will improve what we currently have – A blueprint will probably be in order.

 

………

Regards,

Dapo Adejumo

+2348033683677

Skype : dapojorge

 

From: Jason Pickering [mailto:jason.p.picker...@gmail.com] 
Sent: 5 October, 2014 2:27 PM
To: Dapo Adejumo
Cc: Robin Martens; dhis2-us...@lists.launchpad.net; dhis2-devs
Subject: Re: [Dhis2-devs] DHIS2 - Indicator calculation over dimensions

 

Hi Dapo,

 

I think it is related in that it shows how we cannot calculate more 
"complicated" indicators. In this case, it is really a case of having some 
operator like "IF" in spreadhseet programs. E.g...

 

IF(logical_test ,true_value,false_value)

 

In your case, it would be something like IF (BCG coverage < 50%, 1, 0 ) 

 

This need for this operator has come up a few times, and it would be good to 
see how this could be improved. Even better would be the ability to support a 
standard scripting language/syntax which could be used to support different 
types of indicators which we may not have thought of yet. 

 

I think the only solution would be some type of report which would pull all of 
the BCG values at the desired OU level, apply the formula above, and return the 
result (or of course, some sort of database script which could automatically 
calculate the value ). 

 

Regards,

Jason

 

 

 

 

On Sun, Oct 5, 2014 at 11:55 AM, Dapo Adejumo mailto:dapo_adej...@yahoo.com> > wrote:

Hi Jason and Robin ( and Devs) ,

I decided to raise this question here since it is remotely related to the 
discussions below.

I want an indicator that has inputs beyond what is currently available for 
indicator definitions – for example

 

-Percentage of Health facilities with BCG coverage below 50%

Number of Health facilities can be pulled in using the orgunit count but the 
challenge is the numerator (number of health facilities with coverage less than 
50%) The BCG Coverage is calculated as a separate indicator but can technically 
be recalculated in the numerator definition – how can the 50% logic be 
introduced in the numerator formula?. The only work around I have thought of is 
the creation of a  dataelement like “ BCG Coverage less than 50%” that is 
populated by a script with a value 1 when coverage is less than 50% for the 
facility and then used as the numerator in the indicator calculation.

Jason and Robin have talked below on the possibility of extending the current 
configuration possibilities of  indicators probably including some Logic 
functions similar to what is in the Validation rules.

 

Has anybody dealt with similar scenarios like the  example above or any ideas 
on possible solutions.

Thanks!

 

 

………

Regards,

Dapo Adejumo

+2348033683677  

Skype : dapojorge

 

From: Dhis2-devs [mailto:dhis2-devs-bounces+dapo_adejumo 
 =yahoo@lists.launchpad.net 
 ] On Behalf Of Jason Pickering
Sent: 16 September, 2014 9:06 AM
To: Robin Martens
Cc: dhis2-us...@lists.launchpad.net  ; 
dhis2-devs


Subject: Re: [Dhis2-devs] DHIS2 - Indicator calculation over dimensions

 

Hi Robin,

 

I think that is the real issue, namely that you are applying DHIS2 in a domain 
which is slightly different than it's typical domain, namely health. I have 
been involved in some other projects with DHIS2 on the fringes of what it can 
do out of the box in food security, water and sanitation, even using it for 
recording golf handicap scores. What I have seen in each of these domains is 
that there are some challenges with the way that the data is aggregated. Lots 
of things work out of the box, like data collection, user management and 
security, etc. But sometimes, the analysis needs to be done externally through 
other means. Of course, it would be great if DHIS2 could do all of this for all 
domains, but since its primary focus is on collection and management of health 
data, that is where things work most often (although there are some challenges 
there as well, particular on data which needs to be averaged or handled 
different in time or across orgunits, such as ART current count).  
Contributions from the community are of course welcome! :)

 

Regards,

Jason

 

 

On Fri, Sep 12, 2014 at 8:55 AM, Robin Martens mailto:mart...@sher.be> > wrote:

Hi Jason,

 

Thanks for taking the time to read through my email.

 

I'll have a look at the different possibilities you proposed, and we'll be 
looking forward to any future upgrade of the calculation method (for now or 
later). I guess it's just that some sectors need more complex indicators than 
others (our project is in forest management).

 

Have a nice day,

 

Robin

 

From: Jason Pickering [mailto:jason.p.picker...@gmail.com 


Re: [Dhis2-devs] Clearing DHIS2 cache via the Web API

2014-10-05 Thread Farai Mutero
Thanks a lot Knut. Much appreciated!

On Sun, Oct 5, 2014 at 5:43 PM, Knut Staring  wrote:

> Not the same thing of course, but wanted to also mention this new tutorial:
> https://www.dhis2.org/tutorials/how-to-really-clear-browser-cache
>
> Knut
>
> On Sun, Oct 5, 2014 at 5:41 PM, Knut Staring  wrote:
>
>> https://www.dhis2.org/doc/snapshot/en/user/html/ch32s25.html
>>
>> On Sun, Oct 5, 2014 at 5:08 PM, Farai Mutero  wrote:
>>
>>> Hi Guys
>>>
>>> Is there any way to clear the DHIS2 cache using the Web API?
>>>
>>> Regards
>>>
>>> --
>>> Farai Mutero
>>>
>>>
>>> ___
>>> 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
>>>
>>>
>>
>>
>> --
>> Knut Staring
>> Dept. of Informatics, University of Oslo
>> +4791880522
>> Skype: knutstar
>> http://dhis2.org
>>
>
>
>
> --
> Knut Staring
> Dept. of Informatics, University of Oslo
> +4791880522
> Skype: knutstar
> http://dhis2.org
>



-- 
Farai Mutero
___
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 16959: add hooks in AbstractCrudController for pre-create and pre-update of entity

2014-10-05 Thread noreply

revno: 16959
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Mon 2014-10-06 12:18:37 +0700
message:
  add hooks in AbstractCrudController for pre-create and pre-update of entity
modified:
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java


--
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-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2014-10-02 10:36:25 +
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2014-10-06 05:18:37 +
@@ -130,7 +130,7 @@
 // GET
 //--
 
-@RequestMapping( method = RequestMethod.GET )
+@RequestMapping(method = RequestMethod.GET)
 public @ResponseBody RootNode getObjectList(
 @RequestParam Map parameters, HttpServletResponse response, HttpServletRequest request )
 {
@@ -251,9 +251,9 @@
 return rootNode;
 }
 
-@RequestMapping( value = "/{uid}", method = RequestMethod.GET )
+@RequestMapping(value = "/{uid}", method = RequestMethod.GET)
 public @ResponseBody RootNode getObject(
-@PathVariable( "uid" ) String pvUid,
+@PathVariable("uid") String pvUid,
 @RequestParam Map parameters,
 HttpServletRequest request, HttpServletResponse response ) throws Exception
 {
@@ -268,10 +268,10 @@
 return getObjectInternal( pvUid, parameters, filters, fields );
 }
 
-@RequestMapping( value = "/{uid}/{property}", method = RequestMethod.GET )
+@RequestMapping(value = "/{uid}/{property}", method = RequestMethod.GET)
 public @ResponseBody RootNode getObjectProperty(
-@PathVariable( "uid" ) String uid,
-@PathVariable( "property" ) String pvProperty,
+@PathVariable("uid") String uid,
+@PathVariable("property") String pvProperty,
 @RequestParam Map parameters, HttpServletRequest request, HttpServletResponse response ) throws Exception
 {
 return getObjectInternal( uid, parameters, Lists.newArrayList(), Lists.newArrayList( pvProperty + "[:all]" ) );
@@ -335,7 +335,7 @@
 // POST
 //--
 
-@RequestMapping( method = RequestMethod.POST, consumes = { "application/xml", "text/xml" } )
+@RequestMapping(method = RequestMethod.POST, consumes = { "application/xml", "text/xml" })
 public void postXmlObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception
 {
 if ( !aclService.canCreate( currentUserService.getCurrentUser(), getEntityClass() ) )
@@ -344,6 +344,9 @@
 }
 
 T parsed = renderService.fromXml( request.getInputStream(), getEntityClass() );
+
+preCreateEntity( parsed );
+
 ImportTypeSummary summary = importService.importObject( currentUserService.getCurrentUser().getUid(), parsed, ImportStrategy.CREATE );
 
 if ( ImportStatus.SUCCESS.equals( summary.getStatus() ) )
@@ -360,7 +363,7 @@
 renderService.toXml( response.getOutputStream(), summary );
 }
 
-@RequestMapping( method = RequestMethod.POST, consumes = "application/json" )
+@RequestMapping(method = RequestMethod.POST, consumes = "application/json")
 public void postJsonObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception
 {
 if ( !aclService.canCreate( currentUserService.getCurrentUser(), getEntityClass() ) )
@@ -369,6 +372,9 @@
 }
 
 T parsed = renderService.fromJson( request.getInputStream(), getEntityClass() );
+
+preCreateEntity( parsed );
+
 ImportTypeSummary summary = importService.importObject( currentUserService.getCurrentUser().getUid(), parsed, ImportStrategy.CREATE );
 
 if ( ImportStatus.SUCCESS.equals( summary.getStatus() ) )
@@ -389,9 +395,8 @@
 // PUT
 //--
 
-@RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_XML_VALUE } )
-@ResponseStatus( value = HttpStatus.NO_CONTENT )
-public void putXmlObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream
+@RequestMapping(value = "/{uid}", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_XML_VALUE })
+public void putXmlObject( HttpSer

[Dhis2-devs] Permission denied for relation i18nlocale

2014-10-05 Thread Timothy Harding
Hello DHIS2 Developer's List

I'm attempting to spin up a couple test instances of DHIS2 inside Ubuntu
14.04 and with both 2.14 and 2.16 and am encountering some problems.

If create the postgres user (dhis) and the db (dhis2) and do nothing else,
I get the demo version (admin:district) for both 2.14 and 2.16. So tomcat
and postgresql are talking and the server is capable of starting and
serving pages. I then delete the DB, recreate a blank one and import a
database dump from our production server (version 2.14). Things go well
until I execute ./tomcat-dhis/bin/startup.sh this time, the system will
fail to start either 2.14 or 2.16. Interestingly enough, I can do the exact
same process in Windows 7 (Postgres and Tomcat again) and 2.14 starts up
without issue, but I have not tested 2.16 in Windows yet. I'm encountering
the following error after startup routine 11 of 11 is complete. I've
included a snippet below from 2.14, and have attached the entire log to
this email.

System: Ubuntu 14.04
PostgreSQL 9.3.5
Tomcat7

* ERROR 2014-10-06 16:06:51,792 ERROR: permission denied for relation
i18nlocale (SqlExceptionHelper.java [localhost-startStop-1])
* ERROR 2014-10-06 16:06:51,812
org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at
org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:122)
at
org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
(...)
Caused by: org.postgresql.util.PSQLException: ERROR: permission denied for
relation i18nlocale
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
(...)
Oct 06, 2014 4:06:51 PM org.apache.catalina.core.StandardContext
startInternal
SEVERE: Error listenerStart
Oct 06, 2014 4:06:51 PM org.apache.catalina.core.StandardContext
startInternal
SEVERE: Context [] startup failed due to previous errors

Any ideas or suggestions are appreciated. I'm both trying to learn how to
use Ubuntu with DHIS2 (used the following:
https://www.dhis2.org/doc/snapshot/en/implementer/html/ch08s02.html) and
attempting to test our migration from 2.14 to 2.16. Thanks!



Timothy Harding
PeaceCorps Volunteer
Republic of Vanuatu
hardi...@gmail.com
+678 5955137
Ubuntu 14.04:

Oct 06, 2014 4:05:17 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Oct 06, 2014 4:05:17 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1212 ms
Oct 06, 2014 4:05:17 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Oct 06, 2014 4:05:17 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Oct 06, 2014 4:05:17 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /home/dhis/tomcat-dhis/webapps/ROOT.war
* INFO  2014-10-06 16:05:53,958 System property dhis2.home not set 
(DefaultLocationManager.java [localhost-startStop-1])
* INFO  2014-10-06 16:05:53,965 Environment variable DHIS2_HOME points to 
/home/dhis/config (DefaultLocationManager.java [localhost-startStop-1])
* INFO  2014-10-06 16:05:56,989 Hibernate configuration loaded, using dialect: 
org.hibernate.dialect.PostgreSQLDialect 
(DefaultHibernateConfigurationProvider.java [localhost-startStop-1])
* ERROR 2014-10-06 16:06:13,738 HHH000388: Unsuccessful: alter table 
validationrulegroupmembers add constraint 
fk_validationrulegroupmembers_validationrulegroupid foreign key 
(validationgroupid) references validationrulegroup (SchemaUpdate.java 
[localhost-startStop-1])
* ERROR 2014-10-06 16:06:13,739 ERROR: must be owner of relation 
validationrulegroupmembers (SchemaUpdate.java [localhost-startStop-1])
* ERROR 2014-10-06 16:06:13,742 HHH000388: Unsuccessful: alter table 
validationrulegroupuserrolestoalert add constraint 
fk_validationrulegroupuserrolestoalert_validationgroupid foreign key 
(validationgroupid) references validationrulegroup (SchemaUpdate.java 
[localhost-startStop-1])
* ERROR 2014-10-06 16:06:13,744 ERROR: must be owner of relation 
validationrulegroupuserrolestoalert (SchemaUpdate.java [localhost-startStop-1])
* INFO  2014-10-06 16:06:27,024 Found the following message senders: 
[org.hisp.dhis.message.EmailMessageSender@461e3c46, 
org.hisp.dhis.sms.SmsMessageSender@6b073ba0] (DefaultMessageService.java 
[localhost-startStop-1])
* INFO  2014-10-06 16:06:36,260 Detected apps: [] (DefaultAppManager.java 
[localhost-startStop-1])
* INFO  2014-10-06 16:06:38,219 Scheduled task with key: 0 0 0 ? * 1-6 and 
cron: 0 0 0 ? * 1-6 (SpringScheduler.java [localhost-startStop-1])
* INFO  2014-10-06 16:06:38,221 Scheduled task with key: 0 0 0 ? * 0 and cron: 
0 0 0 ? * 0 (SpringScheduler.java [localhost-startStop-1])
* INFO  2014-10-06 16:06:43,265 Executing startup rou

[Dhis2-devs] [Bug 1246220] Re: Problem with pivot tables when exporting/importing configs

2014-10-05 Thread Morten Olav Hansen
** Changed in: dhis2
Milestone: 2.13 => 2.16

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1246220

Title:
  Problem with pivot tables when exporting/importing configs

Status in DHIS 2:
  Confirmed

Bug description:
  I found a problem with “pivot table with details “ when importing new
  configurations using dhis 2.13.

  My case: I have configured an pivot table in an 2.13 dhis instance and 
everything is fine. 
  I exported and imported the configuration in another instance (same version), 
the pivot table appears unconfigured. 

  
  DHIS2 Version: 2.13
  Building: 12768

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1246220/+subscriptions

___
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 16960: minor indent fix

2014-10-05 Thread noreply

revno: 16960
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Mon 2014-10-06 13:14:06 +0700
message:
  minor indent fix
modified:
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java


--
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-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2014-10-06 05:18:37 +
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2014-10-06 06:14:06 +
@@ -130,7 +130,7 @@
 // GET
 //--
 
-@RequestMapping(method = RequestMethod.GET)
+@RequestMapping( method = RequestMethod.GET )
 public @ResponseBody RootNode getObjectList(
 @RequestParam Map parameters, HttpServletResponse response, HttpServletRequest request )
 {
@@ -251,9 +251,9 @@
 return rootNode;
 }
 
-@RequestMapping(value = "/{uid}", method = RequestMethod.GET)
+@RequestMapping( value = "/{uid}", method = RequestMethod.GET )
 public @ResponseBody RootNode getObject(
-@PathVariable("uid") String pvUid,
+@PathVariable( "uid" ) String pvUid,
 @RequestParam Map parameters,
 HttpServletRequest request, HttpServletResponse response ) throws Exception
 {
@@ -268,10 +268,10 @@
 return getObjectInternal( pvUid, parameters, filters, fields );
 }
 
-@RequestMapping(value = "/{uid}/{property}", method = RequestMethod.GET)
+@RequestMapping( value = "/{uid}/{property}", method = RequestMethod.GET )
 public @ResponseBody RootNode getObjectProperty(
-@PathVariable("uid") String uid,
-@PathVariable("property") String pvProperty,
+@PathVariable( "uid" ) String uid,
+@PathVariable( "property" ) String pvProperty,
 @RequestParam Map parameters, HttpServletRequest request, HttpServletResponse response ) throws Exception
 {
 return getObjectInternal( uid, parameters, Lists.newArrayList(), Lists.newArrayList( pvProperty + "[:all]" ) );
@@ -335,7 +335,7 @@
 // POST
 //--
 
-@RequestMapping(method = RequestMethod.POST, consumes = { "application/xml", "text/xml" })
+@RequestMapping( method = RequestMethod.POST, consumes = { "application/xml", "text/xml" } )
 public void postXmlObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception
 {
 if ( !aclService.canCreate( currentUserService.getCurrentUser(), getEntityClass() ) )
@@ -363,7 +363,7 @@
 renderService.toXml( response.getOutputStream(), summary );
 }
 
-@RequestMapping(method = RequestMethod.POST, consumes = "application/json")
+@RequestMapping( method = RequestMethod.POST, consumes = "application/json" )
 public void postJsonObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception
 {
 if ( !aclService.canCreate( currentUserService.getCurrentUser(), getEntityClass() ) )
@@ -395,8 +395,8 @@
 // PUT
 //--
 
-@RequestMapping(value = "/{uid}", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_XML_VALUE })
-public void putXmlObject( HttpServletResponse response, HttpServletRequest request, @PathVariable("uid") String uid, InputStream
+@RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_XML_VALUE } )
+public void putXmlObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream
 input ) throws Exception
 {
 List objects = getEntity( uid );
@@ -427,8 +427,8 @@
 renderService.toXml( response.getOutputStream(), summary );
 }
 
-@RequestMapping(value = "/{uid}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
-public void putJsonObject( HttpServletResponse response, HttpServletRequest request, @PathVariable("uid") String uid, InputStream
+@RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE )
+public void putJsonObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream
 input ) throws Exception
 {
 List objects = getEntity( uid );
@@ -46