← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18790: Removed ProgramIndicator list from ProgramStage object.

 

------------------------------------------------------------
revno: 18790
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-03-31 23:25:10 +0700
message:
   Removed ProgramIndicator list from ProgramStage object.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.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/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2015-03-31 03:17:35 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2015-03-31 16:25:10 +0000
@@ -85,8 +85,6 @@
     @Scanned
     private Set<ProgramStageDataElement> programStageDataElements = new HashSet<>();
 
-    private List<ProgramIndicator> programIndicators = new ArrayList<>();
-
     @Scanned
     private Set<ProgramStageSection> programStageSections = new HashSet<>();
 
@@ -467,20 +465,6 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "programIndicators", namespace = DxfNamespaces.DXF_2_0 )
-    @JacksonXmlProperty( localName = "programIndicator", namespace = DxfNamespaces.DXF_2_0 )
-    public List<ProgramIndicator> getProgramIndicators()
-    {
-        return programIndicators;
-    }
-
-    public void setProgramIndicators( List<ProgramIndicator> programIndicators )
-    {
-        this.programIndicators = programIndicators;
-    }
-
-    @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Boolean getPreGenerateUID()
     {

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java	2015-03-30 07:56:29 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java	2015-03-31 16:25:10 +0000
@@ -315,6 +315,8 @@
         executeSql( "update userroleauthorities set authority='F_ADD_TRACKED_ENTITY_FORM' where authority='F_TRACKED_ENTITY_FORM_ADD'" );
 
         updateProgramExpressionUid();
+        
+        executeSql( "DROP TABLE programstage_programindicators" );
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml	2015-03-18 13:03:25 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml	2015-03-31 16:25:10 +0000
@@ -73,12 +73,6 @@
 
     <property name="preGenerateUID" />
 
-    <list name="programIndicators" table="programstage_programindicators">
-      <key column="programStageid" />
-      <list-index column="sort_order" base="1" />
-      <many-to-many class="org.hisp.dhis.program.ProgramIndicator" column="programindicatorid" />
-    </list>
-
     <property name="sortOrder" column="sort_order" />
 
     <many-to-one name="periodType" lazy="false" class="org.hisp.dhis.period.PeriodType" column="periodtypeid"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java	2015-03-19 05:16:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java	2015-03-31 16:25:10 +0000
@@ -28,7 +28,11 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 import org.apache.commons.lang3.StringUtils;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.dataelement.DataElement;
@@ -36,8 +40,6 @@
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramIndicator;
-import org.hisp.dhis.program.ProgramIndicatorService;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageDataElement;
@@ -49,10 +51,7 @@
 import org.hisp.dhis.user.UserGroupService;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import com.opensymphony.xwork2.Action;
 
 /**
  * @author Abyot Asalefew Gizaw
@@ -108,9 +107,6 @@
     }
 
     @Autowired
-    private ProgramIndicatorService programIndicatorService;
-
-    @Autowired
     private AttributeService attributeService;
 
     // -------------------------------------------------------------------------
@@ -325,13 +321,6 @@
         this.reportDateToUse = reportDateToUse;
     }
 
-    private List<Integer> selectedIndicators = new ArrayList<>();
-
-    public void setSelectedIndicators( List<Integer> selectedIndicators )
-    {
-        this.selectedIndicators = selectedIndicators;
-    }
-
     private Boolean preGenerateUID;
 
     public void setPreGenerateUID( Boolean preGenerateUID )
@@ -419,17 +408,6 @@
         programStage.setPreGenerateUID( preGenerateUID );
         programStage.setSortOrder( program.getProgramStages().size() + 1 );
 
-        // Program indicators
-
-        List<ProgramIndicator> programIndicators = new ArrayList<>();
-        for ( Integer id : selectedIndicators )
-        {
-            ProgramIndicator indicator = programIndicatorService.getProgramIndicator( id );
-            programIndicators.add( indicator );
-        }
-
-        programStage.setProgramIndicators( programIndicators );
-
         // SMS Reminder
 
         Set<TrackedEntityInstanceReminder> reminders = new HashSet<>();

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java	2015-03-29 20:22:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java	2015-03-31 16:25:10 +0000
@@ -38,7 +38,6 @@
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
-import org.hisp.dhis.program.ProgramIndicator;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageDataElement;
 import org.hisp.dhis.program.ProgramStageService;
@@ -127,13 +126,6 @@
         this.userGroups = userGroups;
     }
 
-    private List<ProgramIndicator> programIndicators;
-
-    public List<ProgramIndicator> getProgramIndicators()
-    {
-        return programIndicators;
-    }
-
     private List<PeriodType> periodTypes = new ArrayList<>();
 
     public List<PeriodType> getPeriodTypes()
@@ -176,9 +168,6 @@
 
         userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
 
-        programIndicators = new ArrayList<>( programStage.getProgram().getProgramIndicators() );
-        programIndicators.removeAll( programStage.getProgramIndicators() );
-
         attributeValues = AttributeUtils.getAttributeValueMap( programStage.getAttributeValues() );
         attributes = new ArrayList<>( attributeService.getProgramStageAttributes() );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageAction.java	2015-03-29 20:22:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/ShowAddProgramStageAction.java	2015-03-31 16:25:10 +0000
@@ -43,7 +43,6 @@
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramIndicator;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.user.UserGroup;
 import org.hisp.dhis.user.UserGroupService;
@@ -135,13 +134,6 @@
         return userGroups;
     }
 
-    private List<ProgramIndicator> programIndicators;
-
-    public List<ProgramIndicator> getProgramIndicators()
-    {
-        return programIndicators;
-    }
-
     private List<Constant> constants;
 
     public List<Constant> getConstants()
@@ -179,12 +171,7 @@
 
         userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );
 
-        programIndicators = new ArrayList<>( program.getProgramIndicators() );
-
-        Collections.sort( programIndicators, IdentifiableObjectNameComparator.INSTANCE );
-
-        constants = new ArrayList<>( constantService.getAllConstants() );
-
+        constants = new ArrayList<>( constantService.getAllConstants());        
         Collections.sort( constants, IdentifiableObjectNameComparator.INSTANCE );
 
         attributes = new ArrayList<>( attributeService.getProgramStageAttributes() );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java	2015-03-19 05:16:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java	2015-03-31 16:25:10 +0000
@@ -35,8 +35,6 @@
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
-import org.hisp.dhis.program.ProgramIndicator;
-import org.hisp.dhis.program.ProgramIndicatorService;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageDataElement;
 import org.hisp.dhis.program.ProgramStageDataElementService;
@@ -98,9 +96,6 @@
     }
 
     @Autowired
-    private ProgramIndicatorService programIndicatorService;
-
-    @Autowired
     private AttributeService attributeService;
 
     // -------------------------------------------------------------------------
@@ -317,13 +312,6 @@
         this.reportDateToUse = reportDateToUse;
     }
 
-    private List<Integer> selectedIndicators = new ArrayList<>();
-
-    public void setSelectedIndicators( List<Integer> selectedIndicators )
-    {
-        this.selectedIndicators = selectedIndicators;
-    }
-
     private Boolean preGenerateUID;
 
     public void setPreGenerateUID( Boolean preGenerateUID )
@@ -409,17 +397,6 @@
         programStage.setValidCompleteOnly( validCompleteOnly );
         programStage.setCaptureCoordinates( captureCoordinates );
 
-        // Program indicators
-
-        List<ProgramIndicator> programIndicators = new ArrayList<>();
-        for ( Integer id : selectedIndicators )
-        {
-            ProgramIndicator indicator = programIndicatorService.getProgramIndicator( id );
-            programIndicators.add( indicator );
-        }
-
-        programStage.setProgramIndicators( programIndicators );
-
         // SMS Reminder
 
         programStage.getReminders().clear();

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm	2015-03-19 11:14:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm	2015-03-31 16:25:10 +0000
@@ -14,8 +14,6 @@
       'beforeValidateHandler': function() {
         #tblDynamicAttributesJavascript()
 
-        selectAllById('selectedIndicators');
-
         var selectedDataElementsValidator = jQuery("#selectedDataElementsValidator");
         selectedDataElementsValidator.empty();
 
@@ -315,42 +313,6 @@
     </tbody>
 </table>
 
-<table>
-	<colgroup>
-		<col style='width:500px'/>
-		<col/>
-		<col style='width:500px'/>
-	</colgroup>
-	<tr>
-		<th>$i18n.getString( "available_indicators" )</th>
-		<th>$i18n.getString( "filter" )</th>
-		<th>$i18n.getString( "selected_indicators" )</th>
-	</tr>
-	
-	<tr>
-		<td>
-			<select style="height: 200px; width: 100%;" multiple="multiple" id="availableIndicators" name="availableIndicators" ondblclick="moveSelectedById( 'availableIndicators', 'selectedIndicators' )" >
-				#foreach( $indicator in $programIndicators )
-					<option value="$indicator.id">$encoder.htmlEncode( $indicator.displayName )</option>
-				#end
-			</select>
-		</td>
-		<td>
-			<input type="button" value="&gt;" title="$i18n.getString('move_selected')" onclick="moveSelectedById( 'availableIndicators', 'selectedIndicators' )" class='filterButton'/><br/>
-			<input type="button" value="&lt;" title="$i18n.getString('remove_selected')" onclick="moveSelectedById( 'selectedIndicators', 'availableIndicators' )" class='filterButton'/><br/>
-			<input type="button" value="&gt;&gt;" onclick="moveAllById( 'availableIndicators', 'selectedIndicators' )" class='filterButton' /><br/>
-			<input type="button" value="&lt;&lt;" onclick="moveAllById( 'selectedIndicators', 'availableIndicators' )" class='filterButton' />
-		</td>
-		<td>
-			<select style="height: 200px; width: 100%; margin-top: 22px;" multiple="multiple" id="selectedIndicators" name="selectedIndicators" ondblclick="moveSelectedById( 'selectedIndicators', 'availableIndicators' )"></select>
-		</td>
-		<td>
-			<a href="javascript:moveUpSelectedOption( 'selectedIndicators')" title="$i18n.getString( 'move_up' )"><img src="../images/move_up.png" alt="$i18n.getString( 'move_up' )"/></a><br/><br/>
-			<a href="javascript:moveDownSelectedOption( 'selectedIndicators' )" title="$i18n.getString( 'move_down' )"><img src="../images/move_down.png" alt="$i18n.getString( 'move_up' )"/></a>
-		</td>
-	</tr>
-</table>
-
 <p>
 	<input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
 	<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='programStage.action?id=$program.id'" style="width:10em"/>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm	2015-03-10 15:09:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm	2015-03-31 16:25:10 +0000
@@ -48,12 +48,12 @@
 	</tr>	
 	<tr>
 		<td><label for="code">$i18n.getString( "code" )</label></td>
-		<td><input type="text" id="code" name="code" value='$encoder.htmlEncode($programIndicator.code)'></td>
+		<td><input type="text" id="code" name="code" value='$!encoder.htmlEncode($programIndicator.code)'></td>
 		<td></td>
 	</tr>	
 	<tr>
 		<td><label for="description">$i18n.getString( "description" ) </label></td>
-		<td><textarea type="text" id="description" name="description">$encoder.htmlEncode($programIndicator.description)</textarea></td>
+		<td><textarea type="text" id="description" name="description">$!encoder.htmlEncode($programIndicator.description)</textarea></td>
 		<td></td>
 	</tr>
 	<tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm	2015-03-31 05:00:23 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm	2015-03-31 16:25:10 +0000
@@ -17,7 +17,6 @@
    		{
         #tblDynamicAttributesJavascript()
 
-   			selectAllById('selectedIndicators');
 			
 			if( byId('periodTypeName') != null ){
 				var periodType = byId('periodTypeName').value;
@@ -362,47 +361,6 @@
 		
 	</table>
 	
-
-<table>
-	<colgroup>
-		<col style='width:500px'/>
-		<col/>
-		<col style='width:500px'/>
-	</colgroup>
-	<tr>
-		<th>$i18n.getString( "available_indicators" )</th>
-		<th>$i18n.getString( "filter" )</th>
-		<th>$i18n.getString( "selected_indicators" )</th>
-	</tr>
-	
-	<tr>
-		<td>
-			<select style="height: 200px; width: 100%;" multiple="multiple" id="availableIndicators" name="availableIndicators" ondblclick="moveSelectedById( 'availableIndicators', 'selectedIndicators' )" >
-				#foreach( $indicator in $programIndicators )
-					<option value="$indicator.id">$encoder.htmlEncode( $indicator.displayName )</option>
-				#end
-			</select>
-		</td>
-		<td>
-			<input type="button" value="&gt;" title="$i18n.getString('move_selected')" onclick="dhisAjaxSelect_moveAllSelected( 'availableIndicators', 'selectedIndicators' )" class='filterButton'/><br/>
-			<input type="button" value="&lt;" title="$i18n.getString('remove_selected')" onclick="dhisAjaxSelect_moveAllSelected( 'selectedIndicators', 'availableIndicators' )" class='filterButton'/><br/>
-			<input type="button" value="&gt;&gt;" onclick="moveAllById( 'availableIndicators', 'selectedIndicators' )" class='filterButton' /><br/>
-			<input type="button" value="&lt;&lt;" onclick="moveAllById( 'selectedIndicators', 'availableIndicators' )" class='filterButton' />
-		</td>
-		<td>
-			<select style="height: 200px; width: 100%; margin-top: 22px;" multiple="multiple" id="selectedIndicators" name="selectedIndicators" ondblclick="moveSelectedById( 'selectedIndicators', 'availableIndicators' )" >
-				#foreach( $indicator in $programStage.programIndicators )
-					<option value="$indicator.id">$encoder.htmlEncode( $indicator.displayName )</option>
-				#end
-			</select>
-		</td>
-		<td>
-			<a href="javascript:moveUpSelectedOption( 'selectedIndicators')" title="$i18n.getString( 'move_up' )"><img src="../images/move_up.png" alt="$i18n.getString( 'move_up' )"/></a><br/><br/>
-			<a href="javascript:moveDownSelectedOption( 'selectedIndicators' )" title="$i18n.getString( 'move_down' )"><img src="../images/move_down.png" alt="$i18n.getString( 'move_up' )"/></a>
-		</td>
-	</tr> 
-</table>
-
 <p>
   <input type="submit" value="$i18n.getString( 'update' )" style="width:10em">
   <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='programStage.action?id=$programStage.program.id'" style="width:10em"/>