[Dhis2-devs] [Bug 1498898] Re: api/events.json - page totals are not displayed

2015-10-14 Thread Lars Helge Øverland
Like Abyot say you need to explicitly request this with a param now. The
reason behind this is that the paging operation is very costly, since
you need to count all events as part of the process. So as a
consequence, we don't include this in the response unless it is really
needed.

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

Title:
  api/events.json - page totals are not displayed

Status in DHIS:
  Invalid

Bug description:
  When accessing api/events (.json) the page totals are not displayed in
  the pager.

  version 2.20 rev 19876

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1498898/+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


Re: [Dhis2-devs] Difference between attribute and disaggregate option for category combos

2015-10-14 Thread Lars Helge Øverland
On Wed, Oct 14, 2015 at 5:42 PM, Elmarie Claasen  wrote:

> Hi Lars,
>
>
>
> Thanks that is what I did.
>
> A general question – Isn’t this a way to easily add targets for certain
> data elements with known denominators eg population by setting up a dataset
> with e.g. Yearly or Quarterly period and then capture the target values as
> dataset attributes rather than create a new data element for the target
> which makes analysis more tricky since you need to link the 2 data elements
> to each other somehow?
>
>
>

Hi Elmarie,

yes that would be a feasible approach.

The downside is that if you now load this data element in pivot
tables/charts, by default you will get the real value + the target. So for
people who are not aware of this target dimension/category, they might see
values twice as high as that they would expect.

So it works given that this is handled through user training or other ways.

Lars




> Regards,
>
>
>
> *Elmarie Claasen*
>
> [image: Hisp logo]
>
> Project Manager
>
> Health Information Systems Program
>
> Tel:  041-367 1027
>
> Cell: 082 374 2209
>
> E-mail: elma...@hisp.org
>
> Skype:  elmarie.claasen52
>
>
>
>
>
> This message and any attachments are subject to a disclaimer published at 
> http://www.hisp.org/policies.html#comms_disclaimer
> .   Please read the disclaimer before opening any attachment or taking any
> other action in terms of this electronic transmission.
> If you cannot access the disclaimer, kindly send an email to 
> disclai...@hisp.org
> and a copy will be provided to you. By replying to this e-mail or opening
> any attachment you agree to be bound by the provisions of the disclaimer.
>
>
>
> *From:* Lars Helge Øverland [mailto:larshe...@gmail.com]
> *Sent:* 13 October 2015 02:00 PM
> *To:* Elmarie Claasen
> *Cc:* DHIS 2 Developers list; DHIS 2 Users list
> *Subject:* Re: [Dhis2-devs] Difference between attribute and disaggregate
> option for category combos
>
>
>
> Hi Elmarie,
>
>
>
> the data dimension type on category and category combo indicates whether
> you want to use these as disaggregation categories (linked to data
> elements) or attribute categories (linked to data sets). So attributes
> refers to data set categories.
>
>
>
> If you would like to create a data set category (e.g. one category option
> for "preliminary" and one for "validated"), then you need to set these to
> "attribute". So:
>
>
>
> Category combo: "Output type" - data dimension set to "attribute".
>
> Category: "Output type" -  data dimension set to "attribute".
>
> Category options: "Preliminary output" and "Validated output".
>
>
>
> You can now assign the "Output type" category combo to your data set, and
> the data entry screen will allow you to choose between preliminary and
> validated before entering data.
>
>
>
> regards,
>
>
> Lars
>
>
>
>
>
>
>
> On Tue, Oct 13, 2015 at 1:34 PM, Elmarie Claasen  wrote:
>
> Hi all,
>
>
>
> I need to set up a dhis2 instance in which we want to capture the data for
> specific month twice e.g. preliminary output and validated output. We don’t
> need those to be added together as usual in a data element category
> combination.
>
>
>
> I have been looking into dataset category combinations but that looks a
> lot similar in the manual to attributes. Would like clarity on the
> difference between using disaggregate or attribute when selecting data
> dimension on a catcombo.
>
>
>
> Any suggestions on alternatives would be welcome J
>
>
>
> Regards,
>
>
>
> *Elmarie Claasen*
>
> [image: Hisp logo]
>
> Project Manager
>
> Health Information Systems Program
>
> Tel:  041-367 1027
>
> Cell: 082 374 2209
>
> E-mail: elma...@hisp.org
>
> Skype:  elmarie.claasen52
>
>
>
>
>
> This message and any attachments are subject to a disclaimer published at 
> http://www.hisp.org/policies.html#comms_disclaimer
> .   Please read the disclaimer before opening any attachment or taking any
> other action in terms of this electronic transmission.
> If you cannot access the disclaimer, kindly send an email to 
> disclai...@hisp.org
> and a copy will be provided to you. By replying to this e-mail or opening
> any attachment you agree to be bound by the provisions of the disclaimer.
>
>
>
>
>
> *This message and any attachments are subject to a disclaimer published at
> http://www.hisp.org/policies.html#comms_disclaimer
> .  Please read the
> disclaimer before opening any attachment or taking any other action in
> terms of this electronic transmission.  If you cannot access the
> disclaimer, kindly send an email to disclai...@hisp.org
>  and a copy will be provided to you. By replying to
> this e-mail or opening any attachment you agree to be bound by the
> provisions of the disclaimer.*
>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20702: Data entry, translation of data element description

2015-10-14 Thread noreply

revno: 20702
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 17:30:50 +0200
message:
  Data entry, translation of data element description
modified:
  
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm	2015-10-02 23:47:42 +
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm	2015-10-14 15:30:50 +
@@ -82,7 +82,7 @@
 #end
 
 
-
+
 #if( $decoration && $!dataElement.hasUrl() )#end${encoder.htmlEncode( $dataElement.getFormNameFallback() )}#if( $decoration && $dataElement.hasUrl() )#end
 
 #foreach( $optionCombo in $optionCombos )

___
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] Difference between attribute and disaggregate option for category combos

2015-10-14 Thread Elmarie Claasen
Hi Lars,

 

Thanks that is what I did. 

A general question – Isn’t this a way to easily add targets for certain data 
elements with known denominators eg population by setting up a dataset with 
e.g. Yearly or Quarterly period and then capture the target values as dataset 
attributes rather than create a new data element for the target which makes 
analysis more tricky since you need to link the 2 data elements to each other 
somehow?

 

Regards,

 

Elmarie Claasen

Hisp logo

Project Manager

Health Information Systems Program

Tel:  041-367 1027

Cell: 082 374 2209

E-mail:   elma...@hisp.org

Skype:  elmarie.claasen52 

 

 

This message and any attachments are subject to a disclaimer published at  
 
http://www.hisp.org/policies.html#comms_disclaimer .   Please read the 
disclaimer before opening any attachment or taking any other action in terms of 
this electronic transmission. 
If you cannot access the disclaimer, kindly send an email to  
 disclai...@hisp.org and a copy will be provided to 
you. By replying to this e-mail or opening any attachment you agree to be bound 
by the provisions of the disclaimer. 

 

From: Lars Helge Øverland [mailto:larshe...@gmail.com] 
Sent: 13 October 2015 02:00 PM
To: Elmarie Claasen
Cc: DHIS 2 Developers list; DHIS 2 Users list
Subject: Re: [Dhis2-devs] Difference between attribute and disaggregate option 
for category combos

 

Hi Elmarie,

 

the data dimension type on category and category combo indicates whether you 
want to use these as disaggregation categories (linked to data elements) or 
attribute categories (linked to data sets). So attributes refers to data set 
categories.

 

If you would like to create a data set category (e.g. one category option for 
"preliminary" and one for "validated"), then you need to set these to 
"attribute". So:

 

Category combo: "Output type" - data dimension set to "attribute".

Category: "Output type" -  data dimension set to "attribute".

Category options: "Preliminary output" and "Validated output".

 

You can now assign the "Output type" category combo to your data set, and the 
data entry screen will allow you to choose between preliminary and validated 
before entering data.

 

regards,


Lars

 

 

 

On Tue, Oct 13, 2015 at 1:34 PM, Elmarie Claasen  wrote:

Hi all,

 

I need to set up a dhis2 instance in which we want to capture the data for 
specific month twice e.g. preliminary output and validated output. We don’t 
need those to be added together as usual in a data element category 
combination. 

 

I have been looking into dataset category combinations but that looks a lot 
similar in the manual to attributes. Would like clarity on the difference 
between using disaggregate or attribute when selecting data dimension on a 
catcombo. 

 

Any suggestions on alternatives would be welcome J

 

Regards,

 

Elmarie Claasen

Hisp logo

Project Manager

Health Information Systems Program

Tel:  041-367 1027

Cell: 082 374 2209

E-mail:   elma...@hisp.org

Skype:  elmarie.claasen52 

 

 

This message and any attachments are subject to a disclaimer published at  
 
http://www.hisp.org/policies.html#comms_disclaimer .   Please read the 
disclaimer before opening any attachment or taking any other action in terms of 
this electronic transmission. 
If you cannot access the disclaimer, kindly send an email to  
 disclai...@hisp.org and a copy will be provided to 
you. By replying to this e-mail or opening any attachment you agree to be bound 
by the provisions of the disclaimer. 

 

 

This message and any attachments are subject to a disclaimer published at 
http://www.hisp.org/policies.html#comms_disclaimer.  Please read the disclaimer 
before opening any attachment or taking any other action in terms of this 
electronic transmission.  If you cannot access the disclaimer, kindly send an 
email to disclai...@hisp.org and a copy will be provided to you. By replying to 
this e-mail or opening any attachment you agree to be bound by the provisions 
of the disclaimer.


___
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  

 


-- 


*This message and any attachments are subject to a disclaimer published at 
http://www.hisp.org/policies.html#comms_disclaimer 
.  Please read the 
disclaimer before opening any attachment or taking any other action in 
terms of this electronic transmission.  

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20701: Prefer multipart uploads where available

2015-10-14 Thread noreply

revno: 20701
committer: Halvdan Hoem Grelland 
branch nick: dhis2
timestamp: Wed 2015-10-14 16:28:05 +0200
message:
  Prefer multipart uploads where available
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.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/fileresource/JCloudsFileResourceContentStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.java	2015-10-13 22:20:57 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.java	2015-10-14 14:28:05 +
@@ -64,6 +64,8 @@
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
+import static org.jclouds.blobstore.options.PutOptions.Builder.multipart;
+
 /**
  * @author Halvdan Hoem Grelland
  */
@@ -328,7 +330,7 @@
 
 try
 {
-etag = blobStore.putBlob( container, blob );
+etag = blobStore.putBlob( container, blob, multipart() );
 }
 catch ( RuntimeException rte )
 {

___
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 20703: User setting manager. Moved database call for getting current user behind cache.

2015-10-14 Thread noreply

revno: 20703
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 19:36:42 +0200
message:
  User setting manager. Moved database call for getting current user behind 
cache.
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserSettingServiceTest.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/user/DefaultUserSettingService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 11:29:47 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 17:36:42 +
@@ -182,37 +182,35 @@
 @Override
 public Serializable getUserSetting( String name )
 {
-User user = currentUserService.getCurrentUser();
-
-return getUserSetting( name, user ).orElse( null );
+return getUserSetting( name, Optional.empty() ).orElse( null );
 }
 
 @Override
 public Serializable getUserSetting( String name, Serializable defaultValue )
 {
-User user = currentUserService.getCurrentUser();
-
-return getUserSetting( name, user ).orElse( defaultValue );
+return getUserSetting( name, Optional.empty() ).orElse( defaultValue );
 }
 
 @Override
 public Serializable getUserSetting( String name, Serializable defaultValue, User user )
 {
-return getUserSetting( name, user ).orElse( defaultValue );
+return getUserSetting( name, Optional.ofNullable( user ) ).orElse( defaultValue );
 }
 
-private Optional getUserSetting( String name, User user )
+private Optional getUserSetting( String name, Optional user )
 {
-if ( name == null || user == null )
+if ( name == null )
 {
 return Optional.empty();
 }
 
+String username = user.isPresent() ? user.get().getUsername() : currentUserService.getCurrentUsername();
+
 try
 {
-String cacheKey = getCacheKey( name, user.getUsername() );
+String cacheKey = getCacheKey( name, username );
 
-return SETTING_CACHE.get( cacheKey, () -> getUserSettingOptional( user, name ) );
+return SETTING_CACHE.get( cacheKey, () -> getUserSettingOptional( username, name ) );
 }
 catch ( ExecutionException ignored )
 {
@@ -220,9 +218,16 @@
 }
 }
 
-private Optional getUserSettingOptional( User user, String name )
+private Optional getUserSettingOptional( String username, String settingName )
 {
-UserSetting setting = userSettingStore.getUserSetting( user, name );
+UserCredentials userCredentials = userService.getUserCredentialsByUsername( username );
+
+if ( userCredentials == null )
+{
+return Optional.empty();
+}
+
+UserSetting setting = userSettingStore.getUserSetting( userCredentials.getUserInfo(), settingName );
 
 return setting != null ? Optional.ofNullable( setting.getValue() ) : Optional.empty();
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserSettingServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserSettingServiceTest.java	2015-10-14 09:35:22 +
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserSettingServiceTest.java	2015-10-14 17:36:42 +
@@ -58,10 +58,10 @@
 
 userA = createUser( 'A' );
 userService.addUser( userA );
-UserCredentials userCredentials = userA.getUserCredentials();
-userCredentials.setUsername( "usernameA" );
-userCredentials.setUserInfo( userA );
-userService.addUserCredentials( userCredentials );
+UserCredentials userCredentialsA = userA.getUserCredentials();
+userCredentialsA.setUsername( "usernameA" );
+userCredentialsA.setUserInfo( userA );
+userService.addUserCredentials( userCredentialsA );
 }
 
 @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 20684: minor lambda updates

2015-10-14 Thread noreply

revno: 20684
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Wed 2015-10-14 13:57:30 +0700
message:
  minor lambda updates
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.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/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2015-10-05 17:45:17 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2015-10-14 06:57:30 +
@@ -815,32 +815,16 @@
 }
 
 dataElements.clear();
-
-for ( DataElement dataElement : dataSet.getDataElements() )
-{
-addDataElement( dataElement );
-}
+dataSet.getDataElements().forEach( this::addDataElement );
 
 indicators.clear();
-
-for ( Indicator indicator : dataSet.getIndicators() )
-{
-addIndicator( indicator );
-}
+dataSet.getIndicators().forEach( this::addIndicator );
 
 compulsoryDataElementOperands.clear();
-
-for ( DataElementOperand dataElementOperand : dataSet.getCompulsoryDataElementOperands() )
-{
-addCompulsoryDataElementOperand( dataElementOperand );
-}
+dataSet.getCompulsoryDataElementOperands().forEach( this::addCompulsoryDataElementOperand );
 
 removeAllOrganisationUnits();
-
-for ( OrganisationUnit organisationUnit : dataSet.getSources() )
-{
-addOrganisationUnit( organisationUnit );
-}
+dataSet.getSources().forEach( this::addOrganisationUnit );
 
 attributeValues.clear();
 attributeValues.addAll( dataSet.getAttributeValues() );

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java	2015-10-05 17:45:17 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java	2015-10-14 06:57:30 +
@@ -170,7 +170,7 @@
 {
 return dataElements != null && !dataElements.isEmpty();
 }
-
+
 @Override
 public boolean haveUniqueNames()
 {
@@ -286,18 +286,10 @@
 }
 
 removeAllDataElements();
-
-for ( DataElement dataElement : section.getDataElements() )
-{
-addDataElement( dataElement );
-}
+section.getDataElements().forEach( this::addDataElement );
 
 removeAllGreyedFields();
-
-for ( DataElementOperand dataElementOperand : section.getGreyedFields() )
-{
-addGreyedField( dataElementOperand );
-}
+section.getGreyedFields().forEach( this::addGreyedField );
 }
 }
 }

___
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 20683: remove unused dataarchive package (and classes)

2015-10-14 Thread noreply

revno: 20683
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Wed 2015-10-14 13:49:35 +0700
message:
  remove unused dataarchive package (and classes)
removed:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/DataArchiveOperation.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/DataArchiveService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/DataArchiveStore.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/DataEliminationStrategy.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
=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/DataArchiveOperation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/DataArchiveOperation.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/DataArchiveOperation.java	1970-01-01 00:00:00 +
@@ -1,38 +0,0 @@
-package org.hisp.dhis.dataarchive;
-
-/*
- * Copyright (c) 2004-2015, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @author Lars Helge Overland
- */
-public enum DataArchiveOperation
-{
-ARCHIVE,
-UNARCHIVE
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/DataArchiveService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/DataArchiveService.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataarchive/DataArchiveService.java	1970-01-01 00:00:00 +
@@ -1,47 +0,0 @@
-package org.hisp.dhis.dataarchive;
-
-/*
- * Copyright (c) 2004-2015, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20689: Removed unused method

2015-10-14 Thread noreply

revno: 20689
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 09:46:53 +0200
message:
  Removed unused method
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.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/user/UserSettingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 07:45:12 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 07:46:53 +
@@ -30,7 +30,6 @@
 
 import java.io.Serializable;
 import java.util.List;
-import java.util.Map;
 
 /**
  * The main interface for working with user settings. Implementation need to get
@@ -167,16 +166,6 @@
 List getUserSettings( String name );
 
 /**
- * Returns a Map with an entry for all UserSettings with the given name where
- * the key is the user and the value is the value of the user setting.
- *
- * @param name the name of the UserSetting.
- * @param defaultValue the value to return if the UserSetting value is null.
- * @return a Map.
- */
-Map getUserSettings( String name, Serializable defaultValue );
-
-/**
  * Returns the value of the user setting specified by the given name.
  * 
  * @param name the name of the user setting.

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 07:45:12 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 07:46:53 +
@@ -30,15 +30,12 @@
 
 import java.io.Serializable;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.transaction.annotation.Transactional;
 
 /**
  * @author Torgeir Lorange Ostby
- * @version $Id: DefaultUserSettingService.java 5724 2008-09-18 14:37:01Z larshelg $
  */
 @Transactional
 public class DefaultUserSettingService
@@ -229,19 +226,6 @@
 }
 
 @Override
-public Map getUserSettings( String name, Serializable defaultValue )
-{
-Map map = new HashMap<>();
-
-for ( UserSetting setting : userSettingStore.getUserSettings( name ) )
-{
-map.put( setting.getUser(), setting.getValue() != null ? setting.getValue() : defaultValue );
-}
-
-return map;
-}
-
-@Override
 public List getAllUserSettings()
 {
 User currentUser = currentUserService.getCurrentUser();

___
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 20688: User settings, cleanup

2015-10-14 Thread noreply

revno: 20688
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 09:45:12 +0200
message:
  User settings, cleanup
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.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/user/UserSettingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 07:31:34 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 07:45:12 +
@@ -67,15 +67,7 @@
  * @param userSetting the UserSetting to add.
  */
 void addUserSetting( UserSetting userSetting );
-
-/**
- * If a matching UserSetting exists, based on its user and name, it will be
- * updated, if not, the given UserSetting will be added.
- *
- * @param userSetting the UserSetting.
- */
-void addOrUpdateUserSetting( UserSetting userSetting );
-
+
 /**
  * Saves the name/value pair as a user setting connected to the currently
  * logged in user.
@@ -87,7 +79,8 @@
 void saveUserSetting( String name, Serializable value );
 
 /**
- * Saves the name/value pair as a user setting connected to user identified by username
+ * Saves the name/value pair as a user setting connected to user identified 
+ * by username.
  *
  * @param name the name/handle of the value.
  * @param value the value to store.
@@ -97,6 +90,16 @@
 void saveUserSetting( String name, Serializable value, String username );
 
 /**
+ * Saves the name/value pair as a user setting connected to user.
+ *
+ * @param name the name/handle of the value.
+ * @param value the value to store.
+ * @param username the user.
+ * @throws NoCurrentUserException if there is no user.
+ */
+void saveUserSetting( String name, Serializable value, User user );
+
+/**
  * Updates a UserSetting.
  *
  * @param userSetting the UserSetting to update.
@@ -213,5 +216,4 @@
  * @throws NoCurrentUserException if there is no current user.
  */
 List getAllUserSettings();
-
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 07:31:34 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 07:45:12 +
@@ -80,29 +80,13 @@
 }
 
 @Override
-public void addOrUpdateUserSetting( UserSetting userSetting )
-{
-UserSetting setting = getUserSetting( userSetting.getUser(), userSetting.getName() );
-
-if ( setting != null )
-{
-setting.mergeWith( userSetting );
-updateUserSetting( setting );
-}
-else
-{
-addUserSetting( userSetting );
-}
-}
-
-@Override
 public void saveUserSetting( String name, Serializable value, String username )
 {
 UserCredentials credentials = userService.getUserCredentialsByUsername( username );
 
 if ( credentials != null )
 {
-save( name, value, credentials.getUserInfo() );
+saveUserSetting( name, value, credentials.getUserInfo() );
 }
 }
 
@@ -111,10 +95,11 @@
 {
 User currentUser = currentUserService.getCurrentUser();
 
-save( name, value, currentUser );
+saveUserSetting( name, value, currentUser );
 }
 
-private void save( String name, Serializable value, User user )
+@Override
+public void saveUserSetting( String name, Serializable value, User user )
 {
 if ( user == null )
 {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java	2015-10-08 13:50:01 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java	2015-10-14 07:45:12 +
@@ -51,7 +51,6 @@
 import org.hisp.dhis.user.UserGroup;
 import org.hisp.dhis.user.UserGroupService;
 import org.hisp.dhis.user.UserService;
-import 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20691: remove unused comparators

2015-10-14 Thread noreply

revno: 20691
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Wed 2015-10-14 14:53:49 +0700
message:
  remove unused comparators
removed:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/comparator/ProgramStageInstanceDueDateComparator.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/comparator/ProgramStageMinDaysComparator.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
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/comparator/ProgramStageInstanceDueDateComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/comparator/ProgramStageInstanceDueDateComparator.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/comparator/ProgramStageInstanceDueDateComparator.java	1970-01-01 00:00:00 +
@@ -1,56 +0,0 @@
-package org.hisp.dhis.program.comparator;
-
-/*
- * Copyright (c) 2004-2015, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.hisp.dhis.program.ProgramStageInstance;
-
-import java.util.Comparator;
-
-/**
- * @author Chau Thu Tran
- * @version $ProgramStageInstanceDueDateComparator.java Jun 7, 2012 9:49:25 AM$
- */
-public class ProgramStageInstanceDueDateComparator
-implements Comparator
-{
-@Override
-public int compare( ProgramStageInstance programStageInstance1, ProgramStageInstance programStageInstance2 )
-{
-if ( programStageInstance1.getDueDate().before( programStageInstance2.getDueDate() ) )
-{
-return -1;
-}
-else if ( programStageInstance1.getDueDate().after( programStageInstance2.getDueDate() ) )
-{
-return 1;
-}
-return 0;
-}
-
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/comparator/ProgramStageMinDaysComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/comparator/ProgramStageMinDaysComparator.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/comparator/ProgramStageMinDaysComparator.java	1970-01-01 00:00:00 +
@@ -1,60 +0,0 @@
-package org.hisp.dhis.program.comparator;
-
-/*
- * Copyright (c) 2004-2015, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20685: Interpretatio, using enum, removed constants

2015-10-14 Thread noreply

revno: 20685
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 09:25:31 +0200
message:
  Interpretatio, using enum, removed constants
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java
  
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.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/interpretation/Interpretation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java	2015-10-13 10:18:02 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java	2015-10-14 07:25:31 +
@@ -62,11 +62,6 @@
 public class Interpretation
 extends BaseIdentifiableObject
 {
-public static final String TYPE_CHART = "chart";
-public static final String TYPE_MAP = "map";
-public static final String TYPE_REPORT_TABLE = "reportTable";
-public static final String TYPE_DATASET_REPORT = "dataSetReport";
-
 private Chart chart;
 
 private Map map;

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java	2015-10-14 07:25:31 +
@@ -34,6 +34,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.hisp.dhis.analytics.AnalyticsFavoriteType;
 import org.hisp.dhis.interpretation.Interpretation;
 import org.hisp.dhis.interpretation.InterpretationService;
 
@@ -90,7 +91,7 @@
 {
 Interpretation currentInterpretation = i.next();
 
-if ( currentInterpretation.getType().equals( Interpretation.TYPE_CHART ) )
+if ( currentInterpretation.getType() == AnalyticsFavoriteType.CHART )
 {
 finalInterpretations.add( currentInterpretation );
 }

___
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 20693: User settings. Included a cache for getting settings. Improves performance as this is called very...

2015-10-14 Thread noreply

revno: 20693
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 11:35:22 +0200
message:
  User settings. Included a cache for getting settings. Improves performance as 
this is called very frequently. Using Optional.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/DefaultMessageService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/EmailMessageSender.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultSecurityService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultSystemSettingManager.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/SmsMessageSender.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingManagerTest.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserSettingServiceTest.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.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/setting/SystemSettingManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2015-10-13 09:22:30 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2015-10-14 09:35:22 +
@@ -142,6 +142,8 @@
 
 Map getSystemSettingsAsMap( Set names );
 
+void invalidateCache();
+
 // -
 // Specific methods
 // -

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 07:50:20 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 09:35:22 +
@@ -36,7 +36,6 @@
  * the current user from {@link CurrentUserService}.
  * 
  * @author Torgeir Lorange Ostby
- * @version $Id: UserSettingService.java 2869 2007-02-20 14:26:09Z andegje $
  */
 public interface UserSettingService
 {
@@ -50,12 +49,14 @@
 String KEY_MESSAGE_SMS_NOTIFICATION = "keyMessageSmsNotification";
 String KEY_UI_LOCALE = "keyUiLocale";
 String KEY_DB_LOCALE = "keyDbLocale";
-String KEY_GENERATE_REPORT_INTERFACE = "keyGenerateReportInterface";
 String KEY_ANALYSIS_DISPLAY_PROPERTY = "keyAnalysisDisplayProperty";
 String AUTO_SAVE_CASE_ENTRY_FORM = "autoSaveCaseEntryForm";
 String AUTO_SAVE_TRACKED_ENTITY_REGISTRATION_ENTRY_FORM = "autoSavetTrackedEntityForm";
+
 String DEFAULT_ANALYSIS_DISPLAY_PROPERTY = "name";
 
+//TODO use enum for names
+
 // -
 // UserSettings
 // -
@@ -99,13 +100,6 @@
 void saveUserSetting( String name, Serializable value, User user );
 
 /**
- * Updates a UserSetting.
- *
- * @param userSetting the UserSetting to update.
- */
-void updateUserSetting( UserSetting userSetting );
-
-/**
  * Deletes a UserSetting.
  *
  * @param userSetting the UserSetting to delete.
@@ -119,38 +113,16 @@
  * @throws NoCurrentUserException if there is no current user.
  */
 void deleteUserSetting( String name );
+
+/**
+ * Deletes the user setting with the given name for the given user.
+ * 
+ * @param name the name of the user setting to delete.
+ * @user the user.
+ */
+void deleteUserSetting( String name, User user );
 
 /**
- * Retrieves the UserSetting associated with the given User for the given
- * UserSetting name.
- *
- * @param user the User.
- * @param name the name of the UserSetting.
- * @return the UserSetting.
- */
-UserSetting getUserSetting( User user, String name );
-
-/**
- * Retrieves a user setting value for the given user and setting name. Returns
- * the given default value if the setting does not exist or the setting value
- * is null.
- *
- * @param user the user.
- * @param name the setting name.
- 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20687: Minor bugfix, use AnalyticsFavoriteType instead of string constant for checking for interpretatio...

2015-10-14 Thread noreply

revno: 20687
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Wed 2015-10-14 14:39:25 +0700
message:
  Minor bugfix, use AnalyticsFavoriteType instead of string constant for 
checking for interpretation type
modified:
  
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java	2015-10-14 07:25:31 +
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java	2015-10-14 07:39:25 +
@@ -86,7 +86,7 @@
 List finalInterpretations = new ArrayList<>();
 
 Iterator i = tempInterpretations.iterator();
-
+
 while ( i.hasNext() )
 {
 Interpretation currentInterpretation = i.next();

___
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 20690: User setting service, removed unused methods

2015-10-14 Thread noreply

revno: 20690
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 09:50:20 +0200
message:
  User setting service, removed unused methods
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingStore.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserSettingStore.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/user/UserSettingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 07:46:53 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 07:50:20 +
@@ -113,13 +113,6 @@
 void deleteUserSetting( UserSetting userSetting );
 
 /**
- * Removes all user settings associated with the given user.
- *
- * @param user the user.
- */
-void removeUserSettings( User user );
-
-/**
  * Deletes the user setting with the given name.
  * 
  * @param name the name of the user setting to delete.
@@ -158,14 +151,6 @@
 List getAllUserSettings( User user );
 
 /**
- * Retrieves all UserSettings with the given name.
- * 
- * @param name the name.
- * @return a List of UserSettings.
- */
-List getUserSettings( String name );
-
-/**
  * Returns the value of the user setting specified by the given name.
  * 
  * @param name the name of the user setting.
@@ -176,16 +161,6 @@
 Serializable getUserSetting( String name );
 
 /**
- * Returns the value of the user setting specified by the given name.
- * 
- * @param name the name of the user setting.
- * @return the value corresponding to the named user setting, or null if
- * there is no match.
- * @throws NoCurrentUserException if there is no current user.
- */
-Serializable getUserSetting( String name, String username );
-
-/**
  * Returns the value of the user setting specified by the given name. If
  * there is no current user or the user setting doesn't exist, the specified
  * default value is returned.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingStore.java	2015-06-16 05:11:29 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingStore.java	2015-10-14 07:50:20 +
@@ -72,14 +72,6 @@
 void deleteUserSetting( UserSetting userSetting );
 
 /**
- * Returns all UserSettings with the given name.
- *
- * @param name the name.
- * @return a List of UserSettings.
- */
-List getUserSettings( String name );
-
-/**
  * Removes all user settings associated with the given user.
  * 
  * @param user the user.

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 07:46:53 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 07:50:20 +
@@ -135,13 +135,6 @@
 }
 
 @Override
-public void removeUserSettings( User user )
-{
-userSettingStore.removeUserSettings( user );
-}
-
-
-@Override
 public void deleteUserSetting( String name )
 {
 User currentUser = currentUserService.getCurrentUser();
@@ -153,12 +146,6 @@
 }
 
 @Override
-public List getUserSettings( String name )
-{
-return userSettingStore.getUserSettings( name );
-}
-
-@Override
 public UserSetting getUserSetting( User user, String name )
 {
 return userSettingStore.getUserSetting( user, name );
@@ -192,14 +179,6 @@
 return getUserSetting( name, currentUser );
 }
 
-@Override
-public Serializable getUserSetting( String name, String username )
-{
-UserCredentials credentials = userService.getUserCredentialsByUsername( username );
-
-return getUserSetting( name, credentials == null ? null : credentials.getUserInfo() );
-}
-
 private Serializable getUserSetting( String name, User currentUser ) 
 {
 if ( currentUser == null )

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserSettingStore.java'
--- 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20692: minor, use lambda in ProgramStage.getAllDataElements

2015-10-14 Thread noreply

revno: 20692
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Wed 2015-10-14 14:57:41 +0700
message:
  minor, use lambda in ProgramStage.getAllDataElements
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.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/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2015-10-07 03:23:23 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2015-10-14 07:57:41 +
@@ -52,10 +52,10 @@
 import org.hisp.dhis.schema.annotation.PropertyRange;
 import org.hisp.dhis.trackedentity.TrackedEntityInstanceReminder;
 
-import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * @author Abyot Asalefew
@@ -143,17 +143,9 @@
 
 public List getAllDataElements()
 {
-List dataElements = new ArrayList<>();
-
-for ( ProgramStageDataElement element : programStageDataElements )
-{
-if ( element.getDataElement() != null )
-{
-dataElements.add( element.getDataElement() );
-}
-}
-
-return dataElements;
+return programStageDataElements.stream()
+.filter( element -> element.getDataElement() != null )
+.map( ProgramStageDataElement::getDataElement ).collect( Collectors.toList() );
 }
 
 @JsonProperty

___
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 20686: Reordered user setting methods

2015-10-14 Thread noreply

revno: 20686
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 09:31:34 +0200
message:
  Reordered user setting methods
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.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/user/UserSettingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-09-16 14:49:50 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 07:31:34 +
@@ -77,6 +77,26 @@
 void addOrUpdateUserSetting( UserSetting userSetting );
 
 /**
+ * Saves the name/value pair as a user setting connected to the currently
+ * logged in user.
+ * 
+ * @param name the name/handle of the value.
+ * @param value the value to store.
+ * @throws NoCurrentUserException if there is no current user.
+ */
+void saveUserSetting( String name, Serializable value );
+
+/**
+ * Saves the name/value pair as a user setting connected to user identified by username
+ *
+ * @param name the name/handle of the value.
+ * @param value the value to store.
+ * @param username the username of user.
+ * @throws NoCurrentUserException if there is no user.
+ */
+void saveUserSetting( String name, Serializable value, String username );
+
+/**
  * Updates a UserSetting.
  *
  * @param userSetting the UserSetting to update.
@@ -84,6 +104,28 @@
 void updateUserSetting( UserSetting userSetting );
 
 /**
+ * Deletes a UserSetting.
+ *
+ * @param userSetting the UserSetting to delete.
+ */
+void deleteUserSetting( UserSetting userSetting );
+
+/**
+ * Removes all user settings associated with the given user.
+ *
+ * @param user the user.
+ */
+void removeUserSettings( User user );
+
+/**
+ * Deletes the user setting with the given name.
+ * 
+ * @param name the name of the user setting to delete.
+ * @throws NoCurrentUserException if there is no current user.
+ */
+void deleteUserSetting( String name );
+
+/**
  * Retrieves the UserSetting associated with the given User for the given
  * UserSetting name.
  *
@@ -122,13 +164,6 @@
 List getUserSettings( String name );
 
 /**
- * Deletes a UserSetting.
- *
- * @param userSetting the UserSetting to delete.
- */
-void deleteUserSetting( UserSetting userSetting );
-
-/**
  * Returns a Map with an entry for all UserSettings with the given name where
  * the key is the user and the value is the value of the user setting.
  *
@@ -139,33 +174,6 @@
 Map getUserSettings( String name, Serializable defaultValue );
 
 /**
- * Removes all user settings associated with the given user.
- *
- * @param user the user.
- */
-void removeUserSettings( User user );
-
-/**
- * Saves the name/value pair as a user setting connected to the currently
- * logged in user.
- * 
- * @param name the name/handle of the value.
- * @param value the value to store.
- * @throws NoCurrentUserException if there is no current user.
- */
-void saveUserSetting( String name, Serializable value );
-
-/**
- * Saves the name/value pair as a user setting connected to user identified by username
- *
- * @param name the name/handle of the value.
- * @param value the value to store.
- * @param username the username of user.
- * @throws NoCurrentUserException if there is no user.
- */
-void saveUserSetting( String name, Serializable value, String username );
-
-/**
  * Returns the value of the user setting specified by the given name.
  * 
  * @param name the name of the user setting.
@@ -206,11 +214,4 @@
  */
 List getAllUserSettings();
 
-/**
- * Deletes the user setting with the given name.
- * 
- * @param name the name of the user setting to delete.
- * @throws NoCurrentUserException if there is no current user.
- */
-void deleteUserSetting( String name );
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-05 07:55:19 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 07:31:34 +
@@ -96,75 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20704: Fixed bug where switching org unit, deleting a file entry and switching back again caused fileinf...

2015-10-14 Thread noreply

revno: 20704
committer: Halvdan Hoem Grelland 
branch nick: dhis2
timestamp: Thu 2015-10-15 00:01:58 +0200
message:
  Fixed bug where switching org unit, deleting a file entry and switching back 
again caused fileinfo to not be displayed
modified:
  
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js	2015-10-14 11:46:39 +
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js	2015-10-14 22:01:58 +
@@ -45,7 +45,6 @@
 success: function() {
 $fileinfoName.text( '' );
 $fileinfoSize.text( '' );
-$fileinfo.hide();
 $displayField.css( 'background-color', '' );
 $field.val( '' );
 setButtonUpload();

___
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 20705: Reversed use of multipart uploads in JCloudsFileResourceContentStore. Seems to fail on files over...

2015-10-14 Thread noreply

revno: 20705
committer: Halvdan Hoem Grelland 
branch nick: dhis2
timestamp: Thu 2015-10-15 00:50:32 +0200
message:
  Reversed use of multipart uploads in JCloudsFileResourceContentStore. Seems 
to fail on files over a certain size (meaning more than one part?) on the MD5 
integrity check at AWS S3 side. Needs more research to implement correctly, so 
turning it off for now. This does unfortunately have a meaningful performance 
hit on large uploads.
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/FileResourceUploadCallbackProvider.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.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/fileresource/FileResourceUploadCallbackProvider.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/FileResourceUploadCallbackProvider.java	2015-10-13 22:07:31 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/FileResourceUploadCallbackProvider.java	2015-10-14 22:50:32 +
@@ -54,8 +54,12 @@
 log.error( "Saving file content failed", ex );
 
 FileResource fetchedFileResource = idObjectManager.get( FileResource.class, fileResourceUid );
-fetchedFileResource.setStorageStatus( FileResourceStorageStatus.FAILED );
-idObjectManager.update( fetchedFileResource );
+
+if ( fetchedFileResource != null )
+{
+fetchedFileResource.setStorageStatus( FileResourceStorageStatus.FAILED );
+idObjectManager.update( fetchedFileResource );
+}
 }
 
 @Override

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.java	2015-10-14 14:28:05 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.java	2015-10-14 22:50:32 +
@@ -64,8 +64,6 @@
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
-import static org.jclouds.blobstore.options.PutOptions.Builder.multipart;
-
 /**
  * @author Halvdan Hoem Grelland
  */
@@ -330,7 +328,7 @@
 
 try
 {
-etag = blobStore.putBlob( container, blob, multipart() );
+etag = blobStore.putBlob( container, blob );
 }
 catch ( RuntimeException rte )
 {

___
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 20694: Minor

2015-10-14 Thread noreply

revno: 20694
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 12:26:36 +0200
message:
  Minor
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.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/user/DefaultUserSettingService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 09:35:22 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 10:26:36 +
@@ -49,7 +49,7 @@
 implements UserSettingService
 {
 /**
- * Cache for user settings. Does not accept nulls. Key is name + username.
+ * Cache for user settings. Does not accept nulls. Key is "name-username".
  */
 private static Cache SETTING_CACHE = CacheBuilder.newBuilder()
 .expireAfterAccess( 15, TimeUnit.MINUTES )
@@ -226,9 +226,7 @@
 {
 String cacheKey = getCacheKey( name, user.getUsername() );
 
-Optional setting = SETTING_CACHE.get( cacheKey, () -> getUserSettingOptional( user, name ) );
-
-return setting;
+return SETTING_CACHE.get( cacheKey, () -> getUserSettingOptional( user, name ) );
 }
 catch ( ExecutionException ignored )
 {

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

2015-10-14 Thread noreply

revno: 20696
committer: Halvdan Hoem Grelland 
branch nick: dhis2
timestamp: Wed 2015-10-14 12:44:38 +0200
message:
  minor
modified:
  
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js	2015-10-06 17:11:19 +
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js	2015-10-14 10:44:38 +
@@ -42,8 +42,7 @@
 type: 'POST',
 dataType: 'json',
 data: postData,
-success: function()
-{
+success: function() {
 $fileinfoName.text( '' );
 $fileinfoSize.text( '' );
 $fileinfo.hide();
@@ -163,26 +162,22 @@
 multipart: true,
 replaceFileInput: false,
 progressInterval: 250, /* ms */
-start: function( e )
-{
+start: function( e ) {
 $button.button( 'disable' );
 $progressBar.toggleClass( 'upload-progress-bar-complete', false );
 $fileinfo.hide();
 $progress.show();
 },
-progress: function( e, data )
-{
+progress: function( e, data ) {
 updateProgress( data.loaded, data.total );
 },
-fail: function( e, data )
-{
+fail: function( e, data ) {
 console.error( data.errorThrown );
 
 setHeaderDelayMessage( i18n_file_upload_failed );
 setButtonUpload();
 },
-done: function( e, data )
-{
+done: function( e, data ) {
 var fileResource = data.result.response.fileResource;
 $field.val( fileResource.id );
 

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

2015-10-14 Thread noreply

revno: 20697
committer: Halvdan Hoem Grelland 
branch nick: dhis2
timestamp: Wed 2015-10-14 12:45:24 +0200
message:
  minor
modified:
  
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js	2015-10-14 10:44:38 +
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js	2015-10-14 10:45:24 +
@@ -50,8 +50,7 @@
 $field.val( '' );
 setButtonUpload();
 },
-error: function( data )
-{
+error: function( data ) {
 console.log( data.errorThrown );
 }
 } );

___
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 20698: System settings, more caching

2015-10-14 Thread noreply

revno: 20698
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 13:29:47 +0200
message:
  System settings, more caching
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/Setting.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultStyleManager.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultSystemSettingManager.java
  
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/user/DefaultUserSettingService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.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/setting/Setting.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/Setting.java	2015-10-13 09:22:30 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/Setting.java	2015-10-14 11:29:47 +
@@ -108,7 +108,8 @@
 DATE_FORMAT( "keyDateFormat", "-MM-dd", String.class ),
 APP_FOLDER_PATH( "appFolderPath" ),
 APP_BASE_URL( "appBaseUrl" ),
-APP_STORE_URL( "appStoreUrl", "http://www.dhis2.org/appstore;, String.class );
+APP_STORE_URL( "appStoreUrl", "http://www.dhis2.org/appstore;, String.class ),
+STYLE( "currentStyle", "light_blue", String.class );
 
 private final String name;
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2015-10-14 09:35:22 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2015-10-14 11:29:47 +
@@ -130,8 +130,6 @@
 
 Serializable getSystemSetting( String name );
 
-Serializable getSystemSetting( String name, Serializable defaultValue );
-
 Serializable getSystemSetting( Setting setting );
 
 Serializable getSystemSetting( Setting setting, Serializable defaultValue );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultStyleManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultStyleManager.java	2015-09-10 16:35:55 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultStyleManager.java	2015-10-14 11:29:47 +
@@ -35,15 +35,11 @@
 
 /**
  * @author Lars Helge Overland
- * @version $Id$
  */
 public class DefaultStyleManager
 implements StyleManager
 {
-private static final String SETTING_NAME_STYLE = "currentStyle";
-
 private static final String SEPARATOR = "/";
-
 private static final String SYSTEM_SEPARATOR = File.separator;
 
 // -
@@ -64,13 +60,6 @@
 this.userSettingService = userSettingService;
 }
 
-private String defaultStyle;
-
-public void setDefaultStyle( String defaultStyle )
-{
-this.defaultStyle = defaultStyle;
-}
-
 /**
  * Map for styles. The key refers to the user setting key and the value refers
  * to the path to the CSS file of the style relative to /dhis-web-commons/.
@@ -89,19 +78,19 @@
 @Override
 public void setSystemStyle( String style )
 {
- systemSettingManager.saveSystemSetting( SETTING_NAME_STYLE, style );
+systemSettingManager.saveSystemSetting( Setting.STYLE.getName(), style );
 }
 
 @Override
 public void setUserStyle( String style )
 {
-userSettingService.saveUserSetting( SETTING_NAME_STYLE, style );
+userSettingService.saveUserSetting( Setting.STYLE.getName(), style );
 }
 
 @Override
 public String getCurrentStyle()
 {
-String style = (String) userSettingService.getUserSetting( SETTING_NAME_STYLE );
+String style = (String) userSettingService.getUserSetting( Setting.STYLE.getName() );
 
 if ( style != null )
 {
@@ -114,7 +103,7 @@
 @Override
 public String getSystemStyle()
 {
-return (String) systemSettingManager.getSystemSetting( SETTING_NAME_STYLE, styles.get( defaultStyle ) );
+return (String) systemSettingManager.getSystemSetting( Setting.STYLE );
 }
 
 @Override

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/setting/DefaultSystemSettingManager.java'
--- 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20695: User settings, null check

2015-10-14 Thread noreply

revno: 20695
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 12:36:42 +0200
message:
  User settings, null check
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.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/user/DefaultUserSettingService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 10:26:36 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 10:36:42 +
@@ -132,10 +132,7 @@
 
 if ( userSetting == null )
 {
-userSetting = new UserSetting();
-userSetting.setUser( user );
-userSetting.setName( name );
-userSetting.setValue( value );
+userSetting = new UserSetting( user, name, value );
 
 addUserSetting( userSetting );
 }
@@ -181,47 +178,36 @@
 deleteUserSetting( setting );
 }
 }
-
+
+@Override
+public Serializable getUserSetting( String name )
+{
+User user = currentUserService.getCurrentUser();
+
+return getUserSetting( name, user ).orElse( null );
+}
+
 @Override
 public Serializable getUserSetting( String name, Serializable defaultValue )
 {
 User user = currentUserService.getCurrentUser();
 
-if ( user == null )
-{
-return defaultValue;
-}
-
-Optional userSetting = getUserSetting( name, user );
-
-return userSetting.orElse( defaultValue );
-}
-
-@Override
-public Serializable getUserSetting( String name )
-{
-User user = currentUserService.getCurrentUser();
-
-if ( user == null )
-{
-return null;
-}
-
-Optional setting = getUserSetting( name, user );
-
-return setting.orElse( null );
+return getUserSetting( name, user ).orElse( defaultValue );
 }
 
 @Override
 public Serializable getUserSetting( String name, Serializable defaultValue, User user )
 {
-Optional setting = getUserSetting( name, user );
-
-return setting.orElse( defaultValue );
+return getUserSetting( name, user ).orElse( defaultValue );
 }
 
 private Optional getUserSetting( String name, User user )
 {
+if ( name == null || user == null )
+{
+return Optional.empty();
+}
+
 try
 {
 String cacheKey = getCacheKey( name, user.getUsername() );
@@ -246,17 +232,17 @@
 {
 User currentUser = currentUserService.getCurrentUser();
 
-if ( currentUser == null )
-{
-return new ArrayList<>();
-}
-
 return getAllUserSettings( currentUser );
 }
 
 @Override
 public List getAllUserSettings( User user )
 {
+if ( user == null )
+{
+return new ArrayList<>();
+}
+
 return userSettingStore.getAllUserSettings( user );
 }
 

___
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] DHIS2 analytics table returns empty

2015-10-14 Thread Yemi Awe
Dear Team,
Upgrading to dhis2.20 is returning empty rows in the analytics_20xx.

The logs shows
* WARN  2015-10-10 11:40:15,779 Duplicate object: [Data element: 584 option
combo: 486 period: 795 org unit: 51 org unit group: 0 value: 55.0]
(AbstractBatchHandler.java [SimpleAsyncTaskExecutor-72])
* WARN  2015-10-10 11:40:15,779 Duplicate object: [Data element: 584 option
combo: 488 period: 795 org unit: 51 org unit group: 0 value: 12.0]
(AbstractBatchHandler.java [SimpleAsyncTaskExecutor-72])
* WARN  2015-10-10 11:40:15,779 Duplicate object: [Data element: 574 option
combo: 485 period: 795 org unit: 51 org unit group: 0 value: 24.0]
(AbstractBatchHandler.java [SimpleAsyncTaskExecutor-72])
* WARN  2015-10-10 11:40:15,779 Duplicate object: [Data element: 573 option
combo: 487 period: 795 org unit: 51 org unit group: 0 value: 77.0]
(AbstractBatchHandler.java [SimpleAsyncTaskExecutor-72])
* WARN  2015-10-10 11:40:15,779 Duplicate object: [Data element: 574 option
combo: 486 period: 795 org unit: 51 org unit group: 0 value: 28.0]
(AbstractBatchHandler.java [SimpleAsyncTaskExecutor-72])


I set all the dataelement to default then i have the WARN in the log

* WARN  2015-10-13 14:45:25,591 Ignoring category combo, not valid:
[IdentifiableObject: id='14', uid='JKlMSbFzlum', code='null',
name='default', created='Mon Mar 17 11:25:58 WAT 2014', lastUpdated='Tue
Oct 13 14:34:48 WAT 2015', class='class
org.hisp.dhis.dataelement.DataElementCategoryCombo"']
(DefaultResourceTableService.java [taskScheduler-2])

I installed a fresh 2.20 version and created a sample data and the
analytics_2015 successfully generated.

I found out that the fresh 2.20 version has _categorystructure with 4
columns and the old one has 2 columns.

As at this moment the old version is not generating the analytics_20xx even
though it is successful the tables are empty.

Any idea pls...


Tools
* Postgresql
* Tomcat 7.0
* jdk 1.8.0_1xxx
* Firefox, Chrome
___
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 20699: Made uploaded file downloadable in data entry. Note that a file will be processed in the backgrou...

2015-10-14 Thread noreply

revno: 20699
committer: Halvdan Hoem Grelland 
branch nick: dhis2
timestamp: Wed 2015-10-14 13:46:39 +0200
message:
  Made uploaded file downloadable in data entry. Note that a file will be 
processed in the background after upload, which might take a long time 
depending on the file store, and the link could therefore return a 409 instead 
of the file. Future improvement: poll the api/fileResources/ endpoint for 
the StorageStatus and do not render link until it equals STORED.
modified:
  
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js
  
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
  
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css


--
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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js	2015-10-14 10:45:24 +
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.fileresource.js	2015-10-14 11:46:39 +
@@ -23,7 +23,7 @@
 
 var dataElementId = split.dataElementId;
 var optionComboId = split.optionComboId;
-var orgUnitid = dhis2.de.currentOrganisationUnitId;
+var orgUnitid = split.organisationUnitId;
 var periodId = $( '#selectedPeriodId' ).val();
 
 var formData = {
@@ -118,7 +118,14 @@
 var onFileDataValueSavedSuccess = function( fileResource ) {
 var name = fileResource.name, size = '(' + filesize( fileResource.contentLength ) + ')';
 
-$fileinfoName.text( name );
+//$fileinfoName.text( name );
+
+$('', {
+text: name,
+title: name,
+href: createDownloadLink()
+} ).appendTo( $fileinfoName );
+
 $fileinfoSize.text( size );
 $fileinfo.show();
 $progressBar.toggleClass( 'upload-progress-bar-complete' );
@@ -135,6 +142,10 @@
 $progressInfo.text( percent + '%' );
 };
 
+var createDownloadLink = function() {
+return "../api/dataValues/files?" + $.param( formData );
+};
+
 var disableField = function() {
 $button.button( 'disable' );
 $displayField.toggleClass( 'upload-field-disabled', true );

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2015-10-06 22:13:49 +
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2015-10-14 11:46:39 +
@@ -1679,6 +1679,15 @@
 {
 $( fieldId ).val( value.val );
 
+var split = dhis2.de.splitFieldId( value.id );
+
+var dvParams = {
+'de': split.dataElementId,
+'co': split.optionComboId,
+'ou': split.organisationUnitId,
+'pe': $( '#selectedPeriodId' ).val()
+};
+
 var $container = $( '.entryfileresource-container[name=' + value.id + '-val]' );
 
 var name = "", size = "";
@@ -1693,7 +1702,14 @@
 name = i18n_loading_file_info_failed;
 }
 
-$container.find( '.upload-fileinfo-name' ).text( name );
+var $filename = $container.find( '.upload-fileinfo-name' );
+
+$( '', {
+text: name,
+title: name,
+href: "../api/dataValues/files?" + $.param( dvParams )
+} ).appendTo( $filename );
+
 $container.find( '.upload-fileinfo-size' ).text( size );
 }
 else 

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css	2015-10-02 23:47:42 +
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css	2015-10-14 11:46:39 +
@@ -321,7 +321,7 @@
 {
 padding: 5px;
 position: absolute;
-max-width: 100%;
+max-width: 95%;
 z-index: 2;
 }
 

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

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20700: Removed unused JEP functions

2015-10-14 Thread noreply

revno: 20700
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-10-14 15:33:26 +0200
message:
  Removed unused JEP functions
removed:
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/OneIfZeroOrPositiveFunction.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/UnaryDoubleFunction.java
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/ZeroIfNegativeFunction.java
modified:
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java
  
dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/MathUtilsTest.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
=== removed directory 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math'
=== removed file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/OneIfZeroOrPositiveFunction.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/OneIfZeroOrPositiveFunction.java	2015-07-14 09:47:47 +
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/OneIfZeroOrPositiveFunction.java	1970-01-01 00:00:00 +
@@ -1,52 +0,0 @@
-package org.hisp.dhis.system.math;
-
-/*
- * Copyright (c) 2004-2015, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * JEP function which returns 1 if the argument is a zero or positive number, 0
- * otherwise.
- * 
- * @author Lars Helge Overland
- */
-public class OneIfZeroOrPositiveFunction
-extends UnaryDoubleFunction
-{
-public static final String NAME = "oizp";
-
-public OneIfZeroOrPositiveFunction()
-{
-super();
-}
-
-@Override
-public Double eval( double arg )
-{
-return ( arg >= 0d ) ? 1d : 0d;
-}
-}

=== removed file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/UnaryDoubleFunction.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/UnaryDoubleFunction.java	2015-09-14 18:06:48 +
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/UnaryDoubleFunction.java	1970-01-01 00:00:00 +
@@ -1,72 +0,0 @@
-package org.hisp.dhis.system.math;
-
-/*
- * Copyright (c) 2004-2015, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 20706: minor npe fix

2015-10-14 Thread noreply

revno: 20706
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2015-10-15 10:54:49 +0700
message:
  minor npe fix
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.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/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2015-10-07 07:06:47 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2015-10-15 03:54:49 +
@@ -440,7 +440,7 @@
 @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
 public boolean isRegistration()
 {
-return programType.equals( ProgramType.WITH_REGISTRATION );
+return programType == ProgramType.WITH_REGISTRATION;
 }
 
 @JsonProperty
@@ -448,7 +448,7 @@
 @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
 public boolean isWithoutRegistration()
 {
-return programType.equals( ProgramType.WITHOUT_REGISTRATION );
+return programType == ProgramType.WITHOUT_REGISTRATION;
 }
 
 @JsonProperty

___
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 20707: Minor fix

2015-10-14 Thread noreply

revno: 20707
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2015-10-15 11:08:12 +0700
message:
  Minor fix
modified:
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm	2015-10-12 02:52:01 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm	2015-10-15 04:08:12 +
@@ -91,9 +91,13 @@
 		
 			$i18n.getString( "type" ) 
 			
-
-	$i18n.getString('with_registration')
-	$i18n.getString('without_registration')
+
+	#if($program.programType=="WITH_REGISTRATION")
+		$i18n.getString('with_registration')
+	#else
+		$i18n.getString('with_registration')
+		$i18n.getString('without_registration')
+	#end
 
 			
 			

___
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 20708: minor bugfix, incident date label setter was incorrectly named setIncidentDateDescription

2015-10-14 Thread noreply

revno: 20708
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Thu 2015-10-15 11:13:01 +0700
message:
  minor bugfix, incident date label setter was incorrectly named 
setIncidentDateDescription
modified:
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java	2015-10-01 18:17:35 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java	2015-10-15 04:13:01 +
@@ -119,7 +119,7 @@
 
 private String incidentDateLabel;
 
-public void setIncidentDateDescription( String incidentDateLabel )
+public void setIncidentDateLabel( String incidentDateLabel )
 {
 this.incidentDateLabel = incidentDateLabel;
 }

___
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] XML Import of Org Unit Attribute

2015-10-14 Thread Laura E. Lincks
Version: 2.20
Build: 19958

I need to update existing Org Units with a new, non-existing Org Unit
attribute *values* using XML meta-data import.

I'm trying to create the simplest XML to do this, excluding tags which have
no bearing on the update. I just need to add an attribute value to each Org
Unit.

*I've noticed the following:*
I must include *openingDate*, *name* and *shortName* even though I am not
affecting any of those properties (these did not appear to be mandatory in
2.18)
If I do not include *created* a new *created* date is generated
If I do not include *(u)id* a new (u)*id* is generated (tag is "id", column
name is "uid")

I would think that generating new *uid *and *created* values could cause
problems with data integrity. Is this intentional? Are Org Unit records
being deleted and recreated when running an XML import as it appears to? I
would assume that if I don't include those tags it would retain whatever
values already exist for each record.

It seems that in order to ONLY add a non-existing attribute to each Org
Unit (and not alter the *uid* or *created*  values) I must include the
following tags in my XML file:

*For organisationUnit:*
id
created
name
shortName
openingDate

*For Org Unit Attribute:*
code
name
id
value
externalAccess (maybe??)

Can someone confirm or comment on my findings and questions?
Thanks.

*Laura E. Lincks*
Database Manager/Developer
ICAP - Columbia University
Mailman School of Public Health
60 Haven Ave, Floor B1
New York, NY 10032
Tel: 212 304 7132
___
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] XML Import of Org Unit Attribute

2015-10-14 Thread Morten Olav Hansen
Hi Laura

The simplest way to get to know what is required for a import is to go to
/api/schemas, in your case you should have a look at
/api/schemas/organisationUnit.

We do not support any kind of patching when it comes to multiple imports,
so you have to include the full object. If you are only updating one single
OU, we do support single/multiple value PATCHING, please see [1]

[1] https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s09.html#d5e789

--
Morten

On Thu, Oct 15, 2015 at 9:45 AM, Laura E. Lincks <
laura.lin...@icap.columbia.edu> wrote:

> Version: 2.20
> Build: 19958
>
> I need to update existing Org Units with a new, non-existing Org Unit
> attribute *values* using XML meta-data import.
>
> I'm trying to create the simplest XML to do this, excluding tags which
> have no bearing on the update. I just need to add an attribute value to
> each Org Unit.
>
> *I've noticed the following:*
> I must include *openingDate*, *name* and *shortName* even though I am not
> affecting any of those properties (these did not appear to be mandatory in
> 2.18)
> If I do not include *created* a new *created* date is generated
> If I do not include *(u)id* a new (u)*id* is generated (tag is "id",
> column name is "uid")
>
> I would think that generating new *uid *and *created* values could cause
> problems with data integrity. Is this intentional? Are Org Unit records
> being deleted and recreated when running an XML import as it appears to? I
> would assume that if I don't include those tags it would retain whatever
> values already exist for each record.
>
> It seems that in order to ONLY add a non-existing attribute to each Org
> Unit (and not alter the *uid* or *created*  values) I must include the
> following tags in my XML file:
>
> *For organisationUnit:*
> id
> created
> name
> shortName
> openingDate
>
> *For Org Unit Attribute:*
> code
> name
> id
> value
> externalAccess (maybe??)
>
> Can someone confirm or comment on my findings and questions?
> Thanks.
>
> *Laura E. Lincks*
> Database Manager/Developer
> ICAP - Columbia University
> Mailman School of Public Health
> 60 Haven Ave, Floor B1
> New York, NY 10032
> Tel: 212 304 7132
>
> ___
> 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
>
>
___
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 1506317] [NEW] 'paging=false' not being understood by event api

2015-10-14 Thread Graham Smith
Public bug reported:

Hello,

I am trying to turn off the automatic page limit default for viewing
events in the api (e.g. server/api/events). The default page limit is
set to 50 but I am unable to turn off with the following syntax:
server/api/events?paging=off. That syntax will still only return 50
results.

Interestingly, I am able to go from page to page (e.g.
server/api/events?page=2), but I am unable to turn paging off
completely.

For reference, I am on a v2.20 version with build 19914. I am also using
an updated version of Chrome.

Please let me know if this is a bug or if there is something I can do to
address.

Thank you,

Graham Smith

Population Services International

** Affects: dhis2
 Importance: Undecided
 Status: New

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

Title:
  'paging=false' not being understood by event api

Status in DHIS:
  New

Bug description:
  Hello,

  I am trying to turn off the automatic page limit default for viewing
  events in the api (e.g. server/api/events). The default page limit is
  set to 50 but I am unable to turn off with the following syntax:
  server/api/events?paging=off. That syntax will still only return 50
  results.

  Interestingly, I am able to go from page to page (e.g.
  server/api/events?page=2), but I am unable to turn paging off
  completely.

  For reference, I am on a v2.20 version with build 19914. I am also
  using an updated version of Chrome.

  Please let me know if this is a bug or if there is something I can do
  to address.

  Thank you,

  Graham Smith

  Population Services International

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1506317/+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


Re: [Dhis2-devs] [Bug 1506317] [NEW] 'paging=false' not being understood by event api

2015-10-14 Thread Morten Olav Hansen
Hi

For events API, you must use skipPaging=true

--
Morten

On Thu, Oct 15, 2015 at 12:17 PM, Graham Smith  wrote:

> Public bug reported:
>
> Hello,
>
> I am trying to turn off the automatic page limit default for viewing
> events in the api (e.g. server/api/events). The default page limit is
> set to 50 but I am unable to turn off with the following syntax:
> server/api/events?paging=off. That syntax will still only return 50
> results.
>
> Interestingly, I am able to go from page to page (e.g.
> server/api/events?page=2), but I am unable to turn paging off
> completely.
>
> For reference, I am on a v2.20 version with build 19914. I am also using
> an updated version of Chrome.
>
> Please let me know if this is a bug or if there is something I can do to
> address.
>
> Thank you,
>
> Graham Smith
>
> Population Services International
>
> ** Affects: dhis2
>  Importance: Undecided
>  Status: New
>
> --
> You received this bug notification because you are subscribed to DHIS.
> https://bugs.launchpad.net/bugs/1506317
>
> Title:
>   'paging=false' not being understood by event api
>
> Status in DHIS:
>   New
>
> Bug description:
>   Hello,
>
>   I am trying to turn off the automatic page limit default for viewing
>   events in the api (e.g. server/api/events). The default page limit is
>   set to 50 but I am unable to turn off with the following syntax:
>   server/api/events?paging=off. That syntax will still only return 50
>   results.
>
>   Interestingly, I am able to go from page to page (e.g.
>   server/api/events?page=2), but I am unable to turn paging off
>   completely.
>
>   For reference, I am on a v2.20 version with build 19914. I am also
>   using an updated version of Chrome.
>
>   Please let me know if this is a bug or if there is something I can do
>   to address.
>
>   Thank you,
>
>   Graham Smith
>
>   Population Services International
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dhis2/+bug/1506317/+subscriptions
>

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

Title:
  'paging=false' not being understood by event api

Status in DHIS:
  New

Bug description:
  Hello,

  I am trying to turn off the automatic page limit default for viewing
  events in the api (e.g. server/api/events). The default page limit is
  set to 50 but I am unable to turn off with the following syntax:
  server/api/events?paging=off. That syntax will still only return 50
  results.

  Interestingly, I am able to go from page to page (e.g.
  server/api/events?page=2), but I am unable to turn paging off
  completely.

  For reference, I am on a v2.20 version with build 19914. I am also
  using an updated version of Chrome.

  Please let me know if this is a bug or if there is something I can do
  to address.

  Thank you,

  Graham Smith

  Population Services International

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1506317/+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