← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21575: renamed PI/PSI completedUser -> completedBy

 

------------------------------------------------------------
revno: 21575
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2016-01-04 21:27:34 +0700
message:
  renamed PI/PSI completedUser -> completedBy
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/InitTableAlteror.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramInstance.hbm.xml
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/Event.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.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/ProgramInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java	2016-01-04 14:27:34 +0000
@@ -84,7 +84,7 @@
 
     private List<TrackedEntityComment> comments = new ArrayList<>();
     
-    private String completedUser;
+    private String completedBy;
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -407,13 +407,13 @@
         this.comments = comments;
     }
 
-    public String getCompletedUser()
+    public String getCompletedBy()
     {
-        return completedUser;
+        return completedBy;
     }
 
-    public void setCompletedUser( String completedUser )
+    public void setCompletedBy( String completedBy )
     {
-        this.completedUser = completedUser;
+        this.completedBy = completedBy;
     }  
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java	2016-01-04 14:27:34 +0000
@@ -71,10 +71,10 @@
 
     private Double latitude;
 
-    private String completedUser;
+    private String completedBy;
 
     private Date completedDate;
-    
+
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -114,14 +114,14 @@
         this.programStage = programStage;
     }
 
-    public String getCompletedUser()
+    public String getCompletedBy()
     {
-        return completedUser;
+        return completedBy;
     }
 
-    public void setCompletedUser( String completedUser )
+    public void setCompletedBy( String completedBy )
     {
-        this.completedUser = completedUser;
+        this.completedBy = completedBy;
     }
 
     public Date getDueDate()
@@ -158,7 +158,7 @@
     {
         this.organisationUnit = organisationUnit;
     }
-    
+
     public DataElementCategoryOptionCombo getAttributeOptionCombo()
     {
         return attributeOptionCombo;
@@ -236,7 +236,7 @@
 
     public EventStatus getStatus()
     {
-       return status;
+        return status;
     }
 
     public EventStatus getEventStatus()

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2016-01-04 14:27:34 +0000
@@ -570,7 +570,7 @@
 
         programInstance.setStatus( ProgramStatus.COMPLETED );
         programInstance.setEndDate( new Date() );
-        programInstance.setCompletedUser( currentUserService.getCurrentUsername() );
+        programInstance.setCompletedBy( currentUserService.getCurrentUsername() );
 
         updateProgramInstance( programInstance );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2016-01-04 14:27:34 +0000
@@ -190,7 +190,7 @@
 
         programStageInstance.setStatus( EventStatus.COMPLETED );
         programStageInstance.setCompletedDate( date );
-        programStageInstance.setCompletedUser( currentUserService.getCurrentUsername() );
+        programStageInstance.setCompletedBy( currentUserService.getCurrentUsername() );
 
         // ---------------------------------------------------------------------
         // Send sms-message when to completed the event

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/InitTableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/InitTableAlteror.java	2016-01-04 10:26:11 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/InitTableAlteror.java	2016-01-04 14:27:34 +0000
@@ -80,12 +80,22 @@
         updateProgramStatus();
         updateSmtpPasswordColumn();
         updateTimestamps();
+        updateCompletedBy();
 
         executeSql( "ALTER TABLE program ALTER COLUMN \"type\" TYPE varchar(255);" );
         executeSql( "update program set \"type\"='WITH_REGISTRATION' where type='1' or type='2'" );
         executeSql( "update program set \"type\"='WITHOUT_REGISTRATION' where type='3'" );
     }
 
+    private void updateCompletedBy()
+    {
+        executeSql( "update programinstance set completedby=completeduser where completedby is null" );
+        executeSql( "update programstageinstance set completedby=completeduser where completedby is null" );
+
+        executeSql( "alter table programinstance drop column completeduser" );
+        executeSql( "alter table programstageinstance drop column completeduser" );
+    }
+
     // -------------------------------------------------------------------------
     // Supportive methods
     // -------------------------------------------------------------------------
@@ -98,7 +108,7 @@
             executeSql( "ALTER TABLE configuration DROP COLUMN smptpassword" );
 
         }
-        catch(Exception ex)
+        catch ( Exception ex )
         {
             log.debug( ex );
         }
@@ -117,6 +127,7 @@
         executeSql( "update trackedentityattributevalue set created=now() where created is null" );
         executeSql( "update trackedentityattributevalue set lastupdated=now() where lastupdated is null" );
     }
+
     private void updateProgramStatus()
     {
         executeSql( "alter table programinstance alter column status type varchar(50)" );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2016-01-04 10:26:11 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2016-01-04 14:27:34 +0000
@@ -716,7 +716,6 @@
         executeSql( "update program set categorycomboid = " + defaultCategoryComboId + " where categorycomboid is null" );
         executeSql( "update programstageinstance set attributeoptioncomboid = " + defaultOptionComboId + " where attributeoptioncomboid is null" );
 
-
         executeSql( "ALTER TABLE datavalue ALTER COLUMN lastupdated TYPE timestamp" );
         executeSql( "ALTER TABLE completedatasetregistration ALTER COLUMN date TYPE timestamp" );
         executeSql( "ALTER TABLE message ALTER COLUMN userid DROP NOT NULL" );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramInstance.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramInstance.hbm.xml	2015-11-20 11:38:58 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramInstance.hbm.xml	2016-01-04 14:27:34 +0000
@@ -24,7 +24,7 @@
 
     <property name="followup" column="followup" />
     
-    <property name="completedUser" />
+    <property name="completedBy" />
 
     <property name="status" length="50">
       <type name="org.hibernate.type.EnumType">

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml	2015-09-02 14:18:36 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml	2016-01-04 14:27:34 +0000
@@ -53,7 +53,7 @@
 
     <property name="latitude" />
 
-    <property name="completedUser" />
+    <property name="completedBy" />
 
     <property name="completedDate" />
 

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java	2016-01-04 14:27:34 +0000
@@ -174,7 +174,7 @@
         enrollment.setIncidentDate( programInstance.getIncidentDate() );
         enrollment.setFollowup( programInstance.getFollowup() );
         enrollment.setCompletedDate( programInstance.getEndDate() );
-        enrollment.setCompletedUser( programInstance.getCompletedUser() );
+        enrollment.setCompletedBy( programInstance.getCompletedBy() );
 
         List<TrackedEntityComment> comments = programInstance.getComments();
 

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/Enrollment.java	2016-01-04 14:27:34 +0000
@@ -72,7 +72,7 @@
 
     private Boolean followup;
     
-    private String completedUser;
+    private String completedBy;
 
     private Date completedDate;
 
@@ -238,14 +238,14 @@
 
     @JsonProperty
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public String getCompletedUser()
+    public String getCompletedBy()
     {
-        return completedUser;
+        return completedBy;
     }
 
-    public void setCompletedUser( String completedUser )
+    public void setCompletedBy( String completedBy )
     {
-        this.completedUser = completedUser;
+        this.completedBy = completedBy;
     }
 
     @JsonProperty
@@ -277,7 +277,7 @@
         if ( program != null ? !program.equals( that.program ) : that.program != null ) return false;
         if ( status != that.status ) return false;
         if ( notes != null ? !notes.equals( that.notes ) : that.notes != null ) return false;
-        if ( completedUser != null ? !completedUser.equals( that.completedUser ) : that.completedUser != null ) return false;
+        if ( completedBy != null ? !completedBy.equals( that.completedBy ) : that.completedBy != null ) return false;
         if ( completedDate != null ? !completedDate.equals( that.completedDate ) : that.completedDate != null ) return false;
 
         return true;
@@ -294,7 +294,7 @@
         result = 31 * result + (incidentDate != null ? incidentDate.hashCode() : 0);
         result = 31 * result + (attributes != null ? attributes.hashCode() : 0);
         result = 31 * result + (notes != null ? notes.hashCode() : 0);
-        result = 31 * result + (completedUser != null ? completedUser.hashCode() : 0);
+        result = 31 * result + (completedBy != null ? completedBy.hashCode() : 0);
         result = 31 * result + (completedDate != null ? completedDate.hashCode() : 0);
         return result;
     }
@@ -311,7 +311,7 @@
             ", incidentDate=" + incidentDate +
             ", attributes=" + attributes +
             ", notes=" + notes +
-            ", completedUser=" + completedUser +
+            ", completedBy=" + completedBy +
             ", completedDate=" + completedDate +
             '}';
     }

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java	2016-01-04 14:27:34 +0000
@@ -662,13 +662,13 @@
         {
             programStageInstance.setStatus( EventStatus.ACTIVE );
             programStageInstance.setCompletedDate( null );
-            programStageInstance.setCompletedUser( null );
+            programStageInstance.setCompletedBy( null );
         }
         else if ( event.getStatus() == EventStatus.COMPLETED )
         {
             programStageInstance.setCompletedDate( executionDate );
             programStageInstance.setStatus( EventStatus.COMPLETED );
-            programStageInstance.setCompletedUser( storedBy );
+            programStageInstance.setCompletedBy( storedBy );
 
             if ( !programStageInstance.isCompleted() )
             {
@@ -867,7 +867,7 @@
         event.setStatus( programStageInstance.getStatus() );
         event.setEventDate( DateUtils.getLongDateString( programStageInstance.getExecutionDate() ) );
         event.setDueDate( DateUtils.getLongDateString( programStageInstance.getDueDate() ) );
-        event.setStoredBy( programStageInstance.getCompletedUser() );
+        event.setStoredBy( programStageInstance.getCompletedBy() );
         event.setCompletedDate( DateUtils.getLongDateString( programStageInstance.getCompletedDate() ) );
 
         UserCredentials userCredentials = currentUserService.getCurrentUser().getUserCredentials();
@@ -1123,7 +1123,7 @@
         {
             programStageInstance.setStatus( EventStatus.COMPLETED );
             programStageInstance.setCompletedDate( new Date() );
-            programStageInstance.setCompletedUser( storedBy );
+            programStageInstance.setCompletedBy( storedBy );
             programStageInstanceService.completeProgramStageInstance( programStageInstance, i18nManager.getI18nFormat() );
         }
     }

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/Event.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/Event.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/Event.java	2016-01-04 14:27:34 +0000
@@ -85,7 +85,7 @@
 
     private String attributeCategoryOptions;
 
-    private String completedUser;
+    private String completedBy;
 
     private String completedDate;
 
@@ -325,14 +325,14 @@
 
     @JsonProperty
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public String getCompletedUser()
+    public String getCompletedBy()
     {
-        return completedUser;
+        return completedBy;
     }
 
-    public void setCompletedUser( String completedUser )
+    public void setCompletedBy( String completedBy )
     {
-        this.completedUser = completedUser;
+        this.completedBy = completedBy;
     }
 
     @JsonProperty
@@ -382,7 +382,7 @@
             ", coordinate=" + coordinate +
             ", dataValues=" + dataValues +
             ", attributeCategoryOptions=" + attributeCategoryOptions +
-            ", completedUser=" + completedUser +
+            ", completedBy=" + completedBy +
             ", completedDate=" + completedDate +
             '}';
     }

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.java	2016-01-04 14:27:34 +0000
@@ -119,14 +119,14 @@
 
                 event.setTrackedEntityInstance( rowSet.getString( "tei_uid" ) );
 
-                event.setStoredBy( rowSet.getString( "psi_completeduser" ) );
+                event.setStoredBy( rowSet.getString( "psi_completedby" ) );
                 event.setOrgUnitName( rowSet.getString( "ou_name" ) );
                 event.setDueDate( DateUtils.getLongGmtDateString( rowSet.getDate( "psi_duedate" ) ) );
                 event.setEventDate( DateUtils.getLongGmtDateString( rowSet.getDate( "psi_executiondate" ) ) );
                 event.setCreated( DateUtils.getLongGmtDateString( rowSet.getDate( "psi_created" ) ) );
                 event.setLastUpdated( DateUtils.getLongGmtDateString( rowSet.getDate( "psi_lastupdated" ) ) );
 
-                event.setCompletedUser( rowSet.getString( "psi_completeduser" ) );
+                event.setCompletedBy( rowSet.getString( "psi_completedby" ) );
                 event.setCompletedDate( DateUtils.getLongGmtDateString( rowSet.getDate( "psi_completeddate" ) ) );
 
                 if ( rowSet.getBoolean( "ps_capturecoordinates" ) )
@@ -345,7 +345,7 @@
         SqlHelper hlp = new SqlHelper();
 
         String sql =
-            "select psi.programstageinstanceid as psi_id, psi.uid as psi_uid, psi.status as psi_status, psi.executiondate as psi_executiondate, psi.duedate as psi_duedate, psi.completeduser as psi_completeduser, " +
+            "select psi.programstageinstanceid as psi_id, psi.uid as psi_uid, psi.status as psi_status, psi.executiondate as psi_executiondate, psi.duedate as psi_duedate, psi.completedby as psi_completedby, " +
                 "psi.longitude as psi_longitude, psi.latitude as psi_latitude, psi.created as psi_created, psi.lastupdated as psi_lastupdated, psi.completeddate as psi_completeddate, " +
                 "pi.uid as pi_uid, pi.status as pi_status, pi.followup as pi_followup, p.uid as p_uid, p.code as p_code, " +
                 "p.type as p_type, ps.uid as ps_uid, ps.code as ps_code, ps.capturecoordinates as ps_capturecoordinates, " +