[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 16317: Scheduling, added last success time info for analytics and resource tables

2014-08-05 Thread noreply

revno: 16317
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2014-08-05 12:57:11 +0200
message:
  Scheduling, added last success time info for analytics and resource tables
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java
  
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/scheduling/ResourceTableTask.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/scheduling/AnalyticsTableTask.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/synch/DefaultSynchronizationManager.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.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	2014-07-10 10:27:53 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2014-08-05 10:57:11 +
@@ -98,6 +98,9 @@
 final String KEY_CUSTOM_LOGIN_PAGE_LOGO = "keyCustomLoginPageLogo";
 final String KEY_CUSTOM_TOP_MENU_LOGO = "keyCustomTopMenuLogo";
 final String KEY_ANALYTICS_MAINTENANCE_MODE = "keyAnalyticsMaintenanceMode";
+final String KEY_LAST_SUCCESSFUL_DATA_SYNC = "keyLastSuccessfulDataSynch";
+final String KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_UPDATE = "keyLastSuccessfulAnalyticsTablesUpdate";
+final String KEY_LAST_SUCCESSFUL_RESOURCE_TABLES_UPDATE = "keyLastSuccessfulResourceTablesUpdate";
 
 final String DEFAULT_SCHEDULE_AGGREGATE_QUERY_BUILDER_TASK_STRATEGY = "lastMonth";
 final String DEFAULT_FLAG = "dhis2";

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/scheduling/ResourceTableTask.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/scheduling/ResourceTableTask.java	2014-03-18 08:10:10 +
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/scheduling/ResourceTableTask.java	2014-08-05 10:57:11 +
@@ -28,9 +28,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.setting.SystemSettingManager.KEY_LAST_SUCCESSFUL_RESOURCE_TABLES_UPDATE;
+
+import java.util.Date;
+
 import org.hisp.dhis.message.MessageService;
 import org.hisp.dhis.resourcetable.ResourceTableService;
 import org.hisp.dhis.scheduling.TaskId;
+import org.hisp.dhis.setting.SystemSettingManager;
 import org.hisp.dhis.system.notification.NotificationLevel;
 import org.hisp.dhis.system.notification.Notifier;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,6 +55,9 @@
 @Autowired
 private MessageService messageService;
 
+@Autowired
+private SystemSettingManager systemSettingManager;
+
 private TaskId taskId;
 
 public void setTaskId( TaskId taskId )
@@ -64,6 +72,8 @@
 @Override
 public void run()
 {
+final Date startTime = new Date();
+
 notifier.notify( taskId, "Generating resource tables" );
 
 try
@@ -80,6 +90,8 @@
 
 throw ex;
 }
+
+systemSettingManager.saveSystemSetting( KEY_LAST_SUCCESSFUL_RESOURCE_TABLES_UPDATE, startTime );
 }
 
 // -

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/scheduling/AnalyticsTableTask.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/scheduling/AnalyticsTableTask.java	2014-07-10 12:07:18 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/scheduling/AnalyticsTableTask.java	2014-08-05 10:57:11 +
@@ -30,12 +30,16 @@
 
 import static org.hisp.dhis.system.notification.NotificationLevel.ERROR;
 import static org.hisp.dhis.system.notification.NotificationLevel.INFO;
+import static org.hisp.dhis.setting.SystemSettingManager.KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_UPDATE;
+
+import java.util.Date;
 
 import javax.annotation.Resource;
 
 import org.hisp.dhis.analytics.AnalyticsTableService;
 import org.hisp.dhis.message.MessageService;
 import org.hisp.dhis.scheduling.TaskId;
+import org.hisp.dhis.setting.SystemSettingManager;
 import org.hisp.dhis.system.notification.Notifier;
 im

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 16318: Period structure resource table, fixed issue with no of days column

2014-08-05 Thread noreply

revno: 16318
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2014-08-05 13:19:29 +0200
message:
  Period structure resource table, fixed issue with no of days column
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/Period.java
  dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/MonthlyPeriodTypeTest.java
  
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java
  
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-api/src/main/java/org/hisp/dhis/period/Period.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/Period.java	2014-04-14 12:24:25 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/Period.java	2014-08-05 11:19:29 +
@@ -38,6 +38,8 @@
 import org.hisp.dhis.common.adapter.JacksonPeriodTypeSerializer;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
+import org.joda.time.DateTime;
+import org.joda.time.Days;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonView;
@@ -206,7 +208,7 @@
 }
 
 /**
- * Return the potential number of periods of the given period type which is
+ * Returns the potential number of periods of the given period type which is
  * spanned by this period.
  *
  * @param type the period type.
@@ -220,6 +222,18 @@
 return (int) Math.floor( no );
 }
 
+/**
+ * Returns the number of days in the period, i.e. the days between the start
+ * and end date.
+ * 
+ * @return number of days in period.
+ */
+public int getDaysInPeriod()
+{
+Days days = Days.daysBetween( new DateTime( startDate ), new DateTime( endDate ) );
+return days.getDays() + 1;
+}
+
 // -
 // hashCode, equals and toString
 // -

=== modified file 'dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/MonthlyPeriodTypeTest.java'
--- dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/MonthlyPeriodTypeTest.java	2014-03-18 08:10:10 +
+++ dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/MonthlyPeriodTypeTest.java	2014-08-05 11:19:29 +
@@ -92,8 +92,19 @@
 
 testCal.set( period2.getStartDate());
 assertEquals( 2010, testCal.get( Calendar.YEAR) );
-assertEquals( 0, testCal.get( Calendar.MONTH) );
-
+assertEquals( 0, testCal.get( Calendar.MONTH) );
+}
+
+@Test
+public void testGetDaysInPeriod()
+{
+Period pA = periodType.createPeriod( "20040315" );
+Period pB = periodType.createPeriod( "201403" );
+Period pC = periodType.createPeriod( "2014Q2" );
+
+assertEquals( 1, pA.getDaysInPeriod() );
+assertEquals( 31, pB.getDaysInPeriod() );
+assertEquals( 91, pC.getDaysInPeriod() );
 }
 
 @Test

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2014-06-27 08:38:40 +
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2014-08-05 11:19:29 +
@@ -492,7 +492,7 @@
 
 values.add( period.getId() );
 values.add( period.getIsoDate() );
-values.add( rowType.getFrequencyOrder() );
+values.add( period.getDaysInPeriod() );
 
 for ( PeriodType periodType : PeriodType.PERIOD_TYPES )
 {

=== 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	2014-07-25 07:56:49 +
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DateUtils.java	2014-08-05 11:19:29 +
@@ -225,8 +225,8 @@
 return false;
 }
 
-if ( (startDate.before( baseDate ) || startDate.equals( baseDate ))
-&& (endDate.after( baseDate ) || endDate.equals( baseDate )) )
+if ( ( startDate.before( baseDate ) || startDate.equals( baseDate ) )
+&& ( endDate.after( baseDate ) || endDate.equals( baseDate ) ) )
 {
 return true;
 }

___

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 16319: Program, for now updating program version on update

2014-08-05 Thread noreply

revno: 16319
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2014-08-05 13:27:57 +0200
message:
  Program, for now updating program version on update
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2014-07-27 15:02:58 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2014-08-05 11:27:57 +
@@ -212,6 +212,12 @@
 
 return null;
 }
+
+public Program increaseVersion()
+{
+version = version != null ? version + 1 : 1;
+return this;
+}
 
 // -
 // Getters and setters

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java	2014-07-27 15:02:58 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java	2014-08-05 11:27:57 +
@@ -105,18 +105,6 @@
 this.description = description;
 }
 
-private Integer version;
-
-public Integer getVersion()
-{
-return version;
-}
-
-public void setVersion( Integer version )
-{
-this.version = version;
-}
-
 private String dateOfEnrollmentDescription;
 
 public void setDateOfEnrollmentDescription( String dateOfEnrollmentDescription )
@@ -299,7 +287,6 @@
 Program program = programService.getProgram( id );
 program.setName( name );
 program.setDescription( description );
-program.setVersion( version );
 program.setDateOfEnrollmentDescription( dateOfEnrollmentDescription );
 program.setDateOfIncidentDescription( dateOfIncidentDescription );
 program.setType( type );
@@ -373,6 +360,8 @@
 program.setRelatedProgram( relatedProgram );
 }
 
+program.increaseVersion(); //TODO make more fine-grained
+
 programService.updateProgram( program );
 
 return SUCCESS;

___
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] Possible Bug with Chrone in data elements

2014-08-05 Thread Lars Helge Øverland
Hi Prosper,

this was fixed for 2.16.

regards,

Lars



On Sat, Jul 5, 2014 at 6:59 AM, Prosper BT  wrote:

> Thanks bwana
>
> Regards
> On Jul 3, 2014 12:19 PM, "Lars Helge Øverland" 
> wrote:
>
>> Hi Prosper,
>>
>> you are right, we will look into it.
>>
>> regards,
>>
>> Lars
>>
>>
>>
>>
>>  On Wed, Jul 2, 2014 at 2:46 PM, Prosper BT  wrote:
>>
>>> Hi Dev team
>>>
>>> Was using Chrone in data elements and when you chrone, you loose the
>>> category combination.
>>>
>>> Uasing 2.15
>>> Build revision: 15167
>>>
>>> Regards
>>> --
>>> Prosper Behumbiize, MPH
>>> Phone:+256 414 320076
>>> Cell: +256 772 139037
>>>  +256 752 751776
>>>
>>>
>>> ___
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to : dhis2-devs@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1339720] Re: DHIS2.16 Duplicating Dimensions in Table Layout

2014-08-05 Thread Lars Helge Øverland
Nice spot. Will fix.

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

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

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

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

Title:
  DHIS2.16 Duplicating Dimensions in Table Layout

Status in DHIS 2:
  New

Bug description:
  Hi devs,
  Not a big deal but could be quite confusing for the user. If you select a 
multiple OU or DE dimensions to use in your table layout, these are duplicated 
every time you reselect from a previous dimension. I have replicated this on 
the demo site and attached a screenshot for your reference. You can follow 
these steps if you want to replicate

  1) Select ANC Data elements in Pivot Table

  2) Select This Year
   
  3) Select Facility Type (Hospital)

  4) Update Table

  5) Select Facility Ownership (Public)

  6) Remove Facility Type from Table Layout

  7) Update

  8) Select Facility Type (Clinic)

  You will find that a new Faciity Type Dimension is added to the Table
  layout.

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

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


Re: [Dhis2-devs] Data Export zip file corrupted

2014-08-05 Thread Lars Helge Øverland
Hi Maheed,

sorry for late reply, I know it has been a while but at least this seems to
work well now, tested on Win and Linux.

regards,

Lars



On Tue, Jul 15, 2014 at 1:51 PM, Maheed Ramadan 
wrote:

>  Dear All,
>
> I am using the DHIS 2.15 live version on my local machine (windows 7) and
> I am trying to export data from the system using csv or xml.
>
>
>
> The problem is that the downloaded zip file is corrupted and cannot be
> opened.
>
> Is anyone facing this problem and is there any solution for this?
>
>
>
> Note that I am using the latest 2.15 build version 15189.
>
>
>
> Thanks
>
>
>
> Maheed
>
>
>
>
>
___
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 16320: Minor markup errors

2014-08-05 Thread noreply

revno: 16320
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2014-08-05 14:57:45 +0200
message:
  Minor markup errors
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm
  
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.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-commons-resources/src/main/webapp/main.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2014-07-08 19:02:06 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2014-08-05 12:57:45 +
@@ -164,7 +164,7 @@
   
 
   
-  
+  
 
 
 #googleAnalyticsUA()

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.vm	2014-01-07 11:57:08 +
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/dashboard.vm	2014-08-05 12:57:45 +
@@ -64,7 +64,7 @@
 
 
 
-	
+	
 
 
 

___
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] Disabling validation in attributes

2014-08-05 Thread Lars Helge Øverland
Hi Farai,

I have reduced the min length to 1 character now in trunk / 2.16.

regards,

Lars



On Mon, Jul 28, 2014 at 4:51 PM, Farai Mutero  wrote:

> Hi Guys
>
> Version: 2.15Build revision: 15175Build date: 2014-06-26 02:05
>
> Is it possible to disable field validation in Data Element and Indicator
> attributes? We are just having a problem that we cant manually edit some
> dataelements because of the validation kicks-in even on fields what we dont
> have values at hand. See screenshot below:
>
> [image: Inline image 1]
>
> --
> Farai Mutero
>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
___
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 16321: Attribute min length

2014-08-05 Thread noreply

revno: 16321
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2014-08-05 15:28:23 +0200
message:
  Attribute min length
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.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-commons-resources/src/main/webapp/macros.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2014-06-20 09:08:15 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2014-08-05 13:28:23 +
@@ -132,7 +132,7 @@
 
 	$!args.text #if($args.mandatory)*#end
 	
-		
+		
 	
 
 #end

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


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 16322: Fixed nullpointer vulnerability in TrackedEntityFormDeletionHandler

2014-08-05 Thread noreply

revno: 16322
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2014-08-05 15:37:40 +0200
message:
  Fixed nullpointer vulnerability in TrackedEntityFormDeletionHandler
modified:
  
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityFormDeletionHandler.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-tracker/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityFormDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityFormDeletionHandler.java	2014-07-14 04:44:27 +
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityFormDeletionHandler.java	2014-08-05 13:37:40 +
@@ -62,6 +62,10 @@
 public void deleteProgram( Program program )
 {
 TrackedEntityForm form = formService.getFormsWithProgram( program );
-formService.deleteTrackedEntityForm( form );
+
+if ( form != null )
+{
+formService.deleteTrackedEntityForm( form );
+}
 }
 }

___
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-documenters/dhis2/dhis2-docbook-docs] Rev 1169: Installation, removed dated content

2014-08-05 Thread noreply

revno: 1169
committer: Lars Helge Overland 
branch nick: dhis2-docbook-docs
timestamp: Tue 2014-08-05 15:58:25 +0200
message:
  Installation, removed dated content
modified:
  src/docbkx/en/dhis2_implementation_guide_installation.xml


--
lp:~dhis2-documenters/dhis2/dhis2-docbook-docs
https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs

Your team DHIS 2 developers is subscribed to branch 
lp:~dhis2-documenters/dhis2/dhis2-docbook-docs.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs/+edit-subscription
=== modified file 'src/docbkx/en/dhis2_implementation_guide_installation.xml'
--- src/docbkx/en/dhis2_implementation_guide_installation.xml	2014-07-25 18:17:40 +
+++ src/docbkx/en/dhis2_implementation_guide_installation.xml	2014-08-05 13:58:25 +
@@ -167,9 +167,10 @@
 this can however not be considered secure.
   A common mistake is to have a white-space after the last property value so make sure
 there is no white-space at the end of any line. Also remember that this file contains the
-clear text password for your dhis2 database so needs to be protected from unauthorized
-access. To do this invoke chmod 0600 hibernate.properties which ensures that
-only the dhis user which owns the file is allowed to read or write to it.
+clear text password for your DHIS 2 database so it needs to be protected from unauthorized
+access. To do this invoke the following command which ensures that only the dhis user which
+owns the file is allowed to read it:
+  chmod 0600 hibernate.properties
 
 
   Install Java
@@ -435,8 +436,11 @@
   
 
 
-  Starting tomcat and nginx on boot-time
-  In certain situations a server might reboot unexpectedly. It is hence preferable to have Tomcat and nginx start automatically when the server starts. To achieve that the first step is to create init scripts. Create a new file called tomcat and paste the below content into it (adjust the HOME variable to your environment):
+  Starting tomcat on boot-time
+  In certain situations a server might reboot unexpectedly. It is hence preferable to have
+Tomcat start automatically when the server starts. To achieve that the first step is to
+create init scripts. Create a new file called tomcat and paste the below
+content into it (adjust the HOME variable to your environment):
   #!/bin/sh
 #Tomcat init script
 
@@ -460,11 +464,12 @@
 invoking:
   sudo mv tomcat /etc/init.d
 sudo chmod +x /etc/init.d/tomcat
-  Next make sure the tomcat and nginx init scripts will be invoked during system startup
-and shutdown:
-  sudo /usr/sbin/update-rc.d -f nginx defaults 80
-sudo /usr/sbin/update-rc.d -f tomcat defaults 81
-  Tomcat and nginx will now be started at system startup and stopped at system shutdown. If you later need to revert this you can replace defaults with  remove and invoke the above commands again.
+  Next make sure the tomcat init script will be invoked during system startup and
+shutdown:
+  sudo /usr/sbin/update-rc.d -f tomcat defaults 81
+  Tomcat will now be started at system startup and stopped at system shutdown. If you
+later need to revert this you can replace defaults with remove and
+invoke the above commands again.
 
 
   Making resources available with nginx

___
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] Upload Apps name

2014-08-05 Thread Lars Helge Øverland
Hi James,

just to clarify: Do you refer to using the "/" character inside the name of
the app itself ?

regards,

Lars



On Fri, Aug 1, 2014 at 3:59 AM, James Chang  wrote:

> Hi,
>
> In App Management,
> I noticed that if we have '/' on the Apps name, it fails to remove the
> application.
> When 'Remove' is used on app in 'Settings', it goes through, but does not
> actually remove it.
>
> So, I ended up removing the app from server file directly.
>
> ___
> 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] Upload Apps name

2014-08-05 Thread James Chang
Hi, Lars.

In the App's manifest.webapp file, we have set the name (and description)
as 'Tabular Event / Tracker Capture'.

Having '/' in the 'name' property in manifest.webapp made it unable to
delete the app from the 'Settings' of 'App Management'.






On Tue, Aug 5, 2014 at 9:09 PM, Lars Helge Øverland 
wrote:

> Hi James,
>
> just to clarify: Do you refer to using the "/" character inside the name
> of the app itself ?
>
> regards,
>
> Lars
>
>
>
> On Fri, Aug 1, 2014 at 3:59 AM, James Chang  wrote:
>
>> Hi,
>>
>> In App Management,
>> I noticed that if we have '/' on the Apps name, it fails to remove the
>> application.
>> When 'Remove' is used on app in 'Settings', it goes through, but does not
>> actually remove it.
>>
>> So, I ended up removing the app from server file directly.
>>
>> ___
>> 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 16323: Email, extra logging of errors

2014-08-05 Thread noreply

revno: 16323
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2014-08-05 16:20:22 +0200
message:
  Email, extra logging of errors
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/EmailMessageSender.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/EmailMessageSender.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/EmailMessageSender.java	2014-06-16 14:00:37 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/EmailMessageSender.java	2014-08-05 14:20:22 +
@@ -40,6 +40,7 @@
 import org.apache.commons.mail.EmailException;
 import org.apache.commons.mail.SimpleEmail;
 import org.hisp.dhis.setting.SystemSettingManager;
+import org.hisp.dhis.system.util.DebugUtils;
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserService;
 import org.springframework.scheduling.annotation.Async;
@@ -137,7 +138,7 @@
 }
 catch ( EmailException ex )
 {
-log.warn( "Could not send email: " + ex.getMessage() );
+log.warn( "Could not send email: " + ex.getMessage() + ", " + DebugUtils.getStackTrace( ex ) );
 }
 
 return null;

___
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 16324: Email, extra logging of errors

2014-08-05 Thread noreply

revno: 16324
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2014-08-05 16:21:42 +0200
message:
  Email, extra logging of errors
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/EmailMessageSender.java


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/EmailMessageSender.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/EmailMessageSender.java	2014-08-05 14:20:22 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/EmailMessageSender.java	2014-08-05 14:21:42 +
@@ -140,6 +140,10 @@
 {
 log.warn( "Could not send email: " + ex.getMessage() + ", " + DebugUtils.getStackTrace( ex ) );
 }
+catch ( RuntimeException ex )
+{
+log.warn( "Error while sending email: " + ex.getMessage() + ", " + DebugUtils.getStackTrace( ex ) );
+}
 
 return null;
 }

___
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] period_periodid sequence bug?

2014-08-05 Thread Bob Jolliffe
Hi

I notice that the trackedentity startup TableAlteror has introduced a new
sequence and modification to the period table.

executeSql( "CREATE SEQUENCE period_periodid_seq" );
executeSql( "ALTER TABLE period ALTER COLUMN periodid SET DEFAULT
NEXTVAL('period_periodid_seq')" );

Presumably the idea (as I see is implemented in
HibernateCaseAggregationConditionStore.java) is that periods can be
inserted with an sql statement without bothering about the periodid as it
will get a default value from period_periodid_seq.

But in practice this doesn't seem to be happening.  In a range of
production databases I have just looked at the nextvalue of the
period_periodid_seq is 1 even though there are a large number of periods in
the database.  I am assuming they have had their ids populated from
hibernate_sequence instead.

Something seems clearly not right here.  If we have different code in parts
of dhis2 which are using different sequence sources for periodid there will
be clashes and odd errors on period creation.

Can somebody explain if I am misinterpreting?

Bob
___
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-documenters/dhis2/dhis2-docbook-docs] Rev 1170: Typo

2014-08-05 Thread noreply

revno: 1170
committer: Lars Helge Overland 
branch nick: dhis2-docbook-docs
timestamp: Tue 2014-08-05 18:07:19 +0200
message:
  Typo
modified:
  src/docbkx/en/dhis2_user_man_import_export.xml


--
lp:~dhis2-documenters/dhis2/dhis2-docbook-docs
https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs

Your team DHIS 2 developers is subscribed to branch 
lp:~dhis2-documenters/dhis2/dhis2-docbook-docs.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs/+edit-subscription
=== modified file 'src/docbkx/en/dhis2_user_man_import_export.xml'
--- src/docbkx/en/dhis2_user_man_import_export.xml	2014-07-27 12:24:03 +
+++ src/docbkx/en/dhis2_user_man_import_export.xml	2014-08-05 16:07:19 +
@@ -194,8 +194,8 @@
 
   Domain type
   No
-  aggregate | patient
-  Domain type for data element, can be aggreate or patient. Max 16 char.
+  aggregate | tracker
+  Domain type for data element, can be aggregate or tracker. Max 16 char.
 
 
   Value type
@@ -219,7 +219,8 @@
   Aggregation operator
   No
   sum | average | count | stddev | variance
-  Operator indicating how to aggreate data in the time dimension. Max 16 char.
+  Operator indicating how to aggregate data in the time dimension. Max 16
+char.
 
 
   Category combination UID

___
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 1348566] Re: data element list empty in indicator screen

2014-08-05 Thread Lars Helge Øverland
Hi Robin,

yes you can specify category combo identifier (UID) now in the CSV data
element format. Docs here
.

This should work against 2.15 and 2.16. The docs should cover all fields
supported.

regards,

Lars



On Fri, Jul 25, 2014 at 1:40 PM, Robin Martens  wrote:

> According to the manual of April, the comboid column is not available
> for CSV import (or at least not mentioned). You mean you can effectively
> specify the comboid in the CSV? Would the column come right after the
> "zero is significant" column in the csv? And does the same hold for all
> other columns in the dataelement table not mentioned in the user manual?
>
> I have a large meta-data import planned soon so would be nice to know.
>
> --
> You received this bug notification because you are a member of DHIS 2
> developers, which is subscribed to DHIS.
> https://bugs.launchpad.net/bugs/1348566
>
> Title:
>   data element list empty in indicator screen
>
> Status in DHIS 2:
>   New
>
> Bug description:
>   Version: 2.15
>   Build: 15185
>
>   When I want to open my "numerator" or "denominator" screens for
>   indicator definition, the data element list is empty. However, when I
>   use filters to search my data elements, they sometimes work. Below
>   some observations:
>
>   1.No problem to retrieve aggregate data elements using the filters.
>   2.No problem to retrieve tracker data elements which have been
> adapted manually via the web interface, again by using filters.
>   3.Almost never able to retrieve tracker data elements without manual
> adjustments. The interesting thing is that 90% of the time, I won't find
> them, while around 10% of the time, when using the filters, they do appear!
>
>   Note that the aggregate data elements were created manually, while the
>   tracker DE were imported. When looking in the postgresql db, it seems
>   imported data elements have the columns "categorycomboid" and "url"
>   empty. These are automatically filled when doing any other manual
>   adjustment through the webinterface. However, when manually adding
>   values for these columns directly into the postgresql db, it doesn't
>   change anything.
>
>   The error log on loading the indicator screen is the following:
>
>   * ERROR 2014-07-25 11:56:20,520 Error while executing action
> (ExceptionInterceptor.java [http-bio-8080-exec-23])
>   java.lang.NullPointerException
> at
> org.hisp.dhis.dataelement.DefaultDataElementCategoryService.getOperands(DefaultDataElementCategoryService.java:642)
> at sun.reflect.GeneratedMethodAccessor799.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
> at
> org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> at com.sun.proxy.$Proxy50.getOperands(Unknown Source)
> at
> org.hisp.dhis.commons.action.GetOperandsAction.execute(GetOperandsAction.java:202)
> at sun.reflect.GeneratedMethodAccessor803.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalUserInterceptor.intercept(XWorkPortalUserInterceptor.java:88)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 16325: Added a maintenance function for validating and potentially updating the data elements in express...

2014-08-05 Thread noreply

revno: 16325
committer: Tran Chau
branch nick: dhis2
timestamp: Tue 2014-08-05 23:23:58 +0700
message:
  Added a maintenance function for validating and potentially updating the data 
elements in expression and option combos in expression properties of all 
expressions.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/maintenance/PerformMaintenanceAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/maintenance.js
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/maintenanceForm.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/expression/ExpressionService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java	2014-07-27 19:59:20 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java	2014-08-05 16:23:58 +
@@ -363,4 +363,11 @@
  * @param indicators the collection of Indicators.
  */
 Set getOperandsInIndicators( Collection indicators );
+
+/**
+ * the data element and option combo of expression formula, which doesn't
+ * match with any data elements and option combos existed in database, will
+ * be created and saved into database
+ */
+void updateDataElementsInExpression();
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2014-07-27 19:59:20 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2014-08-05 16:23:58 +
@@ -36,6 +36,7 @@
 import static org.hisp.dhis.system.util.MathUtils.calculateExpression;
 import static org.hisp.dhis.system.util.MathUtils.isEqual;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -52,9 +53,12 @@
 import org.hisp.dhis.constant.Constant;
 import org.hisp.dhis.constant.ConstantService;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementOperand;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.indicator.Indicator;
@@ -931,6 +935,93 @@
 return operands;
 }
 
+public void updateDataElementsInExpression()
+{
+Collection expressionList = expressionStore.getAll();
+
+for( Expression expression : expressionList )
+{
+final Matcher matcher = OPERAND_PATTERN.matcher( expression.getExpression() );
+
+int i = 0;
+String description = expression.getDescription();
+while ( matcher.find() )
+{
+String optionComboUid = matcher.group( 2 );
+DataElementCategoryOptionCombo optionCombo = categoryService.
+getDataElementCategoryOptionCombo( optionComboUid );
+DataElementCategoryCombo categoryCombo = null;
+if( optionCombo != null)
+{
+categoryCombo = optionCombo.getCategoryCombo();
+}
+else
+{ 
+// Add Option
+
+DataElementCategoryOption option = new DataElementCategoryOption( description );
+option.setCode( optionComboUid );
+categoryService.addDataElementCategoryOption( option );
+
+// Add category
+
+DataElementCategory category = new DataElementCategory();
+category.setName( description );
+category.setDataDimension( false );
+category.setDataDimensionType( DataElementCategoryCombo.DIMENSION_TYPE_DISAGGREGATION );
+
+List categoryOptions = new ArrayList();
+catego

Re: [Dhis2-devs] [Bug 1348566] Re: data element list empty in indicator screen

2014-08-05 Thread Robin Martens
Great, thanks again!

-Original Message-
From: boun...@canonical.com [mailto:boun...@canonical.com] On Behalf Of Lars 
Helge Øverland
Sent: 05 August 2014 18:09
To: Robin Martens
Subject: Re: [Dhis2-devs] [Bug 1348566] Re: data element list empty in 
indicator screen

Hi Robin,

yes you can specify category combo identifier (UID) now in the CSV data
element format. Docs here
.

This should work against 2.15 and 2.16. The docs should cover all fields
supported.

regards,

Lars


On Fri, Jul 25, 2014 at 1:40 PM, Robin Martens  wrote:

> According to the manual of April, the comboid column is not available 
> for CSV import (or at least not mentioned). You mean you can 
> effectively specify the comboid in the CSV? Would the column come 
> right after the "zero is significant" column in the csv? And does the 
> same hold for all other columns in the dataelement table not mentioned in the 
> user manual?
>
> I have a large meta-data import planned soon so would be nice to know.
>
> --
> You received this bug notification because you are a member of DHIS 2 
> developers, which is subscribed to DHIS.
> https://bugs.launchpad.net/bugs/1348566
>
> Title:
>   data element list empty in indicator screen
>
> Status in DHIS 2:
>   New
>
> Bug description:
>   Version: 2.15
>   Build: 15185
>
>   When I want to open my "numerator" or "denominator" screens for
>   indicator definition, the data element list is empty. However, when I
>   use filters to search my data elements, they sometimes work. Below
>   some observations:
>
>   1.No problem to retrieve aggregate data elements using the filters.
>   2.No problem to retrieve tracker data elements which have been
> adapted manually via the web interface, again by using filters.
>   3.Almost never able to retrieve tracker data elements without manual
> adjustments. The interesting thing is that 90% of the time, I won't 
> find them, while around 10% of the time, when using the filters, they do 
> appear!
>
>   Note that the aggregate data elements were created manually, while the
>   tracker DE were imported. When looking in the postgresql db, it seems
>   imported data elements have the columns "categorycomboid" and "url"
>   empty. These are automatically filled when doing any other manual
>   adjustment through the webinterface. However, when manually adding
>   values for these columns directly into the postgresql db, it doesn't
>   change anything.
>
>   The error log on loading the indicator screen is the following:
>
>   * ERROR 2014-07-25 11:56:20,520 Error while executing action 
> (ExceptionInterceptor.java [http-bio-8080-exec-23])
>   java.lang.NullPointerException
> at
> org.hisp.dhis.dataelement.DefaultDataElementCategoryService.getOperands(DefaultDataElementCategoryService.java:642)
> at sun.reflect.GeneratedMethodAccessor799.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
> at
> org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> at com.sun.proxy.$Proxy50.getOperands(Unknown Source)
> at
> org.hisp.dhis.commons.action.GetOperandsAction.execute(GetOperandsAction.java:202)
> at sun.reflect.GeneratedMethodAccessor803.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
> at
> com.opensymphony.x

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 16326: Reverted r 16325

2014-08-05 Thread noreply

revno: 16326
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2014-08-06 00:30:52 +0200
message:
  Reverted r 16325
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/maintenance/PerformMaintenanceAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/maintenance.js
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/maintenanceForm.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/expression/ExpressionService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java	2014-08-05 16:23:58 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java	2014-08-05 22:30:52 +
@@ -363,11 +363,4 @@
  * @param indicators the collection of Indicators.
  */
 Set getOperandsInIndicators( Collection indicators );
-
-/**
- * the data element and option combo of expression formula, which doesn't
- * match with any data elements and option combos existed in database, will
- * be created and saved into database
- */
-void updateDataElementsInExpression();
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2014-08-05 16:23:58 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2014-08-05 22:30:52 +
@@ -36,7 +36,6 @@
 import static org.hisp.dhis.system.util.MathUtils.calculateExpression;
 import static org.hisp.dhis.system.util.MathUtils.isEqual;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -53,12 +52,9 @@
 import org.hisp.dhis.constant.Constant;
 import org.hisp.dhis.constant.ConstantService;
 import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
-import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
-import org.hisp.dhis.dataelement.DataElementDomain;
 import org.hisp.dhis.dataelement.DataElementOperand;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.indicator.Indicator;
@@ -935,93 +931,6 @@
 return operands;
 }
 
-public void updateDataElementsInExpression()
-{
-Collection expressionList = expressionStore.getAll();
-
-for( Expression expression : expressionList )
-{
-final Matcher matcher = OPERAND_PATTERN.matcher( expression.getExpression() );
-
-int i = 0;
-String description = expression.getDescription();
-while ( matcher.find() )
-{
-String optionComboUid = matcher.group( 2 );
-DataElementCategoryOptionCombo optionCombo = categoryService.
-getDataElementCategoryOptionCombo( optionComboUid );
-DataElementCategoryCombo categoryCombo = null;
-if( optionCombo != null)
-{
-categoryCombo = optionCombo.getCategoryCombo();
-}
-else
-{ 
-// Add Option
-
-DataElementCategoryOption option = new DataElementCategoryOption( description );
-option.setCode( optionComboUid );
-categoryService.addDataElementCategoryOption( option );
-
-// Add category
-
-DataElementCategory category = new DataElementCategory();
-category.setName( description );
-category.setDataDimension( false );
-category.setDataDimensionType( DataElementCategoryCombo.DIMENSION_TYPE_DISAGGREGATION );
-
-List categoryOptions = new ArrayList();
-categoryOptions.add( option );
-category.setCategoryOptions( categoryOptions );
-categoryService.addData

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 16327: use new period generator in reports: completeness, dataset, approval

2014-08-05 Thread noreply

revno: 16327
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Wed 2014-08-06 11:06:04 +0700
message:
  use new period generator in reports: completeness, dataset, approval
modified:
  
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js
  
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js
  
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.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-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js	2014-07-12 11:33:56 +
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js	2014-08-06 04:06:04 +
@@ -47,14 +47,14 @@
 dhis2.appr.orgUnitSelected = function( orgUnits, orgUnitNames, children )
 {
 	dhis2.appr.displayCategoryOptionGroups();
-}
+};
 
 dhis2.appr.displayPeriods = function()
 {
 var periodType = $( "#periodType" ).val();
 dhis2.dsr.displayPeriodsInternal( periodType, dhis2.appr.currentPeriodOffset );
 dhis2.appr.displayCategoryOptionGroups();
-}
+};
 
 dhis2.appr.displayNextPeriods = function()
 {	
@@ -63,18 +63,18 @@
 dhis2.appr.currentPeriodOffset++;
 dhis2.appr.displayPeriods();
 }
-}
+};
 
 dhis2.appr.displayPreviousPeriods = function()
 {
 dhis2.appr.currentPeriodOffset--;
 dhis2.appr.displayPeriods();
-}
+};
 
 dhis2.appr.periodSelected = function()
 {
 dhis2.appr.displayCategoryOptionGroups();
-}
+};
 
 dhis2.appr.displayCategoryOptionGroups = function()
 {
@@ -101,7 +101,7 @@
 			$( "#categoryOptionGroupSection" ).hide();			
 		}
 	} );
-}
+};
 
 dhis2.appr.getDataReport = function()
 {	
@@ -120,7 +120,7 @@
 }
 
 return dataReport;
-}
+};
 
 dhis2.appr.generateDataReport = function()
 {
@@ -155,13 +155,13 @@
 	setTableStyles();
 	dhis2.appr.setApprovalState();
 } );
-}
+};
 
 dhis2.appr.hideCriteria = function()
 {
 	$( "#criteria" ).hide( "fast" );
 	$( "#dataButton" ).removeAttr( "disabled" );
-}
+};
 
 //--
 // Approval
@@ -288,7 +288,7 @@
 		}
 	   	
 		} );	
-}
+};
 
 dhis2.appr.approveData = function()
 {
@@ -306,7 +306,7 @@
 			alert( xhr.responseText );
 		}
 	} );
-}
+};
 
 dhis2.appr.unapproveData = function()
 {
@@ -324,7 +324,7 @@
 			alert( xhr.responseText );
 		}
 	} );
-}
+};
 
 dhis2.appr.acceptData = function()
 {
@@ -342,7 +342,7 @@
 alert( xhr.responseText );
 }
 } );
-}
+};
 
 dhis2.appr.unacceptData = function()
 {
@@ -360,18 +360,18 @@
 alert( xhr.responseText );
 }
   } );
-}
+};
 
 dhis2.appr.getApprovalUrl = function()
 {
 	var data = dhis2.appr.getDataReport();
 	var url = "../api/dataApprovals?ds=" + data.ds + "&pe=" + data.pe + "&ou=" + data.ou + "&cog=" + data.cog;
 	return url;
-}
+};
 
 dhis2.appr.getAcceptanceUrl = function()
 {
 	var data = dhis2.appr.getDataReport();
 	var url = "../api/dataApprovals/acceptances?ds=" + data.ds + "&pe=" + data.pe + "&ou=" + data.ou + "&cog=" + data.cog;
 	return url;
-}
+};

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js	2013-09-27 13:24:04 +
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js	2014-08-06 04:06:04 +
@@ -1,6 +1,5 @@
 
 var currentPeriodOffset = 0;
-var periodTypeFactory = new PeriodType();
 
 //--
 // Period
@@ -9,9 +8,8 @@
 function displayPeriods()
 {
   var periodType = $( "#periodTypeId" ).val();
-  var periods = periodTypeFactory.get( periodType ).generatePeriods( currentPeriodOffset );
-  periods = periodTypeFactory.reverse( periods );
-  periods = periodTypeFactory.filterFuturePeriodsExceptCurrent( periods );
+  var periods = dhis2.period.generator.generateReversedPeriods(periodType, currentPeriodOffset);
+  periods = dhis2.period.generator.filterFuturePeriods( periods );
 
   $( "#periodId" ).removeAttr( "disabled" );
   clearListById( "periodId" );

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js	2014-07-12 11:33:56 +
+++ dhis-2/dhis-web/dhis-web-reporting/s

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 16328: local/in Maintenance RBF work in progress

2014-08-05 Thread noreply

revno: 16328
committer: Mithilesh Kumar Thakur 
branch nick: dhis2
timestamp: Wed 2014-08-06 07:19:35 +0100
message:
  local/in Maintenance RBF work in progress
modified:
  
local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java
  
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm
  
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js
  
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataEntryForm.vm
  
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm
  
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/pbfReportForm.vm
  
local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScoreEntrySelection.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 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java	2014-07-28 09:27:00 +
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/dataentry/SaveValueAction.java	2014-08-06 06:19:35 +
@@ -354,16 +354,39 @@
 {
 if( valueType.equals("1") )
 {
-	pbfDataValue.setQuantityReported( Integer.parseInt( value ) );
+Integer intVal = null;
+if( value != null && !value.trim().equals( "" ) )
+{
+intVal = Integer.parseInt( value );
+}
+	pbfDataValue.setQuantityReported( intVal );
+	
+	System.out.println(" PBF Value 1 " + intVal );
 }
 else if( valueType.equals("2") )
 {
-	pbfDataValue.setQuantityValidated( Integer.parseInt( value ) );
+Integer intVal = null;
+if( value != null && !value.trim().equals( "" ) )
+{
+intVal = Integer.parseInt( value );
+}
+
+System.out.println(" PBF Value 2 " + intVal );
+
+	pbfDataValue.setQuantityValidated( intVal );
+	
 }
 
 else if( valueType.equals("3") )
 {
-pbfDataValue.setQuantityExternalVerification( Integer.parseInt( value ) );
+Integer intVal = null;
+if( value != null && !value.trim().equals( "" ) )
+{
+intVal = Integer.parseInt( value );
+}
+System.out.println(" PBF Value 3 " + intVal );
+
+pbfDataValue.setQuantityExternalVerification( intVal );
 }
 
 pbfDataValue.setStoredBy(storedBy);

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm	2014-08-04 06:49:50 +
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/dataEntrySelection.vm	2014-08-06 06:19:35 +
@@ -88,11 +88,13 @@
 	
 
 
-
+
 
 	
 		$i18n.getString( "organisation_unit" )
-		
+		
+		 
+		 
 	
 	
 	
@@ -105,6 +107,8 @@
 #end
 			
 		
+		 
+		 
 		
 	
 
@@ -120,7 +124,7 @@
 			
 		
 		
-		$i18n.getString( "Utilization Rate " )
+		$i18n.getString( "Utilization Rate " )
 	
 		
 			

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js	2014-08-04 06:49:50 +
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/pbfDataEntry.js	2014-08-06 06:19:35 +
@@ -159,15 +159,41 @@
 	var period = document.getElementById("selectedPeriodId").value;
 	var dataSetId = $( '#dataSetId' ).val();
 	var valueId = "";
+	
+	var qtyReportedFieldId = "pbfdv_qty_reported_"+dataElementId;
+	
+	var qtyValidatedFieldId = "pbfdv_qty_validated_"+dataElementId;
+	
+	var qtyRreported = document.getElementById( qtyReportedFieldId ).value;
+	
+	var qtyValidated = document.getElementById( qtyValidatedFieldId ).value;
+	
 	if( valueType == 1 )
 	{
 		valueId = "pbfdv_qty_reported_"+dataElementId;
 	}
+	
 	else if( valueType == 2 )
 	{
-		valueId = "pbfdv_qty_validated_"+dataElementId;
-		
-		saveDataInDataValue( dataElementId );
+		//alert( qtyRreported + ":" + qtyValidated )
+		
+		if(  parseInt(qtyValidated)  > parseInt(qtyRreported)   )
+		{
+