dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30784
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15648: minor fixes to ProgramStageDataElement
------------------------------------------------------------
revno: 15648
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-06-12 11:53:18 +0200
message:
minor fixes to ProgramStageDataElement
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java
dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageSectionAction.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/ProgramStageDataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java 2014-05-30 08:45:46 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java 2014-06-12 09:53:18 +0000
@@ -81,6 +81,10 @@
// Constructors
// -------------------------------------------------------------------------
+ public ProgramStageDataElement()
+ {
+ }
+
public ProgramStageDataElement( ProgramStage programStage, DataElement dataElement, boolean compulsory )
{
this.programStage = programStage;
@@ -97,10 +101,10 @@
this.sortOrder = sortOrder;
}
- public ProgramStageDataElement()
- {
- }
-
+ @JsonProperty
+ @JsonSerialize( as = BaseIdentifiableObject.class )
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public ProgramStage getProgramStage()
{
return programStage;
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml 2013-09-16 17:07:25 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml 2014-06-12 09:53:18 +0000
@@ -14,14 +14,14 @@
</composite-id>
<property name="compulsory" column="compulsory" not-null="true" />
-
- <property name="allowProvidedElsewhere" column="allowprovidedelsewhere" />
-
- <property name="sortOrder" column="sort_order" />
-
- <property name="displayInReports"/>
-
- <property name="allowDateInFuture"/>
+
+ <property name="allowProvidedElsewhere" column="allowprovidedelsewhere" />
+
+ <property name="sortOrder" column="sort_order" />
+
+ <property name="displayInReports" />
+
+ <property name="allowDateInFuture" />
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageSectionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageSectionAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageSectionAction.java 2014-06-12 09:53:18 +0000
@@ -28,11 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.program.ProgramStage;
@@ -41,11 +37,13 @@
import org.hisp.dhis.program.ProgramStageSection;
import org.hisp.dhis.program.ProgramStageService;
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
/**
* @author Chau Thu Tran
- *
* @version AddProgramStageSectionAction.java 11:29:40 AM Aug 22, 2012 $
*/
public class AddProgramStageSectionAction
@@ -136,10 +134,12 @@
// ---------------------------------------------------------------------
Set<ProgramStageSection> sections = programStage.getProgramStageSections();
+
if ( sections == null )
{
sections = new HashSet<ProgramStageSection>();
}
+
sections.add( section );
programStage.setProgramStageSections( sections );