Re: [Dhis2-devs] logging (for server administrators)

2015-06-09 Thread Lars Helge Øverland
On Tue, Jun 9, 2015 at 11:19 AM, Bob Jolliffe bobjolli...@gmail.com wrote:

 I just tried - you can't override those settings with an external
 file.  They will always kick in after the configuration is loaded.
 Which is very inflexible.  For example even the logging level is
 fixed.

 I think its worth reconsidering.



In order to override log4j default initialization you can set the
log4j.configuration system property to point to another resource (e.g. in
your dhis2-tools scripts).

This applies whether the default config is set in Java or through a config
file.

See the docs here http://logging.apache.org/log4j/1.2/manual.html, scroll
to Default Initialization Procedure.

Lars
___
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] logging (for server administrators)

2015-06-09 Thread Bob Jolliffe
Yes that is what I just tested.  It loads the log4 configuration file.
But this doesn't prevent the java code from running so it configures
twice.

On 9 June 2015 at 10:38, Lars Helge Øverland larshe...@gmail.com wrote:


 On Tue, Jun 9, 2015 at 11:19 AM, Bob Jolliffe bobjolli...@gmail.com wrote:

 I just tried - you can't override those settings with an external
 file.  They will always kick in after the configuration is loaded.
 Which is very inflexible.  For example even the logging level is
 fixed.

 I think its worth reconsidering.



 In order to override log4j default initialization you can set the
 log4j.configuration system property to point to another resource (e.g. in
 your dhis2-tools scripts).

 This applies whether the default config is set in Java or through a config
 file.

 See the docs here, scroll to Default Initialization Procedure.

 Lars




___
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] logging (for server administrators)

2015-06-09 Thread Bob Jolliffe
I just tried - you can't override those settings with an external
file.  They will always kick in after the configuration is loaded.
Which is very inflexible.  For example even the logging level is
fixed.

I think its worth reconsidering.

On 9 June 2015 at 09:00, Bob Jolliffe bobjolli...@gmail.com wrote:
 Hi Lars

 On 9 June 2015 at 07:37, Lars Helge Øverland larshe...@gmail.com wrote:
 Hi Bob,

 thanks for the feedback.

 Yes the main reason for having a java based default config is to be able to
 set the log file path to the dhis home directory. Yes the env var support in
 log4j 2 is cool but it is not sufficient in our use case since dhis config
 loading is more complex - it looks for 1) a system property dhis2.home, 2)
 an env variable DHIS2_HOME and 3) eventually falls back to using
 user-home-dir/opt/dhis2. I know DHIS 2 Live uses 2) and I know many
 deployments which use 3). So there is no guarantee that DHIS2_HOME is set,
 hence it is not a reliable solution.

 I suspect both these use cases are not as valid as they once were.
 dhis2-live provides its own log4j.properties file anyway so wouldn't
 be an issue.  And (3) which uses /opt/dhis2 is a hangover from a bad
 idea of mine for packaging a deb.  I am not sure i would recommend it
 at all  - but would rather just simplify the code in dhis2 back to the
 env variable.   Anyway, see below ...

 Re XML vs config files - config files are more flexible in general but in
 this scenario it makes no difference. In any case you don't want to modify
 or remove config files which are bundled inside the WAR file since those
 changes will be wiped next time the WAR is upgraded, but rather append /
 override it with an external file. You can have your external file override
 the default DHIS 2 config, irrespective of that default config being set in
 Java or from a config file.

 That is the important point.  I assumed that if you were configuring
 in java that you would not be able to override those settings with an
 external config file (I wasn't planning to fiddle with the internal
 one).  Has anyone tried this?  If it is indeed the case that it can be
 overridden then of course it makes no difference at all what the java
 code does or doesn't do which is fine.  Except of course having all
 this in code does make moving (eg to log4j 2) a bit more difficult.

___
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 1170247] Re: dhis2 2.11 version dataset report not working properly

2015-06-09 Thread Wilfred Senyoni
Hello Kija
You need to run data mart for the data to be aggregated and displayed in
the dataset report.
I would suggest you migrate to the latest dhis version 2.19 for better
analysis tools.

Cheers

Wilfred F. Senyoni
Computer Science and Engineering Department
College of Information and Communication Technologies
University of Dar es salaam

On Mon, Jun 8, 2015 at 4:04 PM, Kija Nyalali kijanyal...@gmail.com wrote:

 Dear All,

 I have created data entry forms in DHIS2, after entering the data
 values, the generated dataset report is coming but the data value is not
 coming in data element filed in that form.

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

 Title:
   dhis2 2.11 version dataset report not working properly

 Status in DHIS 2:
   New

 Bug description:
   Dear All,

   In dhis2 version 2.11 service-reportdataset report . when we
   generated dataset report the designed  form is coming but the data
   value is not coming in data element filed in that form.

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

___
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 1170247] Re: dhis2 2.11 version dataset report not working properly

2015-06-09 Thread Wilfred Senyoni
Hello Kija
sorry you should run the analytic as it was already implemented in the 2.11
version. I guess better to run with the latest version.

Wilfred F. Senyoni
Computer Science and Engineering Department
College of Information and Communication Technologies
University of Dar es salaam

On Tue, Jun 9, 2015 at 11:38 AM, Wilfred Senyoni seny...@gmail.com wrote:

 Hello Kija
 You need to run data mart for the data to be aggregated and displayed in
 the dataset report.
 I would suggest you migrate to the latest dhis version 2.19 for better
 analysis tools.

 Cheers

 Wilfred F. Senyoni
 Computer Science and Engineering Department
 College of Information and Communication Technologies
 University of Dar es salaam

 On Mon, Jun 8, 2015 at 4:04 PM, Kija Nyalali kijanyal...@gmail.com
 wrote:

 Dear All,

 I have created data entry forms in DHIS2, after entering the data
 values, the generated dataset report is coming but the data value is not
 coming in data element filed in that form.

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

 Title:
   dhis2 2.11 version dataset report not working properly

 Status in DHIS 2:
   New

 Bug description:
   Dear All,

   In dhis2 version 2.11 service-reportdataset report . when we
   generated dataset report the designed  form is coming but the data
   value is not coming in data element filed in that form.

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



___
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] How to determine if a dataset has any data values in it

2015-06-09 Thread Lars Helge Øverland
Hi Lorill,

I think you have found the best approach to the problem.

I have added support in trunk now for a limit query parameter that puts a
limit on the number of records to return. So you can now append limit=1
to your query and check if any records are returned.

I have updated the docs here
https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s10.html#d5e1798.

Will see if this can be backported to 2.19 later.

regards,

Lars












On Mon, Jun 8, 2015 at 11:30 PM, Lorill Crees lcr...@2paths.com wrote:

 Hi,

 I am trying to craft a web api call to determine if a dataset has at least
 one data value in it or not. I am not interested in the data values
 themselves, just if any data has been uploaded / inputted into the system
 yet or not.

 If data values did exist, I would not know what org units or periods were
 chosen so would not be able to supply those parameters.

 I would also prefer to do this in one api call instead of having to
 iterate through data elements until finding data (if any).

 I've been digging around the api and the best I can find right now in one
 call is this:

 dhis/api/dataValueSets?dataSet=QnhNNSNFE0MstartDate=1980-01-01endDate=2020-01-01orgUnit=
 lZsCb6y0KDXchildren=true

 where I set the start date to a far past, the end date to the future, and
 the org unit to the level 1 parent org unit.

 This could potentially return a very large number of records which is a
 heavy overhead when only wanting to know if dataValues  0.

 I also tried this:

 dhis/api/dataValueSets?dataSet=QnhNNSNFE0MstartDate=1980-01-01endDate=2020-01-01orgUnit=
 lZsCb6y0KDXchildren=truefields=dataValues:: isNotEmpty

 but the ::isNotEmpty does not seem to be in place for this call. I also
 could not seem to return paged data to reduce the payload.

 Do you have any other suggestions of how I can do this? To give context, I
 will be iterating through all Datasets in the system and displaying them in
 a list, so I need something that is fairly efficient. I wouldn't want to
 have to iterate through each data element individually unless necessary.

 Thanks,

 Lorill


 ___
 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 http://www.dhis2.org/
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org https://www.dhis2.org
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] logging (for server administrators)

2015-06-09 Thread Bob Jolliffe
Hi Lars

On 9 June 2015 at 07:37, Lars Helge Øverland larshe...@gmail.com wrote:
 Hi Bob,

 thanks for the feedback.

 Yes the main reason for having a java based default config is to be able to
 set the log file path to the dhis home directory. Yes the env var support in
 log4j 2 is cool but it is not sufficient in our use case since dhis config
 loading is more complex - it looks for 1) a system property dhis2.home, 2)
 an env variable DHIS2_HOME and 3) eventually falls back to using
 user-home-dir/opt/dhis2. I know DHIS 2 Live uses 2) and I know many
 deployments which use 3). So there is no guarantee that DHIS2_HOME is set,
 hence it is not a reliable solution.

I suspect both these use cases are not as valid as they once were.
dhis2-live provides its own log4j.properties file anyway so wouldn't
be an issue.  And (3) which uses /opt/dhis2 is a hangover from a bad
idea of mine for packaging a deb.  I am not sure i would recommend it
at all  - but would rather just simplify the code in dhis2 back to the
env variable.   Anyway, see below ...

 Re XML vs config files - config files are more flexible in general but in
 this scenario it makes no difference. In any case you don't want to modify
 or remove config files which are bundled inside the WAR file since those
 changes will be wiped next time the WAR is upgraded, but rather append /
 override it with an external file. You can have your external file override
 the default DHIS 2 config, irrespective of that default config being set in
 Java or from a config file.

That is the important point.  I assumed that if you were configuring
in java that you would not be able to override those settings with an
external config file (I wasn't planning to fiddle with the internal
one).  Has anyone tried this?  If it is indeed the case that it can be
overridden then of course it makes no difference at all what the java
code does or doesn't do which is fine.  Except of course having all
this in code does make moving (eg to log4j 2) a bit more difficult.

___
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 19314: Data value sets resource. Supporting limit and lastUpdated query parameters

2015-06-09 Thread noreply

revno: 19314
committer: Lars Helge Overland larshe...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 10:37:13 +0200
message:
  Data value sets resource. Supporting limit and lastUpdated query parameters
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataExportParams.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/SpringDataValueSetStore.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueSetController.java
  
dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ExportDataValueAction.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataExportParams.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataExportParams.java	2015-06-01 22:46:00 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataExportParams.java	2015-06-09 08:37:13 +
@@ -28,6 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Date;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -51,6 +52,10 @@
 
 private boolean includeChildren;
 
+private Date lastUpdated;
+
+private Integer limit;
+
 private IdSchemes idSchemes;
 
 // -
@@ -80,6 +85,16 @@
 return organisationUnits != null  !organisationUnits.isEmpty() ? organisationUnits.iterator().next() : null;
 }
 
+public boolean hasLastUpdated()
+{
+return lastUpdated != null;
+}
+
+public boolean hasLimit()
+{
+return limit != null;
+}
+
 /**
  * Indicates whether this parameters represents a single data value set, implying
  * that it contains exactly one of data sets, periods and organisation units.
@@ -144,6 +159,26 @@
 this.includeChildren = includeChildren;
 }
 
+public Date getLastUpdated()
+{
+return lastUpdated;
+}
+
+public void setLastUpdated( Date lastUpdated )
+{
+this.lastUpdated = lastUpdated;
+}
+
+public Integer getLimit()
+{
+return limit;
+}
+
+public void setLimit( Integer limit )
+{
+this.limit = limit;
+}
+
 public IdSchemes getIdSchemes()
 {
 return idSchemes;

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetService.java	2015-06-01 23:12:38 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetService.java	2015-06-09 08:37:13 +
@@ -49,7 +49,7 @@
 public interface DataValueSetService
 {
 DataExportParams getFromUrl( SetString dataSets, SetString periods, Date startDate, Date endDate, 
-SetString organisationUnits, boolean includeChildren, IdSchemes idSchemes );
+SetString organisationUnits, boolean includeChildren, Date lastUpdated, Integer limit, IdSchemes idSchemes );
 
 void validate( DataExportParams params );
 

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2015-06-01 23:45:15 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2015-06-09 08:37:13 +
@@ -159,7 +159,7 @@
 
 @Override
 public DataExportParams getFromUrl( SetString dataSets, SetString periods, Date startDate, Date endDate, 
-SetString organisationUnits, boolean includeChildren, IdSchemes idSchemes )
+SetString organisationUnits, boolean includeChildren, Date lastUpdated, Integer limit, IdSchemes idSchemes )
 {
 DataExportParams params = new DataExportParams();
 
@@ -190,6 +190,8 @@
 }
 
 params.setIncludeChildren( includeChildren );
+params.setLastUpdated( lastUpdated );
+params.setLimit( limit );
 params.setIdSchemes( idSchemes );
 
 return params;
@@ -228,6 

Re: [Dhis2-devs] how to change start month in Q1

2015-06-09 Thread channara rin
Yes i use HTML report,
but if i didn't choose any relative report. and choose only reporting
period. It shows me only yearly choice.
___
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 19315: Log4j config init, aborting if system prop log4j.configuration is set

2015-06-09 Thread noreply

revno: 19315
committer: Lars Helge Overland larshe...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 13:09:22 +0200
message:
  Log4j config init, aborting if system prop log4j.configuration is set
modified:
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/log/Log4JLogConfigInitializer.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-support/dhis-support-system/src/main/java/org/hisp/dhis/system/log/Log4JLogConfigInitializer.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/log/Log4JLogConfigInitializer.java	2015-05-30 15:19:36 +
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/log/Log4JLogConfigInitializer.java	2015-06-09 11:09:22 +
@@ -28,10 +28,11 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
+
 import java.io.File;
 import java.util.List;
 
-import com.google.common.collect.Lists;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.log4j.Level;
@@ -41,6 +42,8 @@
 import org.hisp.dhis.external.location.LocationManager;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import com.google.common.collect.Lists;
+
 /**
  * @author Lars Helge Overland
  */
@@ -56,6 +59,7 @@
 private static final String DATA_EXCHANGE_LOGGER_FILENAME = dhis-data-exchange.log;
 private static final String DATA_SYNC_LOGGER_FILENAME = dhis-data-sync.log;
 private static final String GENERAL_LOGGER_FILENAME = dhis.log;
+private static final String LOG4J_CONF_PROP = log4j.configuration;
 
 private static final Log log = LogFactory.getLog( Log4JLogConfigInitializer.class );
 
@@ -71,6 +75,12 @@
 return;
 }
 
+if ( isNotBlank( System.getProperty( LOG4J_CONF_PROP ) ) )
+{
+log.info( Aborting default log config, external config set through system prop  + LOG4J_CONF_PROP + :  + System.getProperty( LOG4J_CONF_PROP ) );
+return;
+}
+
 locationManager.buildDirectory( LOG_DIR );
 
 configureLoggers( ANALYTICS_TABLE_LOGGER_FILENAME, Lists.newArrayList( org.hisp.dhis.resourcetable, org.hisp.dhis.analytics.table ) );
@@ -81,7 +91,7 @@
 
 configureRootLogger( GENERAL_LOGGER_FILENAME );
 }
-
+
 /**
  * Configures rolling file loggers.
  * 

___
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] logging (for server administrators)

2015-06-09 Thread Lars Helge Øverland
Okay that's weird. If so I can look for log4j.configuration  i the java
config loader and exit if that system prop is present?

On Tue, Jun 9, 2015 at 11:48 AM, Bob Jolliffe bobjolli...@gmail.com wrote:

 Yes that is what I just tested.  It loads the log4 configuration file.
 But this doesn't prevent the java code from running so it configures
 twice.

 On 9 June 2015 at 10:38, Lars Helge Øverland larshe...@gmail.com wrote:
 
 
  On Tue, Jun 9, 2015 at 11:19 AM, Bob Jolliffe bobjolli...@gmail.com
 wrote:
 
  I just tried - you can't override those settings with an external
  file.  They will always kick in after the configuration is loaded.
  Which is very inflexible.  For example even the logging level is
  fixed.
 
  I think its worth reconsidering.
 
 
 
  In order to override log4j default initialization you can set the
  log4j.configuration system property to point to another resource (e.g. in
  your dhis2-tools scripts).
 
  This applies whether the default config is set in Java or through a
 config
  file.
 
  See the docs here, scroll to Default Initialization Procedure.
 
  Lars
 
 
 




-- 
Lars Helge Øverland
Lead developer, DHIS 2 http://www.dhis2.org/
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org https://www.dhis2.org
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] How to determine if a dataset has any data values in it

2015-06-09 Thread Lars Helge Øverland
This has been backported to 2.19 now.

On Tue, Jun 9, 2015 at 11:07 AM, Lars Helge Øverland larshe...@gmail.com
wrote:

 Hi Lorill,

 I think you have found the best approach to the problem.

 I have added support in trunk now for a limit query parameter that puts
 a limit on the number of records to return. So you can now append
 limit=1 to your query and check if any records are returned.

 I have updated the docs here
 https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s10.html#d5e1798
 .

 Will see if this can be backported to 2.19 later.

 regards,

 Lars












 On Mon, Jun 8, 2015 at 11:30 PM, Lorill Crees lcr...@2paths.com wrote:

 Hi,

 I am trying to craft a web api call to determine if a dataset has at
 least one data value in it or not. I am not interested in the data values
 themselves, just if any data has been uploaded / inputted into the system
 yet or not.

 If data values did exist, I would not know what org units or periods were
 chosen so would not be able to supply those parameters.

 I would also prefer to do this in one api call instead of having to
 iterate through data elements until finding data (if any).

 I've been digging around the api and the best I can find right now in one
 call is this:

 dhis/api/dataValueSets?dataSet=QnhNNSNFE0MstartDate=1980-01-01endDate=2020-01-01orgUnit=
 lZsCb6y0KDXchildren=true

 where I set the start date to a far past, the end date to the future, and
 the org unit to the level 1 parent org unit.

 This could potentially return a very large number of records which is a
 heavy overhead when only wanting to know if dataValues  0.

 I also tried this:

 dhis/api/dataValueSets?dataSet=QnhNNSNFE0MstartDate=1980-01-01endDate=2020-01-01orgUnit=
 lZsCb6y0KDXchildren=truefields=dataValues:: isNotEmpty

 but the ::isNotEmpty does not seem to be in place for this call. I also
 could not seem to return paged data to reduce the payload.

 Do you have any other suggestions of how I can do this? To give context,
 I will be iterating through all Datasets in the system and displaying them
 in a list, so I need something that is fairly efficient. I wouldn't want to
 have to iterate through each data element individually unless necessary.

 Thanks,

 Lorill


 ___
 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 http://www.dhis2.org/
 University of Oslo
 Skype: larshelgeoverland
 http://www.dhis2.org https://www.dhis2.org




-- 
Lars Helge Øverland
Lead developer, DHIS 2 http://www.dhis2.org/
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org https://www.dhis2.org
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19316: Css

2015-06-09 Thread noreply

revno: 19316
committer: Lars Helge Overland larshe...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 13:53:07 +0200
message:
  Css
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/myanmar/myanmar.css
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.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-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css	2015-06-01 19:58:15 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css	2015-06-09 11:53:07 +
@@ -210,7 +210,7 @@
   background-color: #f3f3f3;
   width: 235px;
   position: fixed;
-  top: 45px;
+  top: 44px;
   left: 0;
   padding-top: 7px;
   border-right: 1px solid #e1e1e1;

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css	2015-06-01 19:58:15 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css	2015-06-09 11:53:07 +
@@ -210,7 +210,7 @@
   background-color: #f7f7f7;
   width: 235px;
   position: fixed;
-  top: 45px;
+  top: 44px;
   left: 0px;
   padding-top: 7px;
   border-right: 1px solid #e1e1e1;

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css	2015-06-01 19:58:15 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css	2015-06-09 11:53:07 +
@@ -210,7 +210,7 @@
   background-color: #f3f3f3;
   width: 235px;
   position: fixed;
-  top: 45px;
+  top: 44px;
   left: 0;
   padding-top: 7px;
   border-right: 1px solid #e1e1e1;

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/myanmar/myanmar.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/myanmar/myanmar.css	2015-06-01 19:58:15 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/myanmar/myanmar.css	2015-06-09 11:53:07 +
@@ -210,7 +210,7 @@
   background-color: #f7f7f7;
   width: 235px;
   position: fixed;
-  top: 45px;
+  top: 44px;
   left: 0;
   padding-top: 7px;
   border-right: 1px solid #ddd;

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css	2015-06-01 19:58:15 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css	2015-06-09 11:53:07 +
@@ -210,7 +210,7 @@
   background-color: #f7f7f7;
   width: 235px;
   position: fixed;
-  top: 45px;
+  top: 44px;
   left: 0px;
   padding-top: 7px;
   border-right: 1px solid #e1e1e1;

___
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] how to change start month in Q1

2015-06-09 Thread Lars Helge Øverland
Hi Channara,

did you create a report of type HTML report? If so, you can select
reporting period as report parameter.

If you based the report on a report table, then in pivot table you can go
to options  parameters and select reporting period as parameter.

[image: Inline image 1]


regards,

Lars



On Tue, Jun 9, 2015 at 6:25 AM, channara rin rin.chann...@gmail.com wrote:

 Hi all DHIS2,
 i created standard report, but my problem is if i choose Quarterly, it
 always start Q1 in month:janurary-March. So how can i change to start in
 month: Oct, so the Q1 mean start from Oct-Dec.

 thank you

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




-- 
Lars Helge Øverland
Lead developer, DHIS 2 http://www.dhis2.org/
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org https://www.dhis2.org
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] logging (for server administrators)

2015-06-09 Thread Lars Helge Øverland
Hi Bob,

thanks for the feedback.

Yes the main reason for having a java based default config is to be able to
set the log file path to the dhis home directory. Yes the env var support
in log4j 2 is cool but it is not sufficient in our use case since dhis
config loading is more complex - it looks for 1) a system property
dhis2.home, 2) an env variable DHIS2_HOME and 3) eventually falls back to
using user-home-dir/opt/dhis2. I know DHIS 2 Live uses 2) and I know many
deployments which use 3). So there is no guarantee that DHIS2_HOME is set,
hence it is not a reliable solution.

Re XML vs config files - config files are more flexible in general but in
this scenario it makes no difference. In any case you don't want to modify
or remove config files which are bundled inside the WAR file since those
changes will be wiped next time the WAR is upgraded, but rather append /
override it with an external file. You can have your external file override
the default DHIS 2 config, irrespective of that default config being set in
Java or from a config file.

regards,

Lars
___
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] logging (for server administrators)

2015-06-09 Thread Lars Helge Øverland
On Tue, Jun 9, 2015 at 11:48 AM, Bob Jolliffe bobjolli...@gmail.com wrote:

 Yes that is what I just tested.  It loads the log4 configuration file.
 But this doesn't prevent the java code from running so it configures
 twice.


For the record I did a small fix to abort the default log config when an
external config file is configured based on Bob's feedback. Updated docs
here https://www.dhis2.org/doc/snapshot/en/implementer/html/ch08s07.html.
___
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 19322: Removed unused methods in GmlImportService. Refactored tests to use new scheme

2015-06-09 Thread noreply

revno: 19322
committer: Halvdan Hoem Grelland halvda...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 16:24:56 +0200
message:
  Removed unused methods in GmlImportService. Refactored tests to use new scheme
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/DefaultGmlImportService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/GmlImportService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/GmlPreProcessingResult.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/gml/GmlImportServiceTest.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/DefaultGmlImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/DefaultGmlImportService.java	2015-06-08 10:05:46 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/DefaultGmlImportService.java	2015-06-09 14:24:56 +
@@ -151,80 +151,6 @@
 return GmlPreProcessingResult.success( metaData );
 }
 
-// TODO Remove this (and refactor unit test to use preProcessGml)
-@Override
-public MetaData fromGml( InputStream inputStream )
-throws IOException, TransformerException
-{
-InputStream dxfStream;
-MetaData metaData;
-
-try
-{
-dxfStream = transformGml( inputStream );
-}
-catch (Exception e)
-{
-dxfStream = null;
-}
-
-if(dxfStream != null)
-{
-metaData = renderService.fromXml( dxfStream, MetaData.class );
-dxfStream.close();
-}
-else
-{
-return null;
-}
-
-MapString, OrganisationUnit uidMap  = Maps.newHashMap(), codeMap = Maps.newHashMap(), nameMap = Maps.newHashMap();
-
-matchAndFilterOnIdentifiers( metaData.getOrganisationUnits(), uidMap, codeMap, nameMap );
-
-MapString, OrganisationUnit persistedUidMap  = getMatchingPersistedOrgUnits( uidMap.keySet(),  IdentifiableProperty.UID );
-MapString, OrganisationUnit persistedCodeMap = getMatchingPersistedOrgUnits( codeMap.keySet(), IdentifiableProperty.CODE );
-MapString, OrganisationUnit persistedNameMap = getMatchingPersistedOrgUnits( nameMap.keySet(), IdentifiableProperty.NAME );
-
-IteratorOrganisationUnit persistedIterator = Iterators.concat( persistedUidMap.values().iterator(),
-persistedCodeMap.values().iterator(), persistedNameMap.values().iterator() );
-
-while ( persistedIterator.hasNext() )
-{
-OrganisationUnit persisted = persistedIterator.next(), imported = null;
-
-if ( !Strings.isNullOrEmpty( persisted.getUid() )  uidMap.containsKey( persisted.getUid() ) )
-{
-imported = uidMap.get( persisted.getUid() );
-}
-else if ( !Strings.isNullOrEmpty( persisted.getCode() )  codeMap.containsKey( persisted.getCode() ) )
-{
-imported = codeMap.get( persisted.getCode() );
-}
-else if ( !Strings.isNullOrEmpty( persisted.getName() )  nameMap.containsKey( persisted.getName() ) )
-{
-imported = nameMap.get( persisted.getName() );
-}
-
-if ( imported == null || imported.getCoordinates() == null || imported.getFeatureType() == null )
-{
-continue; // Failed to dereference a persisted entity for this org unit or geo data incomplete/missing, therefore ignore
-}
-
-mergeNonGeoData( persisted, imported );
-}
-
-return metaData;
-}
-
-@Transactional
-@Override
-public void importGml( InputStream inputStream, String userUid, ImportOptions importOptions, TaskId taskId )
-throws IOException, TransformerException
-{
-importService.importMetaData( userUid, fromGml( inputStream ), importOptions, taskId );
-}
-
 @Transactional
 @Override
 public void importGml( MetaData metaData, String userUid, ImportOptions importOptions, TaskId taskId )

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/GmlImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/GmlImportService.java	2015-06-05 12:56:34 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/GmlImportService.java	2015-06-09 14:24:56 +
@@ -32,8 +32,6 @@
 import org.hisp.dhis.dxf2.metadata.MetaData;
 import 

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

2015-06-09 Thread noreply

revno: 19323
committer: Halvdan Hoem Grelland halvda...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 16:26:05 +0200
message:
  minor
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/gml/GmlImportServiceTest.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/gml/GmlImportServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/gml/GmlImportServiceTest.java	2015-06-09 14:24:56 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/gml/GmlImportServiceTest.java	2015-06-09 14:26:05 +
@@ -74,7 +74,7 @@
 // -
 
 @Test
-public void fromGmlTest()
+public void preProcessGmlTest()
 throws Exception
 {
 GmlPreProcessingResult result = gmlImportService.preProcessGml( inputStream );

___
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 19324: Improved error message output on failed gml import

2015-06-09 Thread noreply

revno: 19324
committer: Halvdan Hoem Grelland halvda...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 17:19:51 +0200
message:
  Improved error message output on failed gml import
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/DefaultGmlImportService.java
  
dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/DefaultGmlImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/DefaultGmlImportService.java	2015-06-09 14:24:56 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/DefaultGmlImportService.java	2015-06-09 15:19:51 +
@@ -151,7 +151,6 @@
 return GmlPreProcessingResult.success( metaData );
 }
 
-@Transactional
 @Override
 public void importGml( MetaData metaData, String userUid, ImportOptions importOptions, TaskId taskId )
 {

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java	2015-06-05 12:56:34 +
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java	2015-06-09 15:19:51 +
@@ -93,35 +93,45 @@
 
 GmlPreProcessingResult gmlPreProcessingResult = gmlImportService.preProcessGml( inputStream );
 
-if ( !gmlPreProcessingResult.isSuccess() )
+if ( gmlPreProcessingResult.isSuccess() )
+{
+gmlImportService.importGml( gmlPreProcessingResult.getResultMetaData(), userUid, importOptions, taskId );
+}
+else
 {
 Throwable throwable = gmlPreProcessingResult.getThrowable();
-String message = createErrorMessage( throwable );
-
-notifier.notify( taskId, NotificationLevel.ERROR, message, false );
-log.error( GML import failed:  + message, throwable );
-
-return;
+
+notifier.notify( taskId, NotificationLevel.ERROR, createNotifierErrorMessage( throwable ), false );
+log.error( GML import failed during pre-processing, throwable );
 }
-
-gmlImportService.importGml( gmlPreProcessingResult.getResultMetaData(), userUid, importOptions, taskId );
 }
 
-private String createErrorMessage( Throwable throwable )
+private String createNotifierErrorMessage( Throwable throwable )
 {
-String message = ;
+StringBuilder sb = new StringBuilder( GML import failed:  );
+
 Throwable rootThrowable = ExceptionUtils.getRootCause( throwable );
-
 if ( rootThrowable instanceof SAXParseException )
 {
 SAXParseException e = (SAXParseException) rootThrowable;
-message += Syntax error on line  + e.getLineNumber() + .  + e.getMessage();
+sb.append( e.getMessage() );
+
+if ( e.getLineNumber() = 0 )
+{
+sb.append(  On line  ).append( e.getLineNumber() );
+
+if ( e.getColumnNumber() = 0 )
+{
+sb.append(  column  ).append( e.getColumnNumber() );
+}
+}
+sb.append( . );
 }
 else
 {
-message += rootThrowable.getMessage();
+sb.append( rootThrowable.getMessage() );
 }
 
-return HtmlUtils.htmlEscape( message );
+return HtmlUtils.htmlEscape( sb.toString() );
 }
 }

___
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] How to determine if a dataset has any data values in it

2015-06-09 Thread Alan Hill
Hi Lars

I wonder if you also have any suggestions for checking if data has been
imported for Programs and ProgramStages.

For Programs, I have been doing the following:

/api/enrollments?program=programId

Get the orgUnit from the first enrollment

/api/trackedEntityInstances?ou=orgUnitprogram=programId

However, this has poor performance and a large number of records can be
returned.


For ProgramStages, I have been doing the following:

/api/events?programStage=programStageId

Again, poor performance and a large number of records can be returned.


One thing I need to display a listing page with all Programs/ProgramStages
and show whether there is data assigned.  A faster method of querying this
is essential.

Any suggestions for more performant queries would be greatly appreciated.

Many thanks

Alan

On Tue, Jun 9, 2015 at 3:18 AM, Lars Helge Øverland larshe...@gmail.com
wrote:

 This has been backported to 2.19 now.

 On Tue, Jun 9, 2015 at 11:07 AM, Lars Helge Øverland larshe...@gmail.com
 wrote:

 Hi Lorill,

 I think you have found the best approach to the problem.

 I have added support in trunk now for a limit query parameter that puts
 a limit on the number of records to return. So you can now append
 limit=1 to your query and check if any records are returned.

 I have updated the docs here
 https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s10.html#d5e1798
 .

 Will see if this can be backported to 2.19 later.

 regards,

 Lars












 On Mon, Jun 8, 2015 at 11:30 PM, Lorill Crees lcr...@2paths.com wrote:

 Hi,

 I am trying to craft a web api call to determine if a dataset has at
 least one data value in it or not. I am not interested in the data values
 themselves, just if any data has been uploaded / inputted into the system
 yet or not.

 If data values did exist, I would not know what org units or periods
 were chosen so would not be able to supply those parameters.

 I would also prefer to do this in one api call instead of having to
 iterate through data elements until finding data (if any).

 I've been digging around the api and the best I can find right now in
 one call is this:

 dhis/api/dataValueSets?dataSet=QnhNNSNFE0MstartDate=1980-01-01endDate=2020-01-01orgUnit=
 lZsCb6y0KDXchildren=true

 where I set the start date to a far past, the end date to the future,
 and the org unit to the level 1 parent org unit.

 This could potentially return a very large number of records which is a
 heavy overhead when only wanting to know if dataValues  0.

 I also tried this:

 dhis/api/dataValueSets?dataSet=QnhNNSNFE0MstartDate=1980-01-01endDate=2020-01-01orgUnit=
 lZsCb6y0KDXchildren=truefields=dataValues:: isNotEmpty

 but the ::isNotEmpty does not seem to be in place for this call. I
 also could not seem to return paged data to reduce the payload.

 Do you have any other suggestions of how I can do this? To give context,
 I will be iterating through all Datasets in the system and displaying them
 in a list, so I need something that is fairly efficient. I wouldn't want to
 have to iterate through each data element individually unless necessary.

 Thanks,

 Lorill


 ___
 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 http://www.dhis2.org/
 University of Oslo
 Skype: larshelgeoverland
 http://www.dhis2.org https://www.dhis2.org




 --
 Lars Helge Øverland
 Lead developer, DHIS 2 http://www.dhis2.org/
 University of Oslo
 Skype: larshelgeoverland
 http://www.dhis2.org https://www.dhis2.org


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


___
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 19325: minor: gml import

2015-06-09 Thread noreply

revno: 19325
committer: Halvdan Hoem Grelland halvda...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 17:57:08 +0200
message:
  minor: gml import
modified:
  
dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java
  
dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importMetaDataSummary.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-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java	2015-06-09 15:19:51 +
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/util/ImportMetaDataGmlTask.java	2015-06-09 15:57:08 +
@@ -31,6 +31,7 @@
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.xerces.impl.io.MalformedByteSequenceException;
 import org.hisp.dhis.dxf2.common.ImportOptions;
 import org.hisp.dhis.dxf2.gml.GmlImportService;
 import org.hisp.dhis.dxf2.gml.GmlPreProcessingResult;
@@ -111,6 +112,7 @@
 StringBuilder sb = new StringBuilder( GML import failed:  );
 
 Throwable rootThrowable = ExceptionUtils.getRootCause( throwable );
+
 if ( rootThrowable instanceof SAXParseException )
 {
 SAXParseException e = (SAXParseException) rootThrowable;
@@ -125,13 +127,21 @@
 sb.append(  column  ).append( e.getColumnNumber() );
 }
 }
-sb.append( . );
+}
+else if ( rootThrowable instanceof MalformedByteSequenceException )
+{
+sb.append( Malformed GML file. );
 }
 else
 {
 sb.append( rootThrowable.getMessage() );
 }
 
+if ( sb.charAt( sb.length() - 1 ) != '.' )
+{
+sb.append( '.' );
+}
+
 return HtmlUtils.htmlEscape( sb.toString() );
 }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importMetaDataSummary.vm'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importMetaDataSummary.vm	2015-06-05 12:56:34 +
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importMetaDataSummary.vm	2015-06-09 15:57:08 +
@@ -57,5 +57,5 @@
 p$i18n.getString( no_conflicts_found )/p
 #end
 #else
-$i18n.getString( no_summary_available )
+$i18n.getString( no_import_summary_available )
 #end
\ No newline at end of file

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


Re: [Dhis2-devs] How to determine if a dataset has any data values in it

2015-06-09 Thread Lorill Crees
Hi Lars,

Thanks for this. I've tried it out and it's working well in terms of
functionality, but the performance is very poor. Even if I'm limiting to
just one record, one api call is taking 5-7 seconds. When needing to
iterate over 17 datasets this means two minutes for my page load which
would not be acceptable.

Are there any performance improvements that can be made for this?

Let me know. Thanks,

Lorill

On Tue, Jun 9, 2015 at 3:18 AM, Lars Helge Øverland larshe...@gmail.com
wrote:

 This has been backported to 2.19 now.

 On Tue, Jun 9, 2015 at 11:07 AM, Lars Helge Øverland larshe...@gmail.com
 wrote:

 Hi Lorill,

 I think you have found the best approach to the problem.

 I have added support in trunk now for a limit query parameter that puts
 a limit on the number of records to return. So you can now append
 limit=1 to your query and check if any records are returned.

 I have updated the docs here
 https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s10.html#d5e1798
 .

 Will see if this can be backported to 2.19 later.

 regards,

 Lars












 On Mon, Jun 8, 2015 at 11:30 PM, Lorill Crees lcr...@2paths.com wrote:

 Hi,

 I am trying to craft a web api call to determine if a dataset has at
 least one data value in it or not. I am not interested in the data values
 themselves, just if any data has been uploaded / inputted into the system
 yet or not.

 If data values did exist, I would not know what org units or periods
 were chosen so would not be able to supply those parameters.

 I would also prefer to do this in one api call instead of having to
 iterate through data elements until finding data (if any).

 I've been digging around the api and the best I can find right now in
 one call is this:

 dhis/api/dataValueSets?dataSet=QnhNNSNFE0MstartDate=1980-01-01endDate=2020-01-01orgUnit=
 lZsCb6y0KDXchildren=true

 where I set the start date to a far past, the end date to the future,
 and the org unit to the level 1 parent org unit.

 This could potentially return a very large number of records which is a
 heavy overhead when only wanting to know if dataValues  0.

 I also tried this:

 dhis/api/dataValueSets?dataSet=QnhNNSNFE0MstartDate=1980-01-01endDate=2020-01-01orgUnit=
 lZsCb6y0KDXchildren=truefields=dataValues:: isNotEmpty

 but the ::isNotEmpty does not seem to be in place for this call. I
 also could not seem to return paged data to reduce the payload.

 Do you have any other suggestions of how I can do this? To give context,
 I will be iterating through all Datasets in the system and displaying them
 in a list, so I need something that is fairly efficient. I wouldn't want to
 have to iterate through each data element individually unless necessary.

 Thanks,

 Lorill


 ___
 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 http://www.dhis2.org/
 University of Oslo
 Skype: larshelgeoverland
 http://www.dhis2.org https://www.dhis2.org




 --
 Lars Helge Øverland
 Lead developer, DHIS 2 http://www.dhis2.org/
 University of Oslo
 Skype: larshelgeoverland
 http://www.dhis2.org https://www.dhis2.org


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


[Dhis2-devs] List of permission in DHIS2

2015-06-09 Thread Elmarie Claasen
Hi all,

 

Can anyone provide me with a complete list of available userrole authorities
which appears on the left side when you create a user role?

 

I don't see any table with that information in dhis2.

 

Much appreciated - thanks

 

Regards,

 

Elmarie Claasen

Hisp logo

Project Manager

Health Information Systems Program

Tel:  041-367 1027

Cell: 082 374 2209

E-mail:  mailto:elma...@hisp.org 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
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
mailto:disclai...@hisp.org 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


Re: [Dhis2-devs] [Dhis2-users] List of permission in DHIS2

2015-06-09 Thread Alex Tumwesigye
Dear Elmarie,

They are hard coded using spring security.
see an extract from the code.

action name=alluser class=org.hisp.dhis.user.action.GetUserListAction
  result name=success type=velocity/main.vm/result
  param name=page/dhis-web-maintenance-user/allUser.vm/param
  param name=menu/dhis-web-maintenance-user/menu.vm/param
  param 
name=javascriptsjavascript/user.js,javascript/filterTable.js/param
  param name=requiredAuthoritiesF_USER_VIEW/param
/action

action name=getUser class=org.hisp.dhis.user.action.GetUserAction
  result name=success
type=velocity-json/dhis-web-commons/ajax/jsonUser.vm/result
  param name=onExceptionReturnplainTextError/param
/action

action name=removeUser
class=org.hisp.dhis.user.action.RemoveUserAction
  result name=success
type=velocity-json/dhis-web-commons/ajax/jsonResponseSuccess.vm/result
  result name=logout
type=redirect/dhis-web-commons-security/logout.action/result
  result name=error
type=velocity-json/dhis-web-commons/ajax/jsonResponseError.vm/result
  param name=requiredAuthoritiesF_USER_DELETE/param
  param name=onExceptionReturnplainTextError/param
/action

action name=showAddUserForm
class=org.hisp.dhis.user.action.SetupTreeAction
  result name=success type=velocity/main.vm/result
  param name=page/dhis-web-maintenance-user/addUserForm.vm/param
  param 
name=javascripts../dhis-web-commons/oust/oust.js,../dhis-web-commons/ouwt/ouwt.js,javascript/user.js/param
  *param name=requiredAuthoritiesF_USER_ADD/param*
/action

action name=addUser class=org.hisp.dhis.user.action.AddUserAction
  result name=success
type=redirectuser.action?currentPage=${keyCurrentPage}amp;key=${keyCurrentKey}/result
  result name=error
type=velocity-json/dhis-web-commons/ajax/jsonResponseError.vm/result
  param name=javascriptsjavascript/user.js/param
  param name=requiredAuthoritiesF_USER_ADD/param
/action

Also follow these link.
http://bazaar.launchpad.net/~dhis2-devs-core/dhis2/2.19/view/head:/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties

Alex

On Tue, Jun 9, 2015 at 9:19 PM, Elmarie Claasen elma...@hisp.org wrote:

 Hi all,



 Can anyone provide me with a complete list of available userrole
 authorities which appears on the left side when you create a user role?



 I don’t see any table with that information in dhis2.



 Much appreciated - thanks



 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.



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




-- 
Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET
Kampala
Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT Specialist (Servers, Networks and Security, Health Information Systems -
DHIS2 )  Solar Consultant

+256 774149 775, + 256 759 800161

I don't want to be anything other than what I have been - one tree hill 
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Dhis2-users] List of permission in DHIS2

2015-06-09 Thread Dapo Adejumo
Hi Elmarie,

There is a table in postgres called userroleauthorities - contains your
available authorities.

 

...

Regards,

Dapo Adejumo

+2348033683677

Skype : dapojorge

 

From: Dhis2-users
[mailto:dhis2-users-bounces+dapsyjorge=gmail@lists.launchpad.net] On
Behalf Of Elmarie Claasen
Sent: 9 June, 2015 7:19 PM
To: dhis2-devs@lists.launchpad.net; dhis2-us...@lists.launchpad.net
Subject: [Dhis2-users] List of permission in DHIS2

 

Hi all,

 

Can anyone provide me with a complete list of available userrole authorities
which appears on the left side when you create a user role?

 

I don't see any table with that information in dhis2.

 

Much appreciated - thanks

 

Regards,

 

Elmarie Claasen



Project Manager

Health Information Systems Program

Tel:  041-367 1027

Cell: 082 374 2209

E-mail:  mailto:elma...@hisp.org 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
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
mailto:disclai...@hisp.org 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


Re: [Dhis2-devs] [Dhis2-users] List of permission in DHIS2

2015-06-09 Thread Alex Tumwesigye
Dapo,

You are right!!! the userrole table is referenced by that table.

Alex

On Tue, Jun 9, 2015 at 10:51 PM, Alex Tumwesigye atumwesi...@gmail.com
wrote:

 Dear Elmarie,

 They are hard coded using spring security.
 see an extract from the code.

 action name=alluser class=org.hisp.dhis.user.action.GetUserListAction
   result name=success type=velocity/main.vm/result
   param name=page/dhis-web-maintenance-user/allUser.vm/param
   param name=menu/dhis-web-maintenance-user/menu.vm/param
   param 
 name=javascriptsjavascript/user.js,javascript/filterTable.js/param
   param name=requiredAuthoritiesF_USER_VIEW/param
 /action

 action name=getUser class=org.hisp.dhis.user.action.GetUserAction
   result name=success 
 type=velocity-json/dhis-web-commons/ajax/jsonUser.vm/result
   param name=onExceptionReturnplainTextError/param
 /action

 action name=removeUser 
 class=org.hisp.dhis.user.action.RemoveUserAction
   result name=success 
 type=velocity-json/dhis-web-commons/ajax/jsonResponseSuccess.vm/result
   result name=logout 
 type=redirect/dhis-web-commons-security/logout.action/result
   result name=error 
 type=velocity-json/dhis-web-commons/ajax/jsonResponseError.vm/result
   param name=requiredAuthoritiesF_USER_DELETE/param
   param name=onExceptionReturnplainTextError/param
 /action

 action name=showAddUserForm 
 class=org.hisp.dhis.user.action.SetupTreeAction
   result name=success type=velocity/main.vm/result
   param name=page/dhis-web-maintenance-user/addUserForm.vm/param
   param 
 name=javascripts../dhis-web-commons/oust/oust.js,../dhis-web-commons/ouwt/ouwt.js,javascript/user.js/param
   *param name=requiredAuthoritiesF_USER_ADD/param*
 /action

 action name=addUser class=org.hisp.dhis.user.action.AddUserAction
   result name=success 
 type=redirectuser.action?currentPage=${keyCurrentPage}amp;key=${keyCurrentKey}/result
   result name=error 
 type=velocity-json/dhis-web-commons/ajax/jsonResponseError.vm/result
   param name=javascriptsjavascript/user.js/param
   param name=requiredAuthoritiesF_USER_ADD/param
 /action

 Also follow these link.

 http://bazaar.launchpad.net/~dhis2-devs-core/dhis2/2.19/view/head:/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties

 Alex

 On Tue, Jun 9, 2015 at 9:19 PM, Elmarie Claasen elma...@hisp.org wrote:

 Hi all,



 Can anyone provide me with a complete list of available userrole
 authorities which appears on the left side when you create a user role?



 I don’t see any table with that information in dhis2.



 Much appreciated - thanks



 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.



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




 --
 Alex Tumwesigye

 Technical Advisor - DHIS2 (Consultant),
 Ministry of Health/AFENET
 Kampala
 Uganda

 IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

 IT Specialist (Servers, Networks and Security, Health Information Systems
 - DHIS2 )  Solar Consultant

 +256 774149 775, + 256 759 800161

 I don't want to be anything other than what I have been - one tree hill 




-- 
Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET
Kampala
Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT Specialist (Servers, Networks and Security, Health Information Systems -
DHIS2 )  Solar Consultant

+256 774149 775, + 256 759 800161

I don't want to be anything other than what I have been - one tree hill 
___
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] How to determine if a dataset has any data values in it

2015-06-09 Thread Lars Helge Øverland
Hi again,

I have done an optimization now in trunk r 19326 and 2.19. It seems we
unnecessarily loaded persisted periods for the time span when start and end
dates were used. Please try again on latest trunk and see if it works
better now.

Lars


On Tue, Jun 9, 2015 at 8:21 PM, Lorill Crees lcr...@2paths.com wrote:

 Hi Lars,

 Thanks for this. I've tried it out and it's working well in terms of
 functionality, but the performance is very poor. Even if I'm limiting to
 just one record, one api call is taking 5-7 seconds. When needing to
 iterate over 17 datasets this means two minutes for my page load which
 would not be acceptable.

 Are there any performance improvements that can be made for this?

 Let me know. Thanks,

 Lorill

 On Tue, Jun 9, 2015 at 3:18 AM, Lars Helge Øverland larshe...@gmail.com
 wrote:

 This has been backported to 2.19 now.

 On Tue, Jun 9, 2015 at 11:07 AM, Lars Helge Øverland larshe...@gmail.com
  wrote:

 Hi Lorill,

 I think you have found the best approach to the problem.

 I have added support in trunk now for a limit query parameter that
 puts a limit on the number of records to return. So you can now append
 limit=1 to your query and check if any records are returned.

 I have updated the docs here
 https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s10.html#d5e1798
 .

 Will see if this can be backported to 2.19 later.

 regards,

 Lars












 On Mon, Jun 8, 2015 at 11:30 PM, Lorill Crees lcr...@2paths.com wrote:

 Hi,

 I am trying to craft a web api call to determine if a dataset has at
 least one data value in it or not. I am not interested in the data values
 themselves, just if any data has been uploaded / inputted into the system
 yet or not.

 If data values did exist, I would not know what org units or periods
 were chosen so would not be able to supply those parameters.

 I would also prefer to do this in one api call instead of having to
 iterate through data elements until finding data (if any).

 I've been digging around the api and the best I can find right now in
 one call is this:

 dhis/api/dataValueSets?dataSet=QnhNNSNFE0MstartDate=1980-01-01endDate=2020-01-01orgUnit=
 lZsCb6y0KDXchildren=true

 where I set the start date to a far past, the end date to the future,
 and the org unit to the level 1 parent org unit.

 This could potentially return a very large number of records which is a
 heavy overhead when only wanting to know if dataValues  0.

 I also tried this:

 dhis/api/dataValueSets?dataSet=QnhNNSNFE0MstartDate=1980-01-01endDate=2020-01-01orgUnit=
 lZsCb6y0KDXchildren=truefields=dataValues:: isNotEmpty

 but the ::isNotEmpty does not seem to be in place for this call. I
 also could not seem to return paged data to reduce the payload.

 Do you have any other suggestions of how I can do this? To give
 context, I will be iterating through all Datasets in the system and
 displaying them in a list, so I need something that is fairly efficient. I
 wouldn't want to have to iterate through each data element individually
 unless necessary.

 Thanks,

 Lorill


 ___
 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 http://www.dhis2.org/
 University of Oslo
 Skype: larshelgeoverland
 http://www.dhis2.org https://www.dhis2.org




 --
 Lars Helge Øverland
 Lead developer, DHIS 2 http://www.dhis2.org/
 University of Oslo
 Skype: larshelgeoverland
 http://www.dhis2.org https://www.dhis2.org





-- 
Lars Helge Øverland
Lead developer, DHIS 2 http://www.dhis2.org/
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org https://www.dhis2.org
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19326: DataValueSetStore, performance improvement for gettin data values, using start/end dates directly...

2015-06-09 Thread noreply

revno: 19326
committer: Lars Helge Overland larshe...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 21:59:15 +0200
message:
  DataValueSetStore, performance improvement for gettin data values, using 
start/end dates directly in SQL
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataExportParams.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/SpringDataValueSetStore.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataExportParams.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataExportParams.java	2015-06-09 08:37:13 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DataExportParams.java	2015-06-09 19:59:15 +
@@ -48,6 +48,10 @@
 
 private SetPeriod periods = new HashSet();
 
+private Date startDate;
+
+private Date endDate;
+
 private SetOrganisationUnit organisationUnits = new HashSet();
 
 private boolean includeChildren;
@@ -80,6 +84,11 @@
 return periods != null  !periods.isEmpty() ? periods.iterator().next() : null;
 }
 
+public boolean hasStartEndDate()
+{
+return startDate != null  endDate != null;
+}
+
 public OrganisationUnit getFirstOrganisationUnit()
 {
 return organisationUnits != null  !organisationUnits.isEmpty() ? organisationUnits.iterator().next() : null;
@@ -139,6 +148,26 @@
 this.periods = periods;
 }
 
+public Date getStartDate()
+{
+return startDate;
+}
+
+public void setStartDate( Date startDate )
+{
+this.startDate = startDate;
+}
+
+public Date getEndDate()
+{
+return endDate;
+}
+
+public void setEndDate( Date endDate )
+{
+this.endDate = endDate;
+}
+
 public SetOrganisationUnit getOrganisationUnits()
 {
 return organisationUnits;

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2015-06-09 08:37:13 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2015-06-09 19:59:15 +
@@ -174,8 +174,8 @@
 }
 else if ( startDate != null  endDate != null )
 {
-ListPeriod pes = new ArrayListPeriod( periodService.getPeriodsBetweenDates( startDate, endDate ) );
-params.getPeriods().addAll( periodService.reloadPeriods( pes ) );
+params.setStartDate( startDate );
+params.setEndDate( endDate );
 }
 
 if ( organisationUnits != null )
@@ -212,11 +212,16 @@
 violation = At least one valid data set must be specified;
 }
 
-if ( params.getPeriods().isEmpty() ) 
+if ( params.getPeriods().isEmpty()  !params.hasStartEndDate() ) 
 {
 violation = At least one valid period or start/end dates must be specified;
 }
 
+if ( params.hasStartEndDate()  params.getStartDate().after( params.getEndDate() ) )
+{
+violation = Start date must be before end date;
+}
+
 if ( params.getOrganisationUnits().isEmpty() )
 {
 violation = At least one valid organisation unit must be specified;

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/SpringDataValueSetStore.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/SpringDataValueSetStore.java	2015-06-09 08:37:13 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/SpringDataValueSetStore.java	2015-06-09 19:59:15 +
@@ -30,6 +30,7 @@
 
 import static org.hisp.dhis.common.IdentifiableObjectUtils.getIdentifiers;
 import static org.hisp.dhis.system.util.DateUtils.getLongGmtDateString;
+import static org.hisp.dhis.system.util.DateUtils.getMediumDateString;
 import static org.hisp.dhis.util.TextUtils.getCommaDelimitedString;
 
 import java.io.OutputStream;
@@ -41,6 +42,8 @@
 import java.util.Set;
 
 import org.amplecode.staxwax.factory.XMLFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import 

Re: [Dhis2-devs] [Dhis2-users] List of permission in DHIS2

2015-06-09 Thread Elmarie Claasen
Thanks Alex that is exactly what I needed. 

 

Regards,

 

Elmarie Claasen

Hisp logo

Project Manager

Health Information Systems Program

Tel:  041-367 1027

Cell: 082 374 2209

E-mail:  mailto:elma...@hisp.org 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 
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  
mailto:disclai...@hisp.org 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: Alex Tumwesigye [mailto:atumwesi...@gmail.com] 
Sent: 09 June 2015 09:58 PM
To: Elmarie Claasen
Cc: DHIS 2 developers; dhis2-us...@lists.launchpad.net
Subject: Re: [Dhis2-users] List of permission in DHIS2

 

Dapo,

 

You are right!!! the userrole table is referenced by that table.

 

Alex

 

On Tue, Jun 9, 2015 at 10:51 PM, Alex Tumwesigye atumwesi...@gmail.com wrote:

Dear Elmarie,

 

They are hard coded using spring security.

see an extract from the code.

action name=alluser class=org.hisp.dhis.user.action.GetUserListAction
  result name=success type=velocity/main.vm/result
  param name=page/dhis-web-maintenance-user/allUser.vm/param
  param name=menu/dhis-web-maintenance-user/menu.vm/param
  param 
name=javascriptsjavascript/user.js,javascript/filterTable.js/param
  param name=requiredAuthoritiesF_USER_VIEW/param
/action
 
action name=getUser class=org.hisp.dhis.user.action.GetUserAction
  result name=success 
type=velocity-json/dhis-web-commons/ajax/jsonUser.vm/result
  param name=onExceptionReturnplainTextError/param
/action
 
action name=removeUser 
class=org.hisp.dhis.user.action.RemoveUserAction
  result name=success 
type=velocity-json/dhis-web-commons/ajax/jsonResponseSuccess.vm/result
  result name=logout 
type=redirect/dhis-web-commons-security/logout.action/result
  result name=error 
type=velocity-json/dhis-web-commons/ajax/jsonResponseError.vm/result
  param name=requiredAuthoritiesF_USER_DELETE/param
  param name=onExceptionReturnplainTextError/param
/action
 
action name=showAddUserForm 
class=org.hisp.dhis.user.action.SetupTreeAction
  result name=success type=velocity/main.vm/result
  param name=page/dhis-web-maintenance-user/addUserForm.vm/param
  param 
name=javascripts../dhis-web-commons/oust/oust.js,../dhis-web-commons/ouwt/ouwt.js,javascript/user.js/param
  param name=requiredAuthoritiesF_USER_ADD/param
/action
 
action name=addUser class=org.hisp.dhis.user.action.AddUserAction
  result name=success 
type=redirectuser.action?currentPage=${keyCurrentPage}amp;key=${keyCurrentKey}/result
  result name=error 
type=velocity-json/dhis-web-commons/ajax/jsonResponseError.vm/result
  param name=javascriptsjavascript/user.js/param
  param name=requiredAuthoritiesF_USER_ADD/param
/action

Also follow these link.

http://bazaar.launchpad.net/~dhis2-devs-core/dhis2/2.19/view/head:/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties

 

Alex

 

On Tue, Jun 9, 2015 at 9:19 PM, Elmarie Claasen elma...@hisp.org wrote:

Hi all,

 

Can anyone provide me with a complete list of available userrole authorities 
which appears on the left side when you create a user role?

 

I don’t see any table with that information in dhis2.

 

Much appreciated - thanks

 

Regards,

 

Elmarie Claasen

Hisp logo

Project Manager

Health Information Systems Program

Tel:  041-367 1027

Cell: 082 374 2209

E-mail:  mailto:elma...@hisp.org 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 
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  
mailto:disclai...@hisp.org 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-users
Post to : dhis2-us...@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp





 

-- 

Alex Tumwesigye

 

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET

Kampala

Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19317: Introduced system setting, allow assigning object to related objects during add or update. This t...

2015-06-09 Thread noreply

revno: 19317
committer: Lars Helge Overland larshe...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 14:52:15 +0200
message:
  Introduced system setting, allow assigning object to related objects during 
add or update. This to control whether users can assign e.g. org units to data 
sets and group when creating/editing org units.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java
  
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetAccessSettingsAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/org/hisp/dhis/settings/i18n_module.properties
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAccessSettings.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-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2015-04-16 21:17:08 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2015-06-09 12:52:15 +
@@ -108,6 +108,7 @@
 final String KEY_ANALYSIS_RELATIVE_PERIOD = keyAnalysisRelativePeriod;
 final String KEY_CORS_WHITELIST = keyCorsWhitelist;
 final String KEY_REQUIRE_ADD_TO_VIEW = keyRequireAddToView;
+final String KEY_ALLOW_OBJECT_ASSIGNMENT = keyAllowObjectAssignment;
 
 final String DEFAULT_SCHEDULE_AGGREGATE_QUERY_BUILDER_TASK_STRATEGY = lastMonth;
 final String DEFAULT_FLAG = dhis2;

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java	2015-04-07 09:42:13 +
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java	2015-06-09 12:52:15 +
@@ -131,6 +131,7 @@
 map.put( KEY_ACCEPTANCE_REQUIRED_FOR_APPROVAL, systemSettingManager.getSystemSetting( KEY_ACCEPTANCE_REQUIRED_FOR_APPROVAL, false ) );
 map.put( KEY_SYSTEM_NOTIFICATIONS_EMAIL, systemSettingManager.getSystemSetting( KEY_SYSTEM_NOTIFICATIONS_EMAIL ) );
 map.put( KEY_REQUIRE_ADD_TO_VIEW, systemSettingManager.getSystemSetting( KEY_REQUIRE_ADD_TO_VIEW, false ) );
+map.put( KEY_ALLOW_OBJECT_ASSIGNMENT, systemSettingManager.getSystemSetting( KEY_ALLOW_OBJECT_ASSIGNMENT, false ) );
 map.put( SYSPROP_PORTAL, defaultIfEmpty( System.getProperty( SYSPROP_PORTAL ), String.valueOf( false ) ) );
 
 invocation.getStack().push( map );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm	2015-01-12 08:42:48 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm	2015-06-09 12:52:15 +
@@ -116,6 +116,7 @@
 	/tr
 /table
 
+#if( $keyAllowObjectAssignment )
 table
 	tr
 		th colspan=2$i18n.getString( data_sets )/th
@@ -162,6 +163,7 @@
 /tr
 	#end
 /table
+#end
 
 p
 	input type=submit name=save value=$i18n.getString( 'add' ) style=width: 10em; /

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm	2015-01-12 08:42:48 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm	2015-06-09 12:52:15 +
@@ -112,6 +112,7 @@
 	/tr
 /table
 
+#if( $keyAllowObjectAssignment )
 table
 tr
 		th colspan=2$i18n.getString( data_sets )/th
@@ -164,6 +165,7 @@
 /tr
 	#end
 /table
+#end
 
 p
 	input type=submit 

Re: [Dhis2-devs-core] Small api issues with the users endpoint

2015-06-09 Thread Halvdan Grelland
I quickly looked into the pageSize issue and fixed it in the latest trunk.
Will backport to 2.19 as well.

2015-06-09 14:53 GMT+02:00 Mark Polak mar...@ifi.uio.no:

  Small correction on the one before. The oddity with the filtering and
 paging only happens when paging is less than 5, not equal to 5.

  When above 9 it gives 3 users actually.

  It seems to do filtering before paging.

  The first two users are on:

 https://apps.dhis2.org/dev/api/users.json?pageSize=10filter=name:like:Johnpage=1

  The third user is on:

 https://apps.dhis2.org/dev/api/users.json?pageSize=10filter=name:like:Johnpage=2

  Regards,

  Mark

  On 9 Jun 2015, at 14:41, Mark Polak mar...@ifi.uio.no wrote:

  Hey Morten,

  Some small things i found when API-ing.

  None of these things are really urgent. The paging thing i would say
 would be the highest priority as it breaks the paging for the DATIM user
 app. (When users filter on certain stuff, the page numbers will always stay
 the same)

  *User endpoint paging (demo  dev):*

  The pager still gives information for all the users in the system, even
 when filtering is applied.


 https://apps.dhis2.org/dev/api/users.json?pageSize=10filter=name:like:John

 https://apps.dhis2.org/demo/api/users.json?pageSize=10filter=name:like:John

  *User endpoint oddity*

  While creating the examples above i noticed something else that is a bit
 odd.

  pageSize of 5 or lower returns 1 result
 https://apps.dhis2.org/demo/api/users.json?pageSize=5filter=name:like:John

  pageSize of 6 or more returns 2 results
 https://apps.dhis2.org/demo/api/users.json?pageSize=6filter=name:like:John

  *Organisation units endpoint sorting combined with special level
 attribute*

  When using the special level=3 parameter the sort parameter does not
 work anymore (I guess this has to do something with that the level thing
 does some special query stuff)

  Correctly sorts by name

 https://apps.dhis2.org/demo/api/organisationUnits.json?filter=level:eq:3sort=name:asc

  Sorting by name stop sorting

 https://apps.dhis2.org/demo/api/organisationUnits.json?level=3sort=name:asc

  *Pager does not respect filtering (Any endpoint)*

  When requesting a url like the following the nextPage attribute of the
 pager omits the filter from the nextPage. This makes the nextPage not
 reliable for trying to get the next page. I'd have to re-add the filters
 for each previous or next page.
 https://apps.dhis2.org/demo/api/dataElements.json?filter=name:like:A

  Regards,

  Mark



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


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


[Dhis2-devs-core] Small api issues with the users endpoint

2015-06-09 Thread Mark Polak
Hey Morten,

Some small things i found when API-ing.

None of these things are really urgent. The paging thing i would say would be 
the highest priority as it breaks the paging for the DATIM user app. (When 
users filter on certain stuff, the page numbers will always stay the same)

User endpoint paging (demo  dev):

The pager still gives information for all the users in the system, even when 
filtering is applied.

https://apps.dhis2.org/dev/api/users.json?pageSize=10filter=name:like:John
https://apps.dhis2.org/demo/api/users.json?pageSize=10filter=name:like:John

User endpoint oddity

While creating the examples above i noticed something else that is a bit odd.

pageSize of 5 or lower returns 1 result
https://apps.dhis2.org/demo/api/users.json?pageSize=5filter=name:like:John

pageSize of 6 or more returns 2 results
https://apps.dhis2.org/demo/api/users.json?pageSize=6filter=name:like:John

Organisation units endpoint sorting combined with special level attribute

When using the special level=3 parameter the sort parameter does not work 
anymore (I guess this has to do something with that the level thing does some 
special query stuff)

Correctly sorts by name
https://apps.dhis2.org/demo/api/organisationUnits.json?filter=level:eq:3sort=name:asc

Sorting by name stop sorting
https://apps.dhis2.org/demo/api/organisationUnits.json?level=3sort=name:asc

Pager does not respect filtering (Any endpoint)

When requesting a url like the following the nextPage attribute of the pager 
omits the filter from the nextPage. This makes the nextPage not reliable for 
trying to get the next page. I'd have to re-add the filters for each previous 
or next page.
https://apps.dhis2.org/demo/api/dataElements.json?filter=name:like:A

Regards,

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


Re: [Dhis2-devs-core] Small api issues with the users endpoint

2015-06-09 Thread Mark Polak
Small correction on the one before. The oddity with the filtering and paging 
only happens when paging is less than 5, not equal to 5.

When above 9 it gives 3 users actually.

It seems to do filtering before paging.

The first two users are on:
https://apps.dhis2.org/dev/api/users.json?pageSize=10filter=name:like:Johnpage=1

The third user is on:
https://apps.dhis2.org/dev/api/users.json?pageSize=10filter=name:like:Johnpage=2

Regards,

Mark

On 9 Jun 2015, at 14:41, Mark Polak 
mar...@ifi.uio.nomailto:mar...@ifi.uio.no wrote:

Hey Morten,

Some small things i found when API-ing.

None of these things are really urgent. The paging thing i would say would be 
the highest priority as it breaks the paging for the DATIM user app. (When 
users filter on certain stuff, the page numbers will always stay the same)

User endpoint paging (demo  dev):

The pager still gives information for all the users in the system, even when 
filtering is applied.

https://apps.dhis2.org/dev/api/users.json?pageSize=10filter=name:like:John
https://apps.dhis2.org/demo/api/users.json?pageSize=10filter=name:like:John

User endpoint oddity

While creating the examples above i noticed something else that is a bit odd.

pageSize of 5 or lower returns 1 result
https://apps.dhis2.org/demo/api/users.json?pageSize=5filter=name:like:John

pageSize of 6 or more returns 2 results
https://apps.dhis2.org/demo/api/users.json?pageSize=6filter=name:like:John

Organisation units endpoint sorting combined with special level attribute

When using the special level=3 parameter the sort parameter does not work 
anymore (I guess this has to do something with that the level thing does some 
special query stuff)

Correctly sorts by name
https://apps.dhis2.org/demo/api/organisationUnits.json?filter=level:eq:3sort=name:asc

Sorting by name stop sorting
https://apps.dhis2.org/demo/api/organisationUnits.json?level=3sort=name:asc

Pager does not respect filtering (Any endpoint)

When requesting a url like the following the nextPage attribute of the pager 
omits the filter from the nextPage. This makes the nextPage not reliable for 
trying to get the next page. I'd have to re-add the filters for each previous 
or next page.
https://apps.dhis2.org/demo/api/dataElements.json?filter=name:like:A

Regards,

Mark

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


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19318: Fix bug where pager was instantiated before filtering on the users endpoint, causing the pager to...

2015-06-09 Thread noreply

revno: 19318
committer: Halvdan Hoem Grelland halvda...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 15:05:52 +0200
message:
  Fix bug where pager was instantiated before filtering on the users endpoint, 
causing the pager to not reflect the returned results
modified:
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java	2015-05-06 07:46:20 +
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java	2015-06-09 13:05:52 +
@@ -139,7 +139,7 @@
 
 int count = userService.getUserCount( params );
 
-if ( options.hasPaging() )
+if ( options.hasPaging()  !filters.isEmpty() )
 {
 Pager pager = new Pager( options.getPage(), count, options.getPageSize() );
 metaData.setPager( pager );

___
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 19327: set ObjectBridge bean to protoscope scope, to better handle concurrent imports

2015-06-09 Thread noreply

revno: 19327
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Wed 2015-06-10 07:31:50 +0700
message:
  set ObjectBridge bean to protoscope scope, to better handle concurrent imports
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/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-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml	2015-06-08 06:22:39 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml	2015-06-10 00:31:50 +
@@ -26,7 +26,7 @@
 
   bean id=org.hisp.dhis.dxf2.metadata.ImportService class=org.hisp.dhis.dxf2.metadata.DefaultImportService scope=prototype /
 
-  bean id=org.hisp.dhis.dxf2.metadata.ObjectBridge class=org.hisp.dhis.dxf2.metadata.DefaultObjectBridge /
+  bean id=org.hisp.dhis.dxf2.metadata.ObjectBridge class=org.hisp.dhis.dxf2.metadata.DefaultObjectBridge scope=prototype /
 
   bean id=org.hisp.dhis.dxf2.datavalueset.DataValueSetService
 class=org.hisp.dhis.dxf2.datavalueset.DefaultDataValueSetService /

___
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 19328: Applied patch from TW: updates DateUtils.parseDate to use thread safe date parsing

2015-06-09 Thread noreply

revno: 19328
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Wed 2015-06-10 08:03:19 +0700
message:
  Applied patch from TW: updates DateUtils.parseDate to use thread safe date 
parsing
modified:
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DateUtils.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-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DateUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DateUtils.java	2015-04-24 16:07:03 +
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DateUtils.java	2015-06-10 01:03:19 +
@@ -44,8 +44,7 @@
 import org.joda.time.DateTime;
 import org.joda.time.Days;
 import org.joda.time.Months;
-import org.joda.time.format.PeriodFormatter;
-import org.joda.time.format.PeriodFormatterBuilder;
+import org.joda.time.format.*;
 
 /**
  * @author Lars Helge Overland
@@ -53,18 +52,21 @@
  */
 public class DateUtils
 {
-public static final SimpleDateFormat[] SUPPORTED_DATE_FORMATS = new SimpleDateFormat[]{
-new SimpleDateFormat( -MM-dd'T'HH:mm:ss.SSSZ ),
-new SimpleDateFormat( -MM-dd'T'HH:mm:ssZ ),
-new SimpleDateFormat( -MM-dd'T'HH:mm:ss ),
-new SimpleDateFormat( -MM-dd'T'HH:mm ),
-new SimpleDateFormat( -MM-dd'T'HH ),
-new SimpleDateFormat( -MM-dd HH:mm:ssZ ),
-new SimpleDateFormat( -MM-dd ),
-new SimpleDateFormat( -MM ),
-new SimpleDateFormat(  )
+private static final DateTimeParser[] SUPPORTED_DATE_FORMAT_PARSERS = {
+DateTimeFormat.forPattern(-MM-dd'T'HH:mm:ss.SSSZ).getParser(),
+DateTimeFormat.forPattern(-MM-dd'T'HH:mm:ssZ).getParser(),
+DateTimeFormat.forPattern(-MM-dd'T'HH:mm:ss).getParser(),
+DateTimeFormat.forPattern(-MM-dd'T'HH:mm).getParser(),
+DateTimeFormat.forPattern(-MM-dd'T'HH).getParser(),
+DateTimeFormat.forPattern(-MM-dd HH:mm:ssZ).getParser(),
+DateTimeFormat.forPattern(-MM-dd).getParser(),
+DateTimeFormat.forPattern(-MM).getParser(),
+DateTimeFormat.forPattern().getParser()
 };
 
+private static final DateTimeFormatter DATE_TIME_FORMATTER = new DateTimeFormatterBuilder()
+.append( null, SUPPORTED_DATE_FORMAT_PARSERS ).toFormatter();
+
 private static final String SEP = , ;
 
 public static final PeriodFormatter DAY_SECOND_FORMAT = new PeriodFormatterBuilder()
@@ -617,17 +619,6 @@
 return null;
 }
 
-for ( SimpleDateFormat format : SUPPORTED_DATE_FORMATS )
-{
-try
-{
-return format.parse( dateString );
-}
-catch ( ParseException ignored )
-{
-}
-}
-
-return null;
+return DATE_TIME_FORMATTER.parseDateTime( dateString ).toDate();
 }
 }

___
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 19329: minor revert

2015-06-09 Thread noreply

revno: 19329
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Wed 2015-06-10 08:56:46 +0700
message:
  minor revert
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/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-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml	2015-06-10 00:31:50 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml	2015-06-10 01:56:46 +
@@ -26,7 +26,7 @@
 
   bean id=org.hisp.dhis.dxf2.metadata.ImportService class=org.hisp.dhis.dxf2.metadata.DefaultImportService scope=prototype /
 
-  bean id=org.hisp.dhis.dxf2.metadata.ObjectBridge class=org.hisp.dhis.dxf2.metadata.DefaultObjectBridge scope=prototype /
+  bean id=org.hisp.dhis.dxf2.metadata.ObjectBridge class=org.hisp.dhis.dxf2.metadata.DefaultObjectBridge /
 
   bean id=org.hisp.dhis.dxf2.datavalueset.DataValueSetService
 class=org.hisp.dhis.dxf2.datavalueset.DefaultDataValueSetService /

___
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 19321: GIS restore fav bug fixed + Data type formatting bug fixed.

2015-06-09 Thread noreply

revno: 19321
committer: Jan Henrik Overland janhenrik.overl...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 16:00:51 +0200
message:
  GIS restore fav bug fixed + Data type formatting bug fixed.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js	2015-05-20 07:18:37 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js	2015-06-09 14:00:51 +
@@ -8511,7 +8511,7 @@
 objectNameCmpMap[dxDim.dimension].setValue(dxDim.items[0].id);
 
 // Period
-period.store.add(gis.conf.period.relativePeriodsMap[peDim.items[0].id] ? gis.conf.period.relativePeriodsMap[peDim.items[0].id] : peDim.items[0]);
+period.store.add(gis.conf.period.relativePeriodRecordsMap[peDim.items[0].id] ? gis.conf.period.relativePeriodRecordsMap[peDim.items[0].id] : peDim.items[0]);
 period.setValue(peDim.items[0].id);
 
 // Legend

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js	2015-05-13 17:26:07 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js	2015-06-09 14:00:51 +
@@ -659,7 +659,7 @@
 for (var i = 0; i  r.rows.length; i++) {
 records.push({
 name: r.metaData.names[r.rows[i][dxIndex]],
-value: parseFloat(r.rows[i][valueIndex])
+value: Ext.isNumeric ? parseFloat(r.rows[i][valueIndex]) : r.rows[i][valueIndex]
 });
 }
 
@@ -2792,6 +2792,7 @@
 	{id: 'LAST_YEAR', name: GIS.i18n.last_year}
 ],
 relativePeriodsMap: {},
+relativePeriodRecordsMap: {},
 integratedRelativePeriodsMap: {
 	'THIS_WEEK': 'THIS_WEEK',
 	'LAST_WEEK': 'LAST_WEEK',
@@ -2818,11 +2819,15 @@
 }
 			};
 
-// relativePeriodsMap
+// relativePeriodsMap / records
 for (var i = 0, obj; i  conf.period.relativePeriods.length; i++) {
 obj = conf.period.relativePeriods[i];
 
 conf.period.relativePeriodsMap[obj.id] = obj.name;
+conf.period.relativePeriodRecordsMap[obj.id] = {
+id: obj.id,
+name: obj.name
+};
 }
 
 conf.url = {};

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


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19319: [bug] Fixed bug to application of systemStyle

2015-06-09 Thread noreply

revno: 19319
committer: Mark Polak mar...@ifi.uio.no
branch nick: dhis2
timestamp: Tue 2015-06-09 15:21:00 +0200
message:
  [bug] Fixed bug to application of systemStyle
  
  The systemSettings.currentStyle was never correctly applied.
  The userStyle.currentStyle was used and otherwise fallback to
  the default. Now the priority is the userStyle, systemSettingsStyle,
  and if neither of those then the default.
  Additionally some small refactoring to clean up the headerbar
   directive.
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js	2015-06-02 15:24:23 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.ui.js	2015-06-09 13:21:00 +
@@ -1076,6 +1076,13 @@
 '/div'].join('')
 };
 
+/**
+ * @description
+ * Priority of the color scheme that is being loaded is as follows
+ * 1. /api/userSettings/currentStyle
+ * 2. /api/systemSettings {currentStyle property on the systemSettings object}
+ * 3. The default style as defined in this function using the `defaultStyle` variable
+ */
 function d2HeaderBarController($scope, $http) {
 var ctrl = $scope;
 var baseUrl = dhis2.settings.getBaseUrl();
@@ -1093,52 +1100,66 @@
 
 function initialise() {
 getSystemSettings()
-.success(function(systemSettings) {
-
-saveToLocalStorage(systemSettings);
-
-requestUserStyle()
-.success(function (userStyleUrl) {
-var userStyleName = getStyleName(userStyleUrl);
-
-addUserStyleStylesheet(getStylesheetUrl(userStyleUrl));
-setHeaderLogo(userStyleName, systemSettings.keyCustomTopMenuLogo);
-setHeaderTitle(systemSettings.applicationTitle);
-setHeaderLink(systemSettings.startModule);
-})
-.error(function (e) {
-console  console.info  console.info('Unable to load usersettings, falling back to default');
-
-addUserStyleStylesheet(getStylesheetUrl());
-setHeaderLogo(undefined, systemSettings.keyCustomTopMenuLogo);
-setHeaderTitle(systemSettings.applicationTitle);
-setHeaderLink(systemSettings.startModule);
-});
+.then(getHeaderBarData)
+.catch(loadDataFromLocalStorageIfAvailable)
+.then(saveToLocalStorage)
+.then(function (headerData) {
+setHeaderData(headerData.userStyleUrl, headerData.logo, headerData.title, headerData.link);
+});
+}
+
+function getHeaderBarData(systemSettings) {
+return requestUserStyle()
+.catch(function () {
+console  console.info  console.info('Unable to load usersettings, falling back to systemSettings');
+localStorage.setItem('dhis2.menu.ui.headerBar.userStyle', systemSettings.currentStyle);
+return systemSettings.currentStyle;
 })
-.error(function() {
-var logo, title, link;
-
-//Unable to load system settings defaulting to base styles
-addUserStyleStylesheet(getStylesheetUrl());
-
-//Load values from localStorage if they are available
-if (islocalStorageSupported()) {
-logo = localStorage.getItem('dhis2.menu.ui.headerBar.logo')
-

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19320: Whoops. Fix flipped logic

2015-06-09 Thread noreply

revno: 19320
committer: Halvdan Hoem Grelland halvda...@gmail.com
branch nick: dhis2
timestamp: Tue 2015-06-09 15:31:12 +0200
message:
  Whoops. Fix flipped logic
modified:
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java	2015-06-09 13:05:52 +
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java	2015-06-09 13:31:12 +
@@ -139,7 +139,7 @@
 
 int count = userService.getUserCount( params );
 
-if ( options.hasPaging()  !filters.isEmpty() )
+if ( options.hasPaging()  filters.isEmpty() )
 {
 Pager pager = new Pager( options.getPage(), count, options.getPageSize() );
 metaData.setPager( pager );

___
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 19330: make sure that importService get one fresh ObjectBridge for every import, reuse this bridge for e...

2015-06-09 Thread noreply

revno: 19330
committer: Morten Olav Hansen morte...@gmail.com
branch nick: dhis2
timestamp: Wed 2015-06-10 10:15:14 +0700
message:
  make sure that importService get one fresh ObjectBridge for every import, 
reuse this bridge for every dxf2 importer object
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java	2015-05-30 13:36:07 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java	2015-06-10 03:15:14 +
@@ -34,9 +34,9 @@
 import org.hisp.dhis.cache.HibernateCacheManager;
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.MergeStrategy;
-import org.hisp.dhis.dxf2.common.ImportOptions;
 import org.hisp.dhis.commons.timer.SystemTimer;
 import org.hisp.dhis.commons.timer.Timer;
+import org.hisp.dhis.dxf2.common.ImportOptions;
 import org.hisp.dhis.importexport.ImportStrategy;
 import org.hisp.dhis.scheduling.TaskId;
 import org.hisp.dhis.schema.Schema;
@@ -261,7 +261,7 @@
 
 if ( importer != null )
 {
-return importer.importObjects( user, objects, importOptions );
+return importer.importObjects( user, objects, objectBridge, importOptions );
 }
 else
 {
@@ -278,7 +278,7 @@
 
 if ( importer != null )
 {
-return importer.importObject( user, object, importOptions );
+return importer.importObject( user, object, objectBridge, importOptions );
 }
 else
 {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java	2015-02-17 06:00:52 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java	2015-06-10 03:15:14 +
@@ -48,7 +48,7 @@
  * @param options Import options
  * @return ImportConflict instance if a conflict occurred, if not null
  */
-ImportTypeSummary importObject( User user, T object, ImportOptions options );
+ImportTypeSummary importObjects( User user, ListT objects, ObjectBridge objectBridge, ImportOptions options );
 
 /**
  * Import a collection of objects.
@@ -57,7 +57,7 @@
  * @param options Import options
  * @return List of all the ImportConflicts encountered
  */
-ImportTypeSummary importObjects( User user, ListT objects, ImportOptions options );
+ImportTypeSummary importObject( User user, T object, ObjectBridge objectBridge, ImportOptions options );
 
 /**
  * Can this importer handle a certain Class type?

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2015-05-30 13:36:07 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2015-06-10 03:15:14 +
@@ -163,8 +163,9 @@
 //---
 
 @Override
-public ImportTypeSummary importObjects( User user, ListT objects, ImportOptions options )
+public ImportTypeSummary importObjects( User user, ListT objects, ObjectBridge objectBridge, ImportOptions options )
 {
+this.objectBridge = objectBridge;
 this.options = options;
 this.summaryType = new ImportTypeSummary( importerClass.getSimpleName() );
 
@@ -193,8 +194,9 @@
 }
 
 @Override
-public ImportTypeSummary importObject( User user, T object, ImportOptions options )
+public ImportTypeSummary importObject( User user, T object, ObjectBridge objectBridge, ImportOptions options )
 {
+this.objectBridge = objectBridge;
 this.options = options;
 this.summaryType = new ImportTypeSummary(