[Dhis2-devs] How to contribute?

2016-03-02 Thread Gautam Prajapati
Hi there,
I am Gautam Prajapati from Delhi Technological University, New Delhi,
India. I have good experience in Android Development. I have developed
Android apps for startups apart from making various apps for my personal
use. I have worked with various libraries like GCM, Volley, GSON, Jackson
etc, APIs like TMDB and technologies like Firebase. I am quite good at
UI/UX part in apps. I'm also good with linux and version control systems
like git/github.

I have recently joined the community and I want to know how can I start
contributing. Please help me with some links or introductory bugs so that I
can get familiar with the dhis2- android dashboard project.

Thanks!
___
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] GSoc' 16 : Improving the DHIS2 android dashboard and building a common app for all the DHIS2 apps.

2016-03-02 Thread Aman Dalmia
Hi, I am Aman Dalmia, Sophomore at Indian Institute of Technology,
Guwahati. I want to contribute towards improving the DHIS2 android
dashboard and building a common app for all the DHIS2 apps.
I have been an android developer for more than an year now, having recently
completed my winter intern at a startup.
These are some of my works:

   - Twango Persona
   
   - Eventify
   

   - Spirit
   
   - Yash Infotech
   

I intend to start working on the project from today itself. I'll be
starting up with bug-fixing and resolving issues. Should I be building the
wireframes for the new app/improved dashboard?

Thank You.
___
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] GSOC 2016

2016-03-02 Thread Natesh Relhan
Hey, I saw DHIS 2, and I am really interested to work on healthcare ideas,
so that my code saves life. Currently, I am in final year of college and
lead Android Developer  with a healthcare startup Curofy(www.curofy.com) in
India.

Just brief me about the start to get going with development of DHIS2
android application.

Natesh Relhan
LinkedIn - https://www.linkedin.com/in/natesh-relhan-b85b5065
Github - https://github.com/NateshR
___
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 22105: Feedback, minor

2016-03-02 Thread noreply

revno: 22105
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2016-03-02 12:54:40 +0100
message:
  Feedback, minor
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.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-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java	2016-02-27 06:45:30 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java	2016-03-02 11:54:40 +
@@ -307,7 +307,7 @@
 }
 else if ( trackedEntityAttribute.hasOptionSet() && !trackedEntityAttribute.isValidOptionValue( value ) )
 {
-return "Value '" + errorValue + "'is not a valid option for attribute " + 
+return "Value '" + errorValue + "' is not a valid option for attribute " + 
 trackedEntityAttribute.getUid() + " and option set " + trackedEntityAttribute.getOptionSet().getUid();
 }
 

___
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] Category combinations are not being generated properly

2016-03-02 Thread Sultanahamar Mohammad
Hi Team,

We are using dhis 2.21 and we have a category combination created for  3
dis-aggregations.
Population 1, Population2 (Population)
<5 y.o, >5 y.o (Age)
Male, Female, Undisclosed (gender)

Once category combinations are generated, we can see few extra combinations
coming up like
just population1 or population2. Please find the screenshot attached.

Is there something that we are missing or doing wrong. Please help us
resolve this.

Thanks and Regards,
Sultan Ahamar,
Thought Works
Hyderabad
___
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] Category combinations are not being generated properly

2016-03-02 Thread Lars Helge Øverland
Hi Sultan,

could you make sure that you do not have a category combination with only
the population category in your system?

regards,

Lars


On Wed, Mar 2, 2016 at 1:21 PM, Sultanahamar Mohammad <
sult...@thoughtworks.com> wrote:

> Hi Team,
>
> We are using dhis 2.21 and we have a category combination created for  3
> dis-aggregations.
> Population 1, Population2 (Population)
> <5 y.o, >5 y.o (Age)
> Male, Female, Undisclosed (gender)
>
> Once category combinations are generated, we can see few extra
> combinations coming up like
> just population1 or population2. Please find the screenshot attached.
>
> Is there something that we are missing or doing wrong. Please help us
> resolve this.
>
> Thanks and Regards,
> Sultan Ahamar,
> Thought Works
> Hyderabad
>
>
>
>
> ___
> 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
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.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] [Dhis2-users] Category combinations are not being generated properly

2016-03-02 Thread Uwe Wahser
Hi Sultan,

I have seen this in our system and suppose it comes from old dataValues, that
were loaded /entered before I added a new category into an existing
categoryCombination. The old values were still coded on the old
categoryOptionCombinations where the new category was missing.

I assume that DHIS2 does not delete obsolete categoryOptionCombinations, as long
as there are still dataValues linked to them.

Does that make sense, Lars?

Regards, Uwe


> Lars Helge Øverland  hat am 2. März 2016 um 15:24 geschrieben:
> 
> 
> Hi Sultan,
> 
> could you make sure that you do not have a category combination with only
> the population category in your system?
> 
> regards,
> 
> Lars
> 
> 
> On Wed, Mar 2, 2016 at 1:21 PM, Sultanahamar Mohammad <
> sult...@thoughtworks.com> wrote:
> 
> > Hi Team,
> >
> > We are using dhis 2.21 and we have a category combination created for  3
> > dis-aggregations.
> > Population 1, Population2 (Population)
> > <5 y.o, >5 y.o (Age)
> > Male, Female, Undisclosed (gender)
> >
> > Once category combinations are generated, we can see few extra
> > combinations coming up like
> > just population1 or population2. Please find the screenshot attached.
> >
> > Is there something that we are missing or doing wrong. Please help us
> > resolve this.
> >
> > Thanks and Regards,
> > Sultan Ahamar,
> > Thought Works
> > Hyderabad
> >
> >
> >
> >
> > ___
> > 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
> >
> >
> 
> 
> -- 
> Lars Helge Øverland
> Lead developer, DHIS 2
> University of Oslo
> Skype: larshelgeoverland
> http://www.dhis2.org 
> ___
> Mailing list: https://launchpad.net/~dhis2-users
> Post to : dhis2-us...@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp

___
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-users] Category combinations are not being generated properly

2016-03-02 Thread Lars Helge Øverland
On Wed, Mar 2, 2016 at 2:10 PM, Uwe Wahser  wrote:

> Hi Sultan,
>
> I have seen this in our system and suppose it comes from old dataValues,
> that
> were loaded /entered before I added a new category into an existing
> categoryCombination. The old values were still coded on the old
> categoryOptionCombinations where the new category was missing.
>
> I assume that DHIS2 does not delete obsolete categoryOptionCombinations,
> as long
> as there are still dataValues linked to them.
>
> Does that make sense, Lars?
>

Yes correct, that is a possibility.

Lars


>
> Regards, Uwe
>
>
> > Lars Helge Øverland  hat am 2. März 2016 um 15:24
> geschrieben:
> >
> >
> > Hi Sultan,
> >
> > could you make sure that you do not have a category combination with only
> > the population category in your system?
> >
> > regards,
> >
> > Lars
> >
> >
> > On Wed, Mar 2, 2016 at 1:21 PM, Sultanahamar Mohammad <
> > sult...@thoughtworks.com> wrote:
> >
> > > Hi Team,
> > >
> > > We are using dhis 2.21 and we have a category combination created for
> 3
> > > dis-aggregations.
> > > Population 1, Population2 (Population)
> > > <5 y.o, >5 y.o (Age)
> > > Male, Female, Undisclosed (gender)
> > >
> > > Once category combinations are generated, we can see few extra
> > > combinations coming up like
> > > just population1 or population2. Please find the screenshot attached.
> > >
> > > Is there something that we are missing or doing wrong. Please help us
> > > resolve this.
> > >
> > > Thanks and Regards,
> > > Sultan Ahamar,
> > > Thought Works
> > > Hyderabad
> > >
> > >
> > >
> > >
> > > ___
> > > 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
> > >
> > >
> >
> >
> > --
> > Lars Helge Øverland
> > Lead developer, DHIS 2
> > University of Oslo
> > Skype: larshelgeoverland
> > http://www.dhis2.org 
> > ___
> > Mailing list: https://launchpad.net/~dhis2-users
> > Post to : dhis2-us...@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~dhis2-users
> > More help   : https://help.launchpad.net/ListHelp
>



-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.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] GSoC '16 - Reimplementing android data capture applications to use shared data store

2016-03-02 Thread Sakchham Sharma
Hello,
I'm Sakchham Sharma. I intend to contribute to DHIS under GSoC '16 by
implementing a unified data store for all DHIS android data capture
applications. I read the summary for the above project idea and went
through the github repos of the data capture applications. I quote from the
summary, " “UI” or client apps which will be talking to shared database,
should use android’s IPC framework called AIDL in order to query and store
data."
In my opinion I feel it would be best implemented via means of a
ContentProvider. I would appreciate if any developer could give his opinion
on this matter.
Thank you !
___
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 22106: PT DV ou level field fix.

2016-03-02 Thread noreply

revno: 22106
committer: Jan Henrik Overland 
branch nick: dhis2
timestamp: Wed 2016-03-02 14:27:03 +0100
message:
  PT DV ou level field fix.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.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-pivot/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2016-02-19 14:07:16 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2016-03-02 13:27:03 +
@@ -8017,7 +8017,7 @@
 
 // organisation unit levels
 requests.push({
-url: contextPath + '/api/organisationUnitLevels.json?fields=id,' + namePropertyUrl + ',level&paging=false',
+url: contextPath + '/api/organisationUnitLevels.json?fields=id,name,level&paging=false',
 success: function(r) {
 init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || [];
 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js	2016-02-19 14:07:16 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js	2016-03-02 13:27:03 +
@@ -1223,7 +1223,7 @@
 
 delete favorite.id;
 delete favorite.parentGraphMap;
-
+
 delete favorite.program;
 			}
 
@@ -7961,7 +7961,7 @@
 
 // organisation unit levels
 requests.push({
-url: contextPath + '/api/organisationUnitLevels.json?fields=id,' + namePropertyUrl + ',level&paging=false',
+url: contextPath + '/api/organisationUnitLevels.json?fields=id,name,level&paging=false',
 success: function(r) {
 init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || [];
 

___
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 22107: tracker-capture: searching of events in data entry widget - complete

2016-03-02 Thread noreply

revno: 22107
committer: Abyot Asalefew Gizaw 
branch nick: dhis2
timestamp: Wed 2016-03-02 15:10:42 +0100
message:
  tracker-capture: searching of events in data entry widget - complete
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/filters.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/components/dataentry/dataentry.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2016-03-01 16:47:58 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2016-03-02 14:10:42 +
@@ -16,7 +16,7 @@
 
 {{'dataentry' | translate}}

-
+
 
 
 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html	2016-03-01 16:47:58 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html	2016-03-02 14:10:42 +
@@ -1,9 +1,9 @@
 
-
-
+
+
 
 
-
+
 
 {{'previous'| translate}}
 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/filters.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/filters.js	2014-12-08 15:56:07 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/filters.js	2016-03-02 14:10:42 +
@@ -2,4 +2,22 @@
 
 /* Filters */
 
-var trackerCaptureFilters = angular.module('trackerCaptureFilters', []);
\ No newline at end of file
+var trackerCaptureFilters = angular.module('trackerCaptureFilters', [])
+
+.filter('eventListFilter', function($filter){
+
+return function(pagedList, fullList, filterText){
+
+if(!pagedList ){
+return;
+}
+
+if(!filterText){
+return pagedList;
+}
+   
+var filteredData = fullList;
+filteredData = $filter('filter')(filteredData, filterText);
+return filteredData;
+}; 
+});
\ No newline at end of file

___
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 22108: minor

2016-03-02 Thread noreply

revno: 22108
committer: Abyot Asalefew Gizaw 
branch nick: dhis2
timestamp: Wed 2016-03-02 15:18:27 +0100
message:
  minor
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/filters.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/filters.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/filters.js	2016-03-02 14:10:42 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/filters.js	2016-03-02 14:18:27 +
@@ -16,7 +16,7 @@
 return pagedList;
 }

-var filteredData = fullList;
+var filteredData = fullList && fullList.length ? fullList : pagedList;
 filteredData = $filter('filter')(filteredData, filterText);
 return filteredData;
 }; 

___
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 22109: Fix null pointer exception in translated system settings

2016-03-02 Thread noreply

revno: 22109
committer: Nicolay Ramm 
branch nick: dhis2
timestamp: Wed 2016-03-02 16:38:08 +0100
message:
  Fix null pointer exception in translated system settings
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.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-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java	2016-01-04 02:27:49 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java	2016-03-02 15:38:08 +
@@ -59,10 +59,10 @@
 {
 Map translations = new Hashtable<>();
 
-translations.put( SettingKey.APPLICATION_TITLE.getDefaultValue().toString(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_TITLE.getDefaultValue().toString(), localeStr, SettingKey.APPLICATION_TITLE.getDefaultValue().toString() ) );
-translations.put( SettingKey.APPLICATION_INTRO.getDefaultValue().toString(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_INTRO.getDefaultValue().toString(), localeStr, "" ) );
-translations.put( SettingKey.APPLICATION_NOTIFICATION.getDefaultValue().toString(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_NOTIFICATION.getDefaultValue().toString(), localeStr, "" ) );
-translations.put( SettingKey.APPLICATION_FOOTER.getDefaultValue().toString(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_FOOTER.getDefaultValue().toString(), localeStr, "" ) );
+translations.put( SettingKey.APPLICATION_TITLE.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_TITLE.getName(), localeStr, SettingKey.APPLICATION_TITLE.getDefaultValue().toString() ) );
+translations.put( SettingKey.APPLICATION_INTRO.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_INTRO.getName(), localeStr, "" ) );
+translations.put( SettingKey.APPLICATION_NOTIFICATION.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_NOTIFICATION.getName(), localeStr, "" ) );
+translations.put( SettingKey.APPLICATION_FOOTER.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_FOOTER.getName(), localeStr, "" ) );
 
 return translations;
 }
@@ -72,14 +72,14 @@
 {
 Map translations = new Hashtable<>();
 
-translations.put( SettingKey.APPLICATION_TITLE.getDefaultValue().toString(), ObjectUtils.firstNonNull( 
-systemSettingManager.getSystemSetting( SettingKey.APPLICATION_TITLE.getDefaultValue().toString() + localeStr ), SettingKey.APPLICATION_TITLE.getDefaultValue().toString() ).toString() );
-translations.put( SettingKey.APPLICATION_INTRO.getDefaultValue().toString(), ObjectUtils.firstNonNull( 
-systemSettingManager.getSystemSetting( SettingKey.APPLICATION_INTRO.getDefaultValue().toString() + localeStr ), "" ).toString() );
-translations.put( SettingKey.APPLICATION_NOTIFICATION.getDefaultValue().toString(), ObjectUtils.firstNonNull( 
-systemSettingManager.getSystemSetting( SettingKey.APPLICATION_NOTIFICATION.getDefaultValue().toString() + localeStr ), "" ).toString() );
-translations.put( SettingKey.APPLICATION_FOOTER.getDefaultValue().toString(), ObjectUtils.firstNonNull( 
-systemSettingManager.getSystemSetting( SettingKey.APPLICATION_FOOTER.getDefaultValue().toString() + localeStr ), "" ).toString() );
+translations.put( SettingKey.APPLICATION_TITLE.getName(), ObjectUtils.firstNonNull(
+systemSettingManager.getSystemSetting(SettingKey.APPLICATION_TITLE.getName() + localeStr), SettingKey.APPLICATION_TITLE.getDefaultValue(), "" ).toString() );
+translations.put( SettingKey.APPLICATION_INTRO.getName(), ObjectUtils.firstNonNull(
+systemSettingManager.getSystemSetting( SettingKey.APPLICATION_INTRO.getName() + localeStr ), "" ).toString() );
+translations.put( SettingKey.APPLICATION_NOTIFICATION.getName(), ObjectUtils.firstNonNull(
+systemSettingManager.getSystemSetting( SettingKey.APPLICATION_NOTIFICATION.getName() + localeStr ), "" ).toString() );
+translations.put( SettingKey.APPLICATION_FOOTER.getName(), ObjectUtils.firstNonNull(
+systemSettingManager.getSystemSetting( SettingKey.APPLICATION_FOOTER.getName() + localeStr ), "" ).toString() );
 
 return translations;
 }

___
Mailing list: https://launchpad.net/~d

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22110: new property teiSearchOrganisationUnits is now added to user object. This new property defines th...

2016-03-02 Thread noreply

revno: 22110
committer: Abyot Asalefew Gizaw 
branch nick: dhis2
timestamp: Wed 2016-03-02 16:49:46 +0100
message:
  new property teiSearchOrganisationUnits is now added to user object. This new 
property defines the scope that a user can be allowed to search tracked entity 
instances.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java
  
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.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
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2016-02-11 09:27:02 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2016-03-02 15:49:46 +
@@ -111,6 +111,12 @@
  */
 @Scanned
 private Set dataViewOrganisationUnits = new HashSet<>();
+
+/**
+ * Organisation units for tracked entity instance search operations.
+ */
+@Scanned
+private Set teiSearchOrganisationUnits = new HashSet<>();
 
 /**
  * Ordered favorite apps.
@@ -202,6 +208,10 @@
 return !CollectionUtils.isEmpty( organisationUnits );
 }
 
+// -
+// Logic - data view organisation unit
+// -
+
 public boolean hasDataViewOrganisationUnit()
 {
 return !CollectionUtils.isEmpty( dataViewOrganisationUnits );
@@ -234,6 +244,44 @@
 {
 return hasDataViewOrganisationUnit() ? dataViewOrganisationUnits : organisationUnits;
 }
+
+// -
+// Logic - tei search organisation unit
+// -
+
+public boolean hasTeiSearchOrganisationUnit()
+{
+return !CollectionUtils.isEmpty( teiSearchOrganisationUnits );
+}
+
+public OrganisationUnit getTeiSearchOrganisationUnit()
+{
+return CollectionUtils.isEmpty( teiSearchOrganisationUnits ) ? null : teiSearchOrganisationUnits.iterator().next();
+}
+
+public boolean hasTeiSearchOrganisationUnitWithFallback()
+{
+return hasTeiSearchOrganisationUnit() || hasOrganisationUnit();
+}
+
+/**
+ * Returns the first of the tei search organisation units associated with the
+ * user. If none, returns the first of the data capture organisation units.
+ * If none, return nulls.
+ */
+public OrganisationUnit getTeiSearchOrganisationUnitWithFallback()
+{
+return hasTeiSearchOrganisationUnit() ? getTeiSearchOrganisationUnit() : getOrganisationUnit();
+}
+
+/**
+ * Returns the tei search organisation units or organisation units if not exist.
+ */
+public Set getTeiSearchOrganisationUnitsWithFallback()
+{
+return hasTeiSearchOrganisationUnit() ? teiSearchOrganisationUnits : organisationUnits;
+}
+
 
 public String getOrganisationUnitsName()
 {
@@ -609,6 +657,21 @@
 public void setDataViewOrganisationUnits( Set dataViewOrganisationUnits )
 {
 this.dataViewOrganisationUnits = dataViewOrganisationUnits;
+}   
+
+@JsonProperty
+@JsonSerialize( contentAs = BaseIdentifiableObject.class )
+@JsonView( { DetailedView.class, ExportView.class } )
+@JacksonXmlElementWrapper( localName = "teiSearchOrganisationUnits", namespace = DxfNamespaces.DXF_2_0 )
+@JacksonXmlProperty( localName = "teiSearchOrganisationUnit", namespace = DxfNamespaces.DXF_2_0 )
+public Set getTeiSearchOrganisationUnits()
+{
+return teiSearchOrganisationUnits;
+}
+
+public void setTeiSearchOrganisationUnits( Set teiSearchOrganisationUnits )
+{
+this.teiSearchOrganisationUnits = teiSearchOrganisationUnits;
 }
 
 public List getApps()
@@ -672,6 +735,9 @@
 
 dataViewOrganisationUnits.clear();
 dataViewOrganisationUnits.addAll( user.getDataViewOrganisationUnits() );
+
+teiSearchOrganisationUnits.clear();
+teiSearchOrganisationUnits.addAll( user.getTeiSearchOrganisationUnits() );
 }
 }
 
@@ -702,6 +768,7 @@
 "\"groups\":\"" + groups + "\", " +
 "\"organisationUnits\":\"" + organisationUnits + "\", " +
 "\"dataViewOrganisationUnits\":\"" + dataViewOrganisationUnits + "\" " +
+"\"teiSearchOrganisationUnits\":\"" + teiSearchOrganisationUnits + "\" " +
 "}";
 }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22111: Code style

2016-03-02 Thread noreply

revno: 22111
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2016-03-02 16:53:31 +0100
message:
  Code style
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.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-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java	2016-03-02 15:38:08 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultTranslateSystemSettingManager.java	2016-03-02 15:53:31 +
@@ -33,6 +33,8 @@
 
 import org.hisp.dhis.util.ObjectUtils;
 
+import static org.apache.commons.lang3.StringUtils.EMPTY;
+
 /**
  * @author James Chang
  */
@@ -60,9 +62,9 @@
 Map translations = new Hashtable<>();
 
 translations.put( SettingKey.APPLICATION_TITLE.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_TITLE.getName(), localeStr, SettingKey.APPLICATION_TITLE.getDefaultValue().toString() ) );
-translations.put( SettingKey.APPLICATION_INTRO.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_INTRO.getName(), localeStr, "" ) );
-translations.put( SettingKey.APPLICATION_NOTIFICATION.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_NOTIFICATION.getName(), localeStr, "" ) );
-translations.put( SettingKey.APPLICATION_FOOTER.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_FOOTER.getName(), localeStr, "" ) );
+translations.put( SettingKey.APPLICATION_INTRO.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_INTRO.getName(), localeStr, EMPTY ) );
+translations.put( SettingKey.APPLICATION_NOTIFICATION.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_NOTIFICATION.getName(), localeStr, EMPTY ) );
+translations.put( SettingKey.APPLICATION_FOOTER.getName(), getSystemSettingWithFallbacks( SettingKey.APPLICATION_FOOTER.getName(), localeStr, EMPTY ) );
 
 return translations;
 }
@@ -73,13 +75,13 @@
 Map translations = new Hashtable<>();
 
 translations.put( SettingKey.APPLICATION_TITLE.getName(), ObjectUtils.firstNonNull(
-systemSettingManager.getSystemSetting(SettingKey.APPLICATION_TITLE.getName() + localeStr), SettingKey.APPLICATION_TITLE.getDefaultValue(), "" ).toString() );
+systemSettingManager.getSystemSetting(SettingKey.APPLICATION_TITLE.getName() + localeStr), SettingKey.APPLICATION_TITLE.getDefaultValue(), EMPTY ).toString() );
 translations.put( SettingKey.APPLICATION_INTRO.getName(), ObjectUtils.firstNonNull(
-systemSettingManager.getSystemSetting( SettingKey.APPLICATION_INTRO.getName() + localeStr ), "" ).toString() );
+systemSettingManager.getSystemSetting( SettingKey.APPLICATION_INTRO.getName() + localeStr ), EMPTY ).toString() );
 translations.put( SettingKey.APPLICATION_NOTIFICATION.getName(), ObjectUtils.firstNonNull(
-systemSettingManager.getSystemSetting( SettingKey.APPLICATION_NOTIFICATION.getName() + localeStr ), "" ).toString() );
+systemSettingManager.getSystemSetting( SettingKey.APPLICATION_NOTIFICATION.getName() + localeStr ), EMPTY ).toString() );
 translations.put( SettingKey.APPLICATION_FOOTER.getName(), ObjectUtils.firstNonNull(
-systemSettingManager.getSystemSetting( SettingKey.APPLICATION_FOOTER.getName() + localeStr ), "" ).toString() );
+systemSettingManager.getSystemSetting( SettingKey.APPLICATION_FOOTER.getName() + localeStr ), EMPTY ).toString() );
 
 return translations;
 }
@@ -90,7 +92,7 @@
 
 private String getSystemSettingWithFallbacks( String keyName, String localeStr, String defaultValue )
 {
-String settingValue = "";
+String settingValue = EMPTY;
 
 String keyWithLocale = (String) ObjectUtils.firstNonNull( systemSettingManager.getSystemSetting( keyName + localeStr ), "" );
 

___
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 22112: Data integrity check. Fixed bug. Crashed with no session. Moved method for generating integrity r...

2016-03-02 Thread noreply

revno: 22112
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2016-03-02 17:55:48 +0100
message:
  Data integrity check. Fixed bug. Crashed with no session. Moved method for 
generating integrity report to a transactional method in DataIntegrityService.
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java
  
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java
  
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/tasks/DataIntegrityTask.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SystemController.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-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java	2016-01-04 02:27:49 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java	2016-03-02 16:55:48 +
@@ -205,4 +205,18 @@
  * Gets all ValidationRules with invalid right side expressions.
  */
 SortedMap getInvalidValidationRuleRightSideExpressions();
+
+// -
+// DataIntegrityReport
+// -
+
+/**
+ * Returns a DataIntegrityReport.
+ */
+DataIntegrityReport getDataIntegrityReport();
+
+/**
+ * Returns a FlattenedDataIntegrityReport.
+ */
+FlattenedDataIntegrityReport getFlattenedDataIntegrityReport();
 }

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java	2016-01-04 02:27:49 +
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java	2016-03-02 16:55:48 +
@@ -68,6 +68,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.List;
@@ -648,4 +649,69 @@
 
 return invalids;
 }
+
+@Override
+public DataIntegrityReport getDataIntegrityReport()
+{
+DataIntegrityReport report = new DataIntegrityReport();
+
+report.setDataElementsWithoutDataSet( new ArrayList<>( getDataElementsWithoutDataSet() ) );
+report.setDataElementsWithoutGroups( new ArrayList<>( getDataElementsWithoutGroups() ) );
+report.setDataElementsAssignedToDataSetsWithDifferentPeriodTypes( getDataElementsAssignedToDataSetsWithDifferentPeriodTypes() );
+report.setDataElementsViolatingExclusiveGroupSets( getDataElementsViolatingExclusiveGroupSets() );
+report.setDataElementsInDataSetNotInForm( getDataElementsInDataSetNotInForm() );
+
+log.info( "Checked data elements" );
+
+report.setCategoryOptionCombosNotInDataElementCategoryCombo( getCategoryOptionCombosNotInDataElementCategoryCombo() );
+report.setDataSetsNotAssignedToOrganisationUnits( new ArrayList<>( getDataSetsNotAssignedToOrganisationUnits() ) );
+report.setSectionsWithInvalidCategoryCombinations( new ArrayList<>( getSectionsWithInvalidCategoryCombinations() ) );
+
+log.info( "Checked data sets" );
+
+report.setIndicatorsWithIdenticalFormulas( getIndicatorsWithIdenticalFormulas() );
+report.setIndicatorsWithoutGroups( new ArrayList<>( getIndicatorsWithoutGroups() ) );
+report.setInvalidIndicatorNumerators( getInvalidIndicatorNumerators() );
+report.setInvalidIndicatorDenominators( getInvalidIndicatorDenominators() );
+report.setIndicatorsViolatingExclusiveGroupSets( getIndicatorsViolatingExclusiveGroupSets() );
+
+log.info( "Checked indicators" );
+
+report.setDuplicatePeriods( getDuplicatePeriods() );
+
+log.info( "Checked periods" );
+
+report.setOrganisationUnitsWithCyclicReferences( new ArrayList<>( getOrganisationUnitsWithCyclicReferences() ) );
+report.setOrphanedOrganisationUnits( new ArrayList<>( getOrphanedOrganisationUnits() ) );
+report.setOrganisationUnitsWithoutGroups( new ArrayList<>( getOrganisationUnitsWithoutGroups() ) );
+report.setOrganisationUnitsViolatingExclusiveGroupSets( getOrganisationUnitsViolatingExclusiveGroupSets() );
+report.setOrganisationUnitGroupsWithoutGroupSets( new ArrayList<>( getOrganisationUnitGroupsWitho

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22113: Integrity checks, added check for invalid category combos

2016-03-02 Thread noreply

revno: 22113
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2016-03-02 18:06:15 +0100
message:
  Integrity checks, added check for invalid category combos
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityReport.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/FlattenedDataIntegrityReport.java
  
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.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/dataIntegrity.vm
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataIntegrity.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-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityReport.java	2016-01-04 02:27:49 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityReport.java	2016-03-02 17:06:15 +
@@ -29,6 +29,7 @@
  */
 
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementOperand;
 import org.hisp.dhis.dataset.DataSet;
@@ -60,6 +61,8 @@
 private SortedMap> dataElementsViolatingExclusiveGroupSets;
 
 private SortedMap> dataElementsInDataSetNotInForm;
+
+private List invalidCategoryCombos;
 
 private Map> categoryOptionCombosNotInDataElementCategoryCombo;
 
@@ -158,6 +161,16 @@
 this.dataElementsInDataSetNotInForm = dataElementsInDataSetNotInForm;
 }
 
+public List getInvalidCategoryCombos()
+{
+return invalidCategoryCombos;
+}
+
+public void setInvalidCategoryCombos( List invalidCategoryCombos )
+{
+this.invalidCategoryCombos = invalidCategoryCombos;
+}
+
 public Map> getCategoryOptionCombosNotInDataElementCategoryCombo()
 {
 return categoryOptionCombosNotInDataElementCategoryCombo;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java	2016-03-02 16:55:48 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java	2016-03-02 17:06:15 +
@@ -34,6 +34,7 @@
 
 import org.hisp.dhis.common.SetMap;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementOperand;
 import org.hisp.dhis.dataset.DataSet;
@@ -88,6 +89,11 @@
  */
 SortedMap> getDataElementsInDataSetNotInForm();
 
+/**
+ * Returns all invalid category combinations.
+ */
+List getInvalidCategoryCombos();
+
 // -
 // Section
 // -

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/FlattenedDataIntegrityReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/FlattenedDataIntegrityReport.java	2016-01-04 02:27:49 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/FlattenedDataIntegrityReport.java	2016-03-02 17:06:15 +
@@ -63,6 +63,9 @@
 
 @JsonProperty
 private SortedMap> dataElementsInDataSetNotInForm;
+
+@JsonProperty
+private List invalidCategoryCombos;
 
 @JsonProperty
 private Map> categoryOptionCombosNotInDataElementCategoryCombo;
@@ -126,6 +129,8 @@
 dataElementsViolatingExclusiveGroupSets = transformSortedMap( report.getDataElementsViolatingExclusiveGroupSets() );
 
 dataElementsInDataSetNotInForm = transformSortedMap( report.getDataElementsInDataSetNotInForm() );
+
+invalidCategoryCombos = transformCollection( report.getInvalidCategoryCombos() );
 
 categoryOptionCombosNotInDataElementCategoryCombo = transformMapOfSets( report.getCategoryOptionCombosNotInDataElementCategoryCombo() );
 

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java'
--- dhis-2/dhis-services/dhis-service-

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22114: Fixed issue with upgrade of option combo names

2016-03-02 Thread noreply

revno: 22114
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2016-03-02 18:21:16 +0100
message:
  Fixed issue with upgrade of option combo names
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.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-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java	2016-03-01 22:30:53 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java	2016-03-02 17:21:16 +
@@ -534,6 +534,8 @@
 
 List getDataElementCategoryCombosBetweenByName( String name, int first, int max );
 
+void updateCategoryOptionComboNames();
+
 // -
 // DataElementOperand
 // -

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java	2016-03-01 22:30:53 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java	2016-03-02 17:21:16 +
@@ -758,6 +758,12 @@
 return options.size() == categoryOptionCombo.getCategoryOptions().size();
 }
 
+@Override
+public void updateCategoryOptionComboNames()
+{
+categoryOptionComboStore.updateNames();
+}
+
 // -
 // DataElementOperand
 // -

=== modified file '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/java/org/hisp/dhis/startup/TableAlteror.java	2016-03-02 04:34:21 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2016-03-02 17:21:16 +
@@ -33,7 +33,7 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.dataelement.CategoryOptionComboStore;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.jdbc.StatementBuilder;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.system.startup.AbstractStartupRoutine;
@@ -69,7 +69,7 @@
 private OrganisationUnitService organisationUnitService;
 
 @Autowired
-private CategoryOptionComboStore categoryOptionComboStore;
+private DataElementCategoryService categoryService;
 
 // -
 // Execute
@@ -905,7 +905,7 @@
 
 organisationUnitService.updatePaths();
 
-categoryOptionComboStore.updateNames();
+categoryService.updateCategoryOptionComboNames();
 
 executeSql( "alter table trackedentitydatavalue alter column storedby TYPE character varying(255)" );
 executeSql( "alter table datavalue alter column storedby TYPE character varying(255)" );

___
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] [Bug 1552367] [NEW] GIS facility layer maps not working on dashboard

2016-03-02 Thread Lars Helge Øverland
Public bug reported:

GIS favorites only containing a facility layer (no thematic layers) do
not work on the dashboard, where a message "no valid coordinates found"
is displayed.

Steps to reproduce.

- Create a GIS favorite which only containing a facility layer.
- Add this favorite to dashboard.
- Load the dashboard.
> A message "no valid coordinates found" is displayed instead of the dashboard.

Affects version 2.22.

** Affects: dhis2
 Importance: High
 Assignee: Jan Henrik Øverland (janhenrik-overland)
 Status: Confirmed

** Changed in: dhis2
 Assignee: (unassigned) => Jan Henrik Øverland (janhenrik-overland)

** Changed in: dhis2
   Importance: Undecided => High

** Changed in: dhis2
   Status: New => Confirmed

** Changed in: dhis2
Milestone: None => 2.23

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

Title:
  GIS facility layer maps not working on dashboard

Status in DHIS:
  Confirmed

Bug description:
  GIS favorites only containing a facility layer (no thematic layers) do
  not work on the dashboard, where a message "no valid coordinates
  found" is displayed.

  Steps to reproduce.

  - Create a GIS favorite which only containing a facility layer.
  - Add this favorite to dashboard.
  - Load the dashboard.
  > A message "no valid coordinates found" is displayed instead of the 
dashboard.

  Affects version 2.22.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1552367/+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] [Bug 1552367] Re: GIS facility layer maps not working on dashboard

2016-03-02 Thread Jan Henrik Øverland
** Changed in: dhis2
   Status: Confirmed => Fix Committed

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

Title:
  GIS facility layer maps not working on dashboard

Status in DHIS:
  Fix Released

Bug description:
  GIS favorites only containing a facility layer (no thematic layers) do
  not work on the dashboard, where a message "no valid coordinates
  found" is displayed.

  Steps to reproduce.

  - Create a GIS favorite which only containing a facility layer.
  - Add this favorite to dashboard.
  - Load the dashboard.
  > A message "no valid coordinates found" is displayed instead of the 
dashboard.

  Affects version 2.22.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1552367/+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] [Bug 1552367] Re: GIS facility layer maps not working on dashboard

2016-03-02 Thread Lars Helge Øverland
** Changed in: dhis2
   Status: Fix Committed => Fix Released

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

Title:
  GIS facility layer maps not working on dashboard

Status in DHIS:
  Fix Released

Bug description:
  GIS favorites only containing a facility layer (no thematic layers) do
  not work on the dashboard, where a message "no valid coordinates
  found" is displayed.

  Steps to reproduce.

  - Create a GIS favorite which only containing a facility layer.
  - Add this favorite to dashboard.
  - Load the dashboard.
  > A message "no valid coordinates found" is displayed instead of the 
dashboard.

  Affects version 2.22.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1552367/+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 22115: DatIntegrityService, using java8 streams.

2016-03-02 Thread noreply

revno: 22115
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2016-03-02 22:44:53 +0100
message:
  DatIntegrityService, using java8 streams.
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java
  
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/OrganisationUnitGroupWithoutGroupSetFilter.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-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2016-03-02 07:56:41 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2016-03-02 21:44:53 +
@@ -231,14 +231,13 @@
 return uid;
 }
 
-List categories = this.categoryCombo.getCategories();
+List categories = categoryCombo.getCategories();
 
 for ( DataElementCategory category : categories )
 {
 List options = category.getCategoryOptions();
 
-optionLoop:
-for ( DataElementCategoryOption option : this.categoryOptions )
+optionLoop: for ( DataElementCategoryOption option : categoryOptions )
 {
 if ( options.contains( option ) )
 {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java	2016-03-02 17:06:15 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java	2016-03-02 21:44:53 +
@@ -30,6 +30,7 @@
 
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
 import java.util.SortedMap;
 
 import org.hisp.dhis.common.SetMap;
@@ -64,12 +65,12 @@
 /**
  * Gets all data elements which are not assigned to any data set.
  */
-Collection getDataElementsWithoutDataSet();
+List getDataElementsWithoutDataSet();
 
 /**
  * Gets all data elements which are not members of any groups.
  */
-Collection getDataElementsWithoutGroups();
+List getDataElementsWithoutGroups();
 
 /**
  * Gets all data elements units which are members of more than one group
@@ -108,7 +109,7 @@
  * Gets all section with invalid category combinations. Invalid means that
  * the data elements in the sections don't have the same category combination.
  */
-Collection getSectionsWithInvalidCategoryCombinations();
+List getSectionsWithInvalidCategoryCombinations();
 
 // -
 // DataSet
@@ -117,7 +118,7 @@
 /**
  * Gets all data sets which are not assigned to any organisation units.
  */
-Collection getDataSetsNotAssignedToOrganisationUnits();
+List getDataSetsNotAssignedToOrganisationUnits();
 
 // -
 // Indicator
@@ -126,12 +127,12 @@
 /**
  * Gets all indicators with identical numerator and denominator.
  */
-Collection> getIndicatorsWithIdenticalFormulas();
+Set> getIndicatorsWithIdenticalFormulas();
 
 /**
  * Gets all indicators which are not assigned to any groups.
  */
-Collection getIndicatorsWithoutGroups();
+List getIndicatorsWithoutGroups();
 
 /**
  * Gets all indicators with invalid indicator numerators.
@@ -156,17 +157,17 @@
 /**
  * Gets all organisation units which are related to each other in a cyclic reference.
  */
-Collection getOrganisationUnitsWithCyclicReferences();
+Set getOrganisationUnitsWithCyclicReferences();
 
 /**
  * Gets all organisation units with no parents or children.
  */
-Collection getOrphanedOrganisationUnits();
+List getOrphanedOrganisationUnits();
 
 /**
  * Gets all organisation units which are not assigned to any groups.
  */
-Collection getOrganisationUnitsWithoutGroups();
+List getOrganisationUnitsWithoutGroups();
 
 /**
  * Gets all organisation units which are members of more than one group
@@ -191,7 +192,7 @@
 /**
  * Gets all organisation unit groups which are not assigned to any group set.
  */
-Collection getOrganisationUnitGroupsWithoutGroupSets();
+List getOrganisationUnitGroupsWithoutGroupSets();
 
 // ---

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22116: JEP functions, code style

2016-03-02 Thread noreply

revno: 22116
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2016-03-02 22:51:09 +0100
message:
  JEP functions, code style
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/jep/ArithmeticMean.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/jep/Count.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/jep/CustomFunctions.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/jep/MaxValue.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/jep/MedianValue.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/jep/MinValue.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/jep/StandardDeviation.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/jep/VectorSum.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-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java	2016-01-13 12:54:38 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java	2016-03-02 21:51:09 +
@@ -391,5 +391,4 @@
  * @param indicators the collection of Indicators.
  */
 List getOperandsInIndicators( List indicators );
-
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2016-01-08 19:07:20 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2016-03-02 21:51:09 +
@@ -89,991 +89,1031 @@
  * @author Lars Helge Overland
  */
 public class DefaultExpressionService
-implements ExpressionService
+implements ExpressionService
 {
-	private static final Log log = LogFactory.getLog( DefaultExpressionService.class );
-
-	// -
-	// Dependencies
-	// -
-
-	private GenericStore expressionStore;
-
-	public void setExpressionStore( GenericStore expressionStore )
-	{
-		this.expressionStore = expressionStore;
-	}
-
-	private DataElementService dataElementService;
-
-	public void setDataElementService( DataElementService dataElementService )
-	{
-		this.dataElementService = dataElementService;
-	}
-
-	private ConstantService constantService;
-
-	public void setConstantService( ConstantService constantService )
-	{
-		this.constantService = constantService;
-	}
-
-	private DataElementCategoryService categoryService;
-
-	public void setCategoryService( DataElementCategoryService categoryService )
-	{
-		this.categoryService = categoryService;
-	}
-
-	private OrganisationUnitGroupService organisationUnitGroupService;
-
-	public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
-	{
-		this.organisationUnitGroupService = organisationUnitGroupService;
-	}
-
-	private DimensionService dimensionService;
-
-	public void setDimensionService( DimensionService dimensionService )
-	{
-		this.dimensionService = dimensionService;
-	}
-
-	private IdentifiableObjectManager idObjectManager;
-
-	public void setIdObjectManager( IdentifiableObjectManager idObjectManager )
-	{
-		this.idObjectManager = idObjectManager;
-	}
-
-	// -
-	// Expression CRUD operations
-	// -
-
-	@Override
-	@Transactional
-	public int addExpression( Expression expression )
-	{
-		return expressionStore.save( expression );
-	}
-
-	@Override
-	@Transactional
-	public void deleteExpression( Expression expression )
-	{
-		expressionStore.delete( expression );
-	}
-
-	@Override
-	@Transactional
-	public Expression getExpression( int id )
-	{
-		return expressionStore.get( id );
-	}
-
-	@Override
-	@Transactional
-	public void updateExpression( Expression expression )
-	{
-		expressionStore.update( expression );
-	}
-
-	@Override
-	@Transactional
-	public List getAllExpressions()
-	{
-		return expressionStore.getAll();
-	}
-
-	// -
-	// Business logic
-	// ---

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22117: Integrity, instantiating collections

2016-03-02 Thread noreply

revno: 22117
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2016-03-02 23:21:49 +0100
message:
  Integrity, instantiating collections
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityReport.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java
  
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java
  
dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/dataintegrity/DataIntegrityServiceTest.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-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityReport.java	2016-03-02 17:06:15 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityReport.java	2016-03-02 22:21:49 +
@@ -41,62 +41,66 @@
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.validation.ValidationRule;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.SortedMap;
+import java.util.TreeMap;
 
 /**
  * @author Halvdan Hoem Grelland 
  */
 public class DataIntegrityReport
 {
-private List dataElementsWithoutDataSet;
-
-private List dataElementsWithoutGroups;
-
-private Map> dataElementsAssignedToDataSetsWithDifferentPeriodTypes;
-
-private SortedMap> dataElementsViolatingExclusiveGroupSets;
-
-private SortedMap> dataElementsInDataSetNotInForm;
-
-private List invalidCategoryCombos;
-
-private Map> categoryOptionCombosNotInDataElementCategoryCombo;
-
-private List dataSetsNotAssignedToOrganisationUnits;
-
-private List sectionsWithInvalidCategoryCombinations;
-
-private Collection> indicatorsWithIdenticalFormulas;
-
-private List indicatorsWithoutGroups;
-
-private Map invalidIndicatorNumerators;
-
-private Map invalidIndicatorDenominators;
-
-private SortedMap> indicatorsViolatingExclusiveGroupSets;
-
-private List duplicatePeriods;
-
-private List organisationUnitsWithCyclicReferences;
-
-private List orphanedOrganisationUnits;
-
-private List organisationUnitsWithoutGroups;
-
-private SortedMap> organisationUnitsViolatingExclusiveGroupSets;
-
-private List organisationUnitGroupsWithoutGroupSets;
-
-private List validationRulesWithoutGroups;
-
-private Map invalidValidationRuleLeftSideExpressions;
-
-private Map invalidValidationRuleRightSideExpressions;
+private List dataElementsWithoutDataSet = new ArrayList<>();
+
+private List dataElementsWithoutGroups = new ArrayList<>();
+
+private Map> dataElementsAssignedToDataSetsWithDifferentPeriodTypes = new HashMap<>();
+
+private SortedMap> dataElementsViolatingExclusiveGroupSets = new TreeMap<>();
+
+private SortedMap> dataElementsInDataSetNotInForm = new TreeMap<>();
+
+private List invalidCategoryCombos = new ArrayList<>();
+
+private Map> categoryOptionCombosNotInDataElementCategoryCombo = new HashMap<>();
+
+private List dataSetsNotAssignedToOrganisationUnits = new ArrayList<>();
+
+private List sectionsWithInvalidCategoryCombinations = new ArrayList<>();
+
+private Set> indicatorsWithIdenticalFormulas = new HashSet<>();
+
+private List indicatorsWithoutGroups = new ArrayList<>();
+
+private Map invalidIndicatorNumerators = new HashMap<>();
+
+private Map invalidIndicatorDenominators = new HashMap<>();
+
+private SortedMap> indicatorsViolatingExclusiveGroupSets = new TreeMap<>();
+
+private List duplicatePeriods = new ArrayList<>();
+
+private List organisationUnitsWithCyclicReferences = new ArrayList<>();
+
+private List orphanedOrganisationUnits = new ArrayList<>();
+
+private List organisationUnitsWithoutGroups = new ArrayList<>();
+
+private SortedMap> organisationUnitsViolatingExclusiveGroupSets = new TreeMap<>();
+
+private List organisationUnitGroupsWithoutGroupSets = new ArrayList<>();
+
+private List validationRulesWithoutGroups = new ArrayList<>();
+
+private Map invalidValidationRuleLeftSideExpressions = new HashMap<>();
+
+private Map invalidValidationRuleRightSideExpressions = new HashMap<>();
 
 //-
 // Constructors
@@ -201,12 +205,12 @@
 this.sectionsWithInvalidCategoryCo

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22118: change schema validator/attribute service to use new ErrorReport classes

2016-03-02 Thread noreply

revno: 22118
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2016-03-03 08:20:51 +0700
message:
  change schema validator/attribute service to use new ErrorReport classes
removed:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/validation/ValidationViolation.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/webmessage/responses/ValidationViolationsWebMessageResponse.java
added:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/webmessage/responses/ErrorReportsWebMessageResponse.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ErrorCode.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ErrorReport.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/validation/SchemaValidator.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/validation/DefaultSchemaValidator.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleValidation.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/MaintenanceController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SchemaController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/WebMessageUtils.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-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java	2016-02-15 04:57:22 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java	2016-03-03 01:20:51 +
@@ -30,7 +30,7 @@
 
 import org.hisp.dhis.attribute.exception.NonUniqueAttributeValueException;
 import org.hisp.dhis.common.IdentifiableObject;
-import org.hisp.dhis.schema.validation.ValidationViolation;
+import org.hisp.dhis.feedback.ErrorReport;
 
 import java.util.List;
 import java.util.Set;
@@ -183,7 +183,7 @@
  */
 int getAttributeValueCount();
 
- List validateAttributeValues( T object, Set attributeValues );
+ List validateAttributeValues( T object, Set attributeValues );
 
  void updateAttributeValues( T object, List jsonAttributeValues ) throws Exception;
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ErrorCode.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ErrorCode.java	2016-03-01 07:51:42 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ErrorCode.java	2016-03-03 01:20:51 +
@@ -29,13 +29,29 @@
  */
 
 /**
+ * E4000 - E4999: Metadata Validation Errors
  * E5000 - E5999: Preheat Errors
- * E6000 - E6999: DXF2 Import Errors
+ * E6000 - E6999: Metadata Import Errors
  *
  * @author Morten Olav Hansen 
  */
 public enum ErrorCode
 {
+/* Metadata Validation Errors */
+E4000( "Missing required property \"{0}\"." ),
+E4001( "Maximum length of property \"{0}\"is {1}, but given length was {2}." ),
+E4002( "Allowed length range for property \"{0}\" is [{1},{2}], but given length was {3}." ),
+E4003( "Property \"{0}\" requires a valid email address, was given \"{1}\"." ),
+E4004( "Property \"{0}\" requires a valid URL, was given \"{1}\"." ),
+E4005( "Property \"{0}\" requires a valid password, was given \"{1}\"." ),
+E4006( "Property \"{0}\" requires a valid HEX color, was given \"{1}\"." ),
+E4007( "Allowed size range for collection property \"{0}\" is [{1},{2}], but size given was {3}." ),
+E4008( "Allowed range for numeric property \"{0}\" is [{1},{2}], but number given was {3}." ),
+E4009( "Attribute \"{0}\" is unique, and value \"{1}\" already exist." ),
+E4010( "Attribute \"{0}\" is not supported for type \"{1}\"." ),
+E4011( "Attribute \"{0}\" is required, but not value was found." ),
+
+/* Preheat Errors */
 E5000( "No matching object for given reference. Identifier was {0}, and object was {1}." ),
 E5001( "Invalid reference {0} on object {1} for association \"{2}\"." );
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ErrorReport.java'
--

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22119: minor test fixes

2016-03-02 Thread noreply

revno: 22119
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2016-03-03 09:03:29 +0700
message:
  minor test fixes
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-03 01:20:51 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-03 02:03:29 +
@@ -192,20 +192,19 @@
 
 List> referenceErrors = preheatService.checkReferences( bundle.getObjects().get( klass ), bundle.getPreheat(), bundle.getPreheatIdentifier() );
 referenceErrors.forEach( objectBundleValidation::addErrorReports ); // collapsing for now, we might want to give pr object ref list
-
-List> validationErrorReports = new ArrayList<>();
-
-for ( IdentifiableObject object : bundle.getObjects().get( klass ) )
+Iterator iterator = bundle.getObjects().get( klass ).iterator();
+
+while ( iterator.hasNext() )
 {
-List validate = schemaValidator.validate( object );
+IdentifiableObject object = iterator.next();
+List objectValidation = schemaValidator.validate( object );
 
-if ( !validate.isEmpty() )
+if ( !objectValidation.isEmpty() )
 {
-validationErrorReports.add( validate );
+objectBundleValidation.addErrorReports( objectValidation );
+iterator.remove();
 }
 }
-
-validationErrorReports.forEach( objectBundleValidation::addErrorReports );
 }
 
 bundle.setObjectBundleStatus( ObjectBundleStatus.VALIDATED );

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java	2016-03-03 01:20:51 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java	2016-03-03 02:03:29 +
@@ -276,8 +276,9 @@
 ObjectBundle bundle = objectBundleService.create( params );
 ObjectBundleValidation validate = objectBundleService.validate( bundle );
 
-assertEquals( 1, validate.getErrorReports( DataElement.class ).size() );
-assertEquals( 2, bundle.getObjects().get( DataElement.class ).size() );
+assertEquals( 1, validate.getErrorReports( DataElement.class ).get( ErrorCode.E5000 ).size() );
+assertFalse( validate.getErrorReports( DataElement.class ).get( ErrorCode.E4000 ).isEmpty() );
+assertEquals( 0, bundle.getObjects().get( DataElement.class ).size() );
 }
 
 @Test

___
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 22120: minor validation fixes

2016-03-02 Thread noreply

revno: 22120
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2016-03-03 09:20:41 +0700
message:
  minor validation fixes
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/validation/DefaultSchemaValidator.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-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/validation/DefaultSchemaValidator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/validation/DefaultSchemaValidator.java	2016-03-03 01:20:51 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/validation/DefaultSchemaValidator.java	2016-03-03 02:20:41 +
@@ -66,7 +66,9 @@
 return new ArrayList<>();
 }
 
-Schema schema = schemaService.getSchema( object.getClass() );
+Class klass = object.getClass();
+
+Schema schema = schemaService.getSchema( klass );
 
 List errorReports = new ArrayList<>();
 
@@ -83,66 +85,66 @@
 {
 if ( property.isRequired() )
 {
-errorReports.add( new ErrorReport( object.getClass(), ErrorCode.E4000, property.getName() ).setErrorKlass( property.getKlass() ) );
+errorReports.add( new ErrorReport( klass, ErrorCode.E4000, property.getName() ).setErrorKlass( property.getKlass() ) );
 }
 
 continue;
 }
 
-errorReports.addAll( validateString( value, property ) );
-errorReports.addAll( validateCollection( value, property ) );
-errorReports.addAll( validateInteger( value, property ) );
-errorReports.addAll( validateFloat( value, property ) );
-errorReports.addAll( validateDouble( value, property ) );
+errorReports.addAll( validateString( klass, value, property ) );
+errorReports.addAll( validateCollection( klass, value, property ) );
+errorReports.addAll( validateInteger( klass, value, property ) );
+errorReports.addAll( validateFloat( klass, value, property ) );
+errorReports.addAll( validateDouble( klass, value, property ) );
 }
 
 return errorReports;
 }
 
-private List validateString( Object object, Property property )
+private List validateString( Class klass, Object propertyObject, Property property )
 {
 List errorReports = new ArrayList<>();
 
 // TODO How should empty strings be handled? they are not valid color, password, url, etc of course.
-if ( !String.class.isInstance( object ) || StringUtils.isEmpty( object ) )
+if ( !String.class.isInstance( propertyObject ) || StringUtils.isEmpty( propertyObject ) )
 {
 return errorReports;
 }
 
-String value = (String) object;
+String value = (String) propertyObject;
 
 // check column max length
 if ( value.length() > property.getLength() )
 {
-errorReports.add( new ErrorReport( object.getClass(), ErrorCode.E4001, property.getName(), property.getLength(), value.length() )
+errorReports.add( new ErrorReport( klass, ErrorCode.E4001, property.getName(), property.getLength(), value.length() )
 .setErrorKlass( property.getKlass() ) );
 return errorReports;
 }
 
 if ( value.length() < property.getMin() || value.length() > property.getMax() )
 {
-errorReports.add( new ErrorReport( object.getClass(), ErrorCode.E4002, property.getName(), property.getMin(), property.getMax(), value.length() )
+errorReports.add( new ErrorReport( klass, ErrorCode.E4002, property.getName(), property.getMin(), property.getMax(), value.length() )
 .setErrorKlass( property.getKlass() ) );
 }
 
 if ( PropertyType.EMAIL == property.getPropertyType() && !GenericValidator.isEmail( value ) )
 {
-errorReports.add( new ErrorReport( object.getClass(), ErrorCode.E4003, property.getName(), value )
+errorReports.add( new ErrorReport( klass, ErrorCode.E4003, property.getName(), value )
 .setErrorKlass( property.getKlass() ) );
 }
 else if ( PropertyType.URL == property.getPropertyType() && !isUrl( value ) )
 {
-errorReports.add( new ErrorReport( object.getClass(), ErrorCode.E4004, property.getName(), value )
+errorReports.add( new ErrorReport( klass, ErrorCode.E4004, property.getName(), value )
 .setErrorKlass( property.getKlass() ) );
 }
 else if ( PropertyType.PASSWORD == property.getP

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22121: minor, don't validate object is mode is delete

2016-03-02 Thread noreply

revno: 22121
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2016-03-03 09:23:39 +0700
message:
  minor, don't validate object is mode is delete
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-03 02:03:29 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-03 02:23:39 +
@@ -192,17 +192,21 @@
 
 List> referenceErrors = preheatService.checkReferences( bundle.getObjects().get( klass ), bundle.getPreheat(), bundle.getPreheatIdentifier() );
 referenceErrors.forEach( objectBundleValidation::addErrorReports ); // collapsing for now, we might want to give pr object ref list
-Iterator iterator = bundle.getObjects().get( klass ).iterator();
 
-while ( iterator.hasNext() )
+if ( !bundle.getImportMode().isDelete() )
 {
-IdentifiableObject object = iterator.next();
-List objectValidation = schemaValidator.validate( object );
+Iterator iterator = bundle.getObjects().get( klass ).iterator();
 
-if ( !objectValidation.isEmpty() )
+while ( iterator.hasNext() )
 {
-objectBundleValidation.addErrorReports( objectValidation );
-iterator.remove();
+IdentifiableObject object = iterator.next();
+List objectValidation = schemaValidator.validate( object );
+
+if ( !objectValidation.isEmpty() )
+{
+objectBundleValidation.addErrorReports( objectValidation );
+iterator.remove();
+}
 }
 }
 }

___
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 22122: minor optimization, pass user object along with query in preheater

2016-03-02 Thread noreply

revno: 22122
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2016-03-03 10:10:04 +0700
message:
  minor optimization, pass user object along with query in preheater
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/Preheat.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatParams.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.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-api/src/main/java/org/hisp/dhis/preheat/Preheat.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/Preheat.java	2016-02-24 06:10:49 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/Preheat.java	2016-03-03 03:10:04 +
@@ -32,6 +32,7 @@
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryOption;
+import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserCredentials;
 
 import java.util.ArrayList;
@@ -45,6 +46,8 @@
  */
 public class Preheat
 {
+private User user;
+
 private Map, Map>> map = new HashMap<>();
 
 private Map, IdentifiableObject> defaults = new HashMap<>();
@@ -55,6 +58,16 @@
 {
 }
 
+public User getUser()
+{
+return user;
+}
+
+public void setUser( User user )
+{
+this.user = user;
+}
+
 @SuppressWarnings( "unchecked" )
 public  T get( PreheatIdentifier identifier, Class klass, String key )
 {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatParams.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatParams.java	2016-02-01 10:27:53 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatParams.java	2016-03-03 03:10:04 +
@@ -29,6 +29,7 @@
  */
 
 import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.user.User;
 
 import java.util.HashMap;
 import java.util.HashSet;
@@ -40,6 +41,8 @@
  */
 public class PreheatParams
 {
+private User user;
+
 private PreheatMode preheatMode = PreheatMode.ALL;
 
 private PreheatIdentifier preheatIdentifier = PreheatIdentifier.UID;
@@ -52,6 +55,16 @@
 {
 }
 
+public User getUser()
+{
+return user;
+}
+
+public void setUser( User user )
+{
+this.user = user;
+}
+
 public PreheatMode getPreheatMode()
 {
 return preheatMode;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-03-02 07:56:41 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-03-03 03:10:04 +
@@ -43,6 +43,7 @@
 import org.hisp.dhis.schema.Schema;
 import org.hisp.dhis.schema.SchemaService;
 import org.hisp.dhis.system.util.ReflectionUtils;
+import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserCredentials;
 import org.hisp.dhis.user.UserGroup;
@@ -74,14 +75,23 @@
 @Autowired
 private IdentifiableObjectManager manager;
 
+@Autowired
+private CurrentUserService currentUserService;
+
 @Override
 @SuppressWarnings( "unchecked" )
 public Preheat preheat( PreheatParams params )
 {
 Preheat preheat = new Preheat();
+preheat.setUser( params.getUser() );
 preheat.setDefaults( manager.getDefaults() );
 preheat.setUsernames( getUsernames() );
 
+if ( preheat.getUser() == null )
+{
+preheat.setUser( currentUserService.getCurrentUser() );
+}
+
 if ( PreheatMode.ALL == params.getPreheatMode() )
 {
 if ( params.getClasses().isEmpty() )
@@ -93,6 +103,7 @@
 for ( Class klass : params.getClasses() )
 {
 Query query = Query.from( schemaService.getDynamicSchema( klass ) );
+query.setUser( preheat.getUser() );
 List objects = queryService.query( query );
 
 if ( PreheatIdentifier.UID == params.getPreheatIdentifier() || PreheatIdentifier.AUTO == params.getPreheatIdentifier() )
@@ -120,6 +131,7 @@
 if ( !identifiers.isEmpty() )
 {
 Query query = Query.from( schemaService.getDynamicSchema( klass ) );
+query.setUser( preheat.getUser() );
 query.add(

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22123: parse import params for dxf2 importer

2016-03-02 Thread noreply

revno: 22123
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2016-03-03 10:59:34 +0700
message:
  parse import params for dxf2 importer
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatParams.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/DefaultMetadataImportService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/MetadataImportParams.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleParams.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-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java	2016-02-12 05:38:40 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java	2016-03-03 03:59:34 +
@@ -75,7 +75,7 @@
 
 public DataEntryForm()
 {
-this.setAutoFields();
+
 }
 
 public DataEntryForm( String name )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatParams.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatParams.java	2016-03-03 03:10:04 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatParams.java	2016-03-03 03:59:34 +
@@ -28,6 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.google.common.base.Objects;
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.user.User;
 
@@ -108,4 +109,17 @@
 this.references = references;
 return this;
 }
+
+
+@Override
+public String toString()
+{
+return Objects.toStringHelper( this )
+.add( "user", user )
+.add( "preheatMode", preheatMode )
+.add( "preheatIdentifier", preheatIdentifier )
+.add( "classes", classes )
+.add( "references", references )
+.toString();
+}
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java	2016-02-11 09:27:02 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java	2016-03-03 03:59:34 +
@@ -70,7 +70,7 @@
 
 public ProgramTrackedEntityAttribute()
 {
-setAutoFields();
+
 }
 
 public ProgramTrackedEntityAttribute( Program program, TrackedEntityAttribute attribute )

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/DefaultMetadataImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/DefaultMetadataImportService.java	2016-03-02 07:56:41 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/DefaultMetadataImportService.java	2016-03-03 03:59:34 +
@@ -28,11 +28,17 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.google.common.base.Enums;
+import org.hisp.dhis.common.MergeMode;
 import org.hisp.dhis.dxf2.metadata2.feedback.ImportReport;
 import org.hisp.dhis.dxf2.metadata2.objectbundle.ObjectBundle;
+import org.hisp.dhis.dxf2.metadata2.objectbundle.ObjectBundleMode;
 import org.hisp.dhis.dxf2.metadata2.objectbundle.ObjectBundleParams;
 import org.hisp.dhis.dxf2.metadata2.objectbundle.ObjectBundleService;
 import org.hisp.dhis.dxf2.metadata2.objectbundle.ObjectBundleValidation;
+import org.hisp.dhis.importexport.ImportStrategy;
+import org.hisp.dhis.preheat.PreheatIdentifier;
+import org.hisp.dhis.preheat.PreheatMode;
 import org.hisp.dhis.user.CurrentUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -75,6 +81,24 @@
 public MetadataImportParams getParamsFromMap( Map> parameters )
 {
 MetadataImportParams params = new MetadataImportParams();
+params.setObjectBundleMode( getEnumWithDefault( ObjectBundleMode.class, parameters, "objectBundleMode", ObjectBundleMode.VALIDATE ) );
+params.setPreheatMode( getEnumWithDefault( PreheatMode.class, parameters, "preheatMode", PreheatMode.REFERENCE ) );
+params.setPreheatIdentifier( getEnumWithDefault( PreheatIdentifier.class, parameters, "preheatIdentifier", PreheatIdentifier.UID ) );
+params.setImportMode( getEnumWithDefault( ImportStrategy.class, parameters, "import

[Dhis2-devs] Misleading GIS error message

2016-03-02 Thread Prosper BT
Dear Team,

This morning investigating a DATIM PEPFAR ticket I just realized that some
error messages are not description enough to give a user enough information
to identify the issues in their selections.

The user has many data elements and periods presented in pivot tables and
when she turns to open the table as a map, the error message "No data
Found" yet she is able to see the data in pivot table to add also she had
hidden some empty rows.

This seem to be a dimension selection not easily handled by GIS dimension
options of one thematics layer, one data element and one period.

The error probably would have been too much data to handle or something
more descriptive.

I know GIS is undergoing a dramatic change, may be this could be added in
the new App.

Let me know if I can add it as blue print?

Regards

-- 
Prosper Behumbiize, MPH
Global HISP| University Of Oslo/HISP Uganda
+256 752 751 776 | +256 776 139 139
pros...@hispuganda.org  | pros...@dhis2.org | Skype:
prospertb
___
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 22124: minor fixes, adds disply name (if available) when reporting back reference/object errors

2016-03-02 Thread noreply

revno: 22124
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2016-03-03 12:02:44 +0700
message:
  minor fixes, adds disply name (if available) when reporting back 
reference/object errors
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatIdentifier.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.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-api/src/main/java/org/hisp/dhis/preheat/PreheatIdentifier.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatIdentifier.java	2016-03-01 07:51:42 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatIdentifier.java	2016-03-03 05:02:44 +
@@ -30,6 +30,7 @@
 
 import com.google.common.collect.Lists;
 import org.hisp.dhis.common.IdentifiableObject;
+import org.springframework.util.StringUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -88,4 +89,17 @@
 
 return new ArrayList<>();
 }
+
+public  String getIdentifiersWithName( T object )
+{
+List identifiers = getIdentifiers( object );
+String name = StringUtils.isEmpty( object.getDisplayName() ) ? null : object.getDisplayName();
+
+if ( name == null )
+{
+return identifiers.toString();
+}
+
+return name + " " + identifiers.toString();
+}
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-03-03 03:10:04 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-03-03 05:02:44 +
@@ -472,7 +472,7 @@
 if ( ref == null && refObject != null && !Preheat.isDefault( refObject ) )
 {
 preheatErrorReports.add( new PreheatErrorReport( identifier, object.getClass(), ErrorCode.E5001,
-identifier.getIdentifiers( refObject ), identifier.getIdentifiers( object ), p.getName() ) );
+identifier.getIdentifiersWithName( refObject ), identifier.getIdentifiersWithName( object ), p.getName() ) );
 }
 }
 else
@@ -489,7 +489,7 @@
 if ( ref == null && refObject != null )
 {
 preheatErrorReports.add( new PreheatErrorReport( identifier, object.getClass(), ErrorCode.E5001,
-identifier.getIdentifiers( refObject ), identifier.getIdentifiers( object ), p.getCollectionName() ) );
+identifier.getIdentifiersWithName( refObject ), identifier.getIdentifiersWithName( object ), p.getCollectionName() ) );
 }
 else
 {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-03 03:10:04 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-03 05:02:44 +
@@ -185,7 +185,7 @@
 if ( object == null )
 {
 objectBundleValidation.addErrorReport( klass, ErrorCode.E5000, bundle.getPreheatIdentifier(),
-bundle.getPreheatIdentifier().getIdentifiers( identifiableObject ) );
+bundle.getPreheatIdentifier().getIdentifiersWithName( identifiableObject ) );
 iterator.remove();
 }
 }

___
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 22126: Remove URL validation on Document for now, file documents do not point to valid HTTP URLs

2016-03-02 Thread noreply

revno: 22126
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2016-03-03 12:30:36 +0700
message:
  Remove URL validation on Document for now, file documents do not point to 
valid HTTP URLs
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/Document.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-api/src/main/java/org/hisp/dhis/document/Document.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/Document.java	2016-02-11 09:27:02 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/Document.java	2016-03-03 05:30:36 +
@@ -77,7 +77,7 @@
 @JsonProperty
 @JsonView( { DetailedView.class, ExportView.class } )
 @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-@Property( PropertyType.URL )
+// @Property( PropertyType.URL )
 public String getUrl()
 {
 return url;

___
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 22125: If mode is CREATE and object exists, report back and remove from object bundle

2016-03-02 Thread noreply

revno: 22125
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2016-03-03 12:13:32 +0700
message:
  If mode is CREATE and object exists, report back and remove from object bundle
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ErrorCode.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.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-api/src/main/java/org/hisp/dhis/feedback/ErrorCode.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ErrorCode.java	2016-03-03 01:20:51 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ErrorCode.java	2016-03-03 05:13:32 +
@@ -52,8 +52,9 @@
 E4011( "Attribute \"{0}\" is required, but not value was found." ),
 
 /* Preheat Errors */
-E5000( "No matching object for given reference. Identifier was {0}, and object was {1}." ),
-E5001( "Invalid reference {0} on object {1} for association \"{2}\"." );
+E5000( "Found matching object for given reference, but import mode is CREATE. Identifier was {0}, and object was {1}." ),
+E5001( "No matching object for given reference. Identifier was {0}, and object was {1}." ),
+E5002( "Invalid reference {0} on object {1} for association \"{2}\"." );
 
 private String message;
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-03-03 05:02:44 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-03-03 05:13:32 +
@@ -471,7 +471,7 @@
 
 if ( ref == null && refObject != null && !Preheat.isDefault( refObject ) )
 {
-preheatErrorReports.add( new PreheatErrorReport( identifier, object.getClass(), ErrorCode.E5001,
+preheatErrorReports.add( new PreheatErrorReport( identifier, object.getClass(), ErrorCode.E5002,
 identifier.getIdentifiersWithName( refObject ), identifier.getIdentifiersWithName( object ), p.getName() ) );
 }
 }
@@ -488,7 +488,7 @@
 
 if ( ref == null && refObject != null )
 {
-preheatErrorReports.add( new PreheatErrorReport( identifier, object.getClass(), ErrorCode.E5001,
+preheatErrorReports.add( new PreheatErrorReport( identifier, object.getClass(), ErrorCode.E5002,
 identifier.getIdentifiersWithName( refObject ), identifier.getIdentifiersWithName( object ), p.getCollectionName() ) );
 }
 else

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2016-03-03 01:20:51 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2016-03-03 05:13:32 +
@@ -980,7 +980,7 @@
 
 if ( attribute == null )
 {
-errorReports.add( new ErrorReport( Attribute.class, ErrorCode.E5001, attributeValue.getAttribute().getUid(),
+errorReports.add( new ErrorReport( Attribute.class, ErrorCode.E5002, attributeValue.getAttribute().getUid(),
 object.getUid(), "attributeValues" ) );
 }
 

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-03 05:02:44 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-03 05:13:32 +
@@ -173,7 +173,24 @@
 
 for ( Class klass : klasses )
 {
-if ( bun

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 22127: minor, don't report CREATE errors if id == 0, means object is just a placeholder

2016-03-02 Thread noreply

revno: 22127
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2016-03-03 13:00:45 +0700
message:
  minor, don't report CREATE errors if id == 0, means object is just a 
placeholder
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-03 05:13:32 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-03 06:00:45 +
@@ -182,7 +182,7 @@
 IdentifiableObject identifiableObject = iterator.next();
 IdentifiableObject object = bundle.getPreheat().get( bundle.getPreheatIdentifier(), identifiableObject );
 
-if ( object != null )
+if ( object != null && object.getId() > 0 )
 {
 objectBundleValidation.addErrorReport( klass, ErrorCode.E5000, bundle.getPreheatIdentifier(),
 bundle.getPreheatIdentifier().getIdentifiersWithName( identifiableObject ) );

___
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