dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22238
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10660: Added field dataDimension to DataElementCategory. Cleaned up some vm forms.
------------------------------------------------------------
revno: 10660
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-04-22 12:01:08 +0200
message:
Added field dataDimension to DataElementCategory. Cleaned up some vm forms.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.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/dataelement/hibernate/DataElementCategory.hbm.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/AddDataElementCategoryAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryOptionForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryOptionForm.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/dataelement/DataElementCategory.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java 2013-03-01 10:18:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java 2013-04-22 10:01:08 +0000
@@ -64,6 +64,8 @@
public static final String DEFAULT_NAME = "default";
+ private boolean dataDimension;
+
private Concept concept;
@Scanned
@@ -174,7 +176,7 @@
}
// ------------------------------------------------------------------------
- // Getters and setters
+ // Logic
// ------------------------------------------------------------------------
@Override
@@ -183,25 +185,27 @@
return name != null && name.equals( DEFAULT_NAME );
}
- @JsonProperty
- @JsonSerialize( contentAs = BaseIdentifiableObject.class )
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlElementWrapper( localName = "categoryOptions", namespace = DxfNamespaces.DXF_2_0)
- @JacksonXmlProperty( localName = "categoryOption", namespace = DxfNamespaces.DXF_2_0)
- public List<DataElementCategoryOption> getCategoryOptions()
- {
- return categoryOptions;
- }
-
- public void setCategoryOptions( List<DataElementCategoryOption> categoryOptions )
- {
- this.categoryOptions = categoryOptions;
- }
-
- @JsonProperty
- @JsonSerialize( contentAs = BaseIdentifiableObject.class )
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+ // ------------------------------------------------------------------------
+ // Getters and setters
+ // ------------------------------------------------------------------------
+
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public boolean isDataDimension()
+ {
+ return dataDimension;
+ }
+
+ public void setDataDimension( boolean dataDimension )
+ {
+ this.dataDimension = dataDimension;
+ }
+
+ @JsonProperty
+ @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+ @JsonView( {DetailedView.class, ExportView.class} )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
@JsonInclude( JsonInclude.Include.NON_NULL )
public Concept getConcept()
{
@@ -213,6 +217,21 @@
this.concept = concept;
}
+ @JsonProperty
+ @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+ @JsonView( {DetailedView.class, ExportView.class} )
+ @JacksonXmlElementWrapper( localName = "categoryOptions", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "categoryOption", namespace = DxfNamespaces.DXF_2_0 )
+ public List<DataElementCategoryOption> getCategoryOptions()
+ {
+ return categoryOptions;
+ }
+
+ public void setCategoryOptions( List<DataElementCategoryOption> categoryOptions )
+ {
+ this.categoryOptions = categoryOptions;
+ }
+
@Override
public void mergeWith( IdentifiableObject other )
{
=== 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 2013-04-19 10:20:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2013-04-22 10:01:08 +0000
@@ -559,6 +559,7 @@
executeSql( "UPDATE map SET publicaccess='-------' WHERE user IS NULL AND publicaccess IS NULL;" );
executeSql( "ALTER TABLE dataelement ALTER COLUMN domaintype SET NOT NULL" );
+ executeSql( "update dataelementcategory set datadimension = false where datadimension is null" );
log.info( "Tables updated" );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategory.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategory.hbm.xml 2013-02-22 11:39:14 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategory.hbm.xml 2013-04-22 10:01:08 +0000
@@ -17,6 +17,8 @@
<property name="name" column="name" not-null="true" unique="true" length="230" />
+ <property name="dataDimension" />
+
<many-to-one name="concept" class="org.hisp.dhis.concept.Concept" column="conceptid"
foreign-key="fk_dataelementcategory_conceptid" />
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/AddDataElementCategoryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/AddDataElementCategoryAction.java 2013-02-25 12:33:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/AddDataElementCategoryAction.java 2013-04-22 10:01:08 +0000
@@ -71,6 +71,13 @@
{
this.name = name;
}
+
+ private boolean dataDimension;
+
+ public void setDataDimension( boolean dataDimension )
+ {
+ this.dataDimension = dataDimension;
+ }
private Integer conceptId;
@@ -94,6 +101,7 @@
{
DataElementCategory dataElementCategory = new DataElementCategory();
dataElementCategory.setName( name );
+ dataElementCategory.setDataDimension( dataDimension );
dataElementCategory.setConcept( conceptService.getConcept( conceptId ) );
List<DataElementCategoryOption> options = new ArrayList<DataElementCategoryOption>();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java 2013-02-25 12:33:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java 2013-04-22 10:01:08 +0000
@@ -79,6 +79,13 @@
this.name = name;
}
+ private boolean dataDimension;
+
+ public void setDataDimension( boolean dataDimension )
+ {
+ this.dataDimension = dataDimension;
+ }
+
private Integer conceptId;
public void setConceptId( Integer conceptId )
@@ -101,6 +108,7 @@
{
DataElementCategory dataElementCategory = dataElementCategoryService.getDataElementCategory( id );
dataElementCategory.setName( name );
+ dataElementCategory.setDataDimension( dataDimension );
dataElementCategory.setConcept( conceptService.getConcept( conceptId ) );
List<DataElementCategoryOption> options = new ArrayList<DataElementCategoryOption>();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2013-02-26 02:41:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2013-04-22 10:01:08 +0000
@@ -203,4 +203,5 @@
create_new_data_element_category_option=Create new data element category option
edit_data_element_category_option=Edit data element category option
available_category_options=Available category options
-selected_category_options=Selected category options
\ No newline at end of file
+selected_category_options=Selected category options
+use_as_data_dimension=Use as data dimension
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm 2012-11-07 14:39:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm 2013-04-22 10:01:08 +0000
@@ -27,7 +27,7 @@
<h3>$i18n.getString( "create_new_data_element_category_combo" )</h3>
-<form id="addDataElementCategoryComboForm" name="addDataElementCategoryComboForm" action="addDataElementCategoryCombo.action" method="post" >
+<form id="addDataElementCategoryComboForm" name="addDataElementCategoryComboForm" action="addDataElementCategoryCombo.action" method="post" class="inputForm">
<table id="detailsList">
<thead>
<tr>
@@ -37,7 +37,7 @@
<tbody>
<tr>
<td style="width:120px"><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" style="width:20em"/></td>
+ <td><input type="text" id="name" name="name" /></td>
</tr>
<tr>
<td><label>$i18n.getString( "skip_total_in_reports" )</label></td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm 2013-02-22 11:39:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm 2013-04-22 10:01:08 +0000
@@ -32,20 +32,24 @@
<h3>$i18n.getString( "create_new_data_element_category" )</h3>
-<form id="addDataElementCategoryForm" name="addDataElementCategoryForm" action="addDataElementCategory.action" method="post">
+<form id="addDataElementCategoryForm" name="addDataElementCategoryForm" action="addDataElementCategory.action" method="post" class="inputForm">
<table>
<tr>
- <th colspan="4">$i18n.getString( "details" )</th>
+ <th colspan="2">$i18n.getString( "details" )</th>
</tr>
<tr>
<td><label>$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td colspan="3"><input type="text" id="name" name="name" style="width:25em"/></td>
- </tr>
+ <td><input type="text" id="name" name="name"/></td>
+ </tr>
+ <tr>
+ <td><label for="dataDimension">$i18n.getString( "use_as_data_dimension" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+ <td><input type="checkbox" id="dataDimension" name="dataDimension" value="true" /></td>
+ </tr>
<tr>
<td><label>$i18n.getString( "concept_name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td colspan="3">
<div style="inline">
- <select id="conceptId" name="conceptId" style="width:305px">
+ <select id="conceptId" name="conceptId">
#foreach( $concept in $concepts )
<option value="$concept.id">$concept.name</option>
#end
@@ -54,7 +58,7 @@
</td>
</tr>
<tr>
- <td colspan="4" style="height:15px"></td>
+ <td colspan="2" style="height:15px"></td>
</tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryOptionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryOptionForm.vm 2013-02-22 08:14:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryOptionForm.vm 2013-04-22 10:01:08 +0000
@@ -15,18 +15,18 @@
<h3>$i18n.getString( "create_new_data_element_category_option" )</h3>
-<form id="addDataElementCategoryOptionForm" name="addDataElementCategoryOptionForm" action="addDataElementCategoryOption.action" method="post">
+<form id="addDataElementCategoryOptionForm" name="addDataElementCategoryOptionForm" action="addDataElementCategoryOption.action" method="post" class="inputForm">
<table>
<tr>
<th colspan="4">$i18n.getString( "details" )</th>
</tr>
<tr>
<td><label>$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td colspan="3"><input type="text" id="name" name="name" style="width:25em" class="{validate:{required:true,rangelength:[2,150]}}"/></td>
+ <td colspan="3"><input type="text" id="name" name="name" class="{validate:{required:true,rangelength:[2,150]}}"/></td>
</tr>
<tr>
<td><label>$i18n.getString( "code" )</td>
- <td colspan="3"><input type="text" id="code" name="code" style="width:25em"/></td>
+ <td colspan="3"><input type="text" id="code" name="code"/></td>
</tr>
<tr>
<td><label>$i18n.getString( "concept_name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm 2013-01-28 06:47:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm 2013-04-22 10:01:08 +0000
@@ -30,7 +30,7 @@
<h3>$i18n.getString( "edit_data_element_category_combo" )</h3>
-<form id="editDataElementCategoryComboForm" name="editDataElementCategoryComboForm" action="updateDataElementCategoryCombo.action" method="post" >
+<form id="editDataElementCategoryComboForm" name="editDataElementCategoryComboForm" action="updateDataElementCategoryCombo.action" method="post" class="inputForm">
<input type="hidden" id="id" name="id" value="$dataElementCategoryCombo.id"/>
<table id="detailsList">
@@ -42,7 +42,7 @@
<tbody>
<tr>
<td style="width:120px"><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" style="width:20em" value="$encoder.htmlEncode( $dataElementCategoryCombo.displayName )"/></td>
+ <td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $dataElementCategoryCombo.displayName )"/></td>
</tr>
<tr>
<td><label>$i18n.getString( "skip_total_in_reports" )</label></td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.vm 2013-02-22 11:39:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.vm 2013-04-22 10:01:08 +0000
@@ -34,35 +34,37 @@
<h3>$i18n.getString( "edit_data_element_category" )</h3>
-<form id="editDataElementCategoryForm" name="editDataElementCategoryForm" action="updateDataElementCategory.action" method="post">
+<form id="editDataElementCategoryForm" name="editDataElementCategoryForm" action="updateDataElementCategory.action" method="post" class="inputForm">
<input type="hidden" id="id" name="id" value="$dataElementCategory.id"/>
<table>
<tr>
- <th colspan="4">$i18n.getString( "details" )</th>
+ <th colspan="2">$i18n.getString( "details" )</th>
</tr>
<tr>
<td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" value="$!encoder.htmlEncode( $dataElementCategory.name )" style="width:25em"/></td>
- <td></td>
- </tr>
+ <td><input type="text" id="name" name="name" value="$!encoder.htmlEncode( $dataElementCategory.name )"/></td>
+ </tr>
+ <tr>
+ <td><label for="dataDimension">$i18n.getString( "use_as_data_dimension" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+ <td><input type="checkbox" id="dataDimension" name="dataDimension" value="true"#if( $dataElementCategory.dataDimension ) checked="checked"#end/></td>
+ </tr>
<tr>
<td><label>$i18n.getString( "concept_name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td>
<div style="inline">
#set ( $conceptId = $!dataElementCategory.concept.id )
- <select id="conceptId" name="conceptId" style="width:305px">
+ <select id="conceptId" name="conceptId">
#foreach( $concept in $concepts )
<option value="$concept.id" #if ( $concept.id == $conceptId ) selected #end>$concept.name</option>
#end
</select>
</div>
</td>
- <td></td>
</tr>
<tr>
- <td colspan="4" style="height:15px"></td>
+ <td colspan="2" style="height:15px"></td>
</tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryOptionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryOptionForm.vm 2013-02-22 11:39:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryOptionForm.vm 2013-04-22 10:01:08 +0000
@@ -17,7 +17,7 @@
<h3>$i18n.getString( "edit_data_element_category_option" )</h3>
-<form id="editDataElementCategoryOptionForm" name="editDataElementCategoryOptionForm" action="updateDataElementCategoryOption.action" method="post">
+<form id="editDataElementCategoryOptionForm" name="editDataElementCategoryOptionForm" action="updateDataElementCategoryOption.action" method="post" class="inputForm">
<input type="hidden" id="id" name="id" value="$dataElementCategoryOption.id"/>
@@ -27,7 +27,7 @@
</tr>
<tr>
<td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" value="$!encoder.htmlEncode( $dataElementCategoryOption.name )" style="width:25em" class="{validate:{required:true,rangelength:[2,150]}}"/></td>
+ <td><input type="text" id="name" name="name" value="$!encoder.htmlEncode( $dataElementCategoryOption.name )" class="{validate:{required:true,rangelength:[2,150]}}"/></td>
<td></td>
</tr>
<tr>
@@ -39,7 +39,7 @@
<td>
<div style="inline">
#set ( $conceptId = $!dataElementCategoryOption.concept.id )
- <select id="conceptId" name="conceptId" style="width:305px" >
+ <select id="conceptId" name="conceptId">
#foreach( $concept in $concepts )
<option value="$concept.id" #if ( $concept.id == $conceptId ) selected #end>$concept.name</option>
#end