dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #36390
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18625: wip, PS, TE, TEA metadata attributes
------------------------------------------------------------
revno: 18625
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-03-19 10:43:44 +0700
message:
wip, PS, TE, TEA metadata attributes
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.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/attribute/hibernate/Attribute.hbm.xml
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.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/attribute/Attribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java 2015-03-18 13:03:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java 2015-03-19 03:43:44 +0000
@@ -32,6 +32,7 @@
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.google.common.base.MoreObjects;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.IdentifiableObject;
@@ -372,4 +373,29 @@
attributeValues.addAll( attribute.getAttributeValues() );
}
}
+
+ @Override
+ public String toString()
+ {
+ return MoreObjects.toStringHelper( this )
+ .add( "sortOrder", sortOrder )
+ .add( "valueType", valueType )
+ .add( "dataElementAttribute", dataElementAttribute )
+ .add( "dataElementGroupAttribute", dataElementGroupAttribute )
+ .add( "indicatorAttribute", indicatorAttribute )
+ .add( "indicatorGroupAttribute", indicatorGroupAttribute )
+ .add( "dataSetAttribute", dataSetAttribute )
+ .add( "organisationUnitAttribute", organisationUnitAttribute )
+ .add( "organisationUnitGroupAttribute", organisationUnitGroupAttribute )
+ .add( "organisationUnitGroupSetAttribute", organisationUnitGroupSetAttribute )
+ .add( "userAttribute", userAttribute )
+ .add( "userGroupAttribute", userGroupAttribute )
+ .add( "programAttribute", programAttribute )
+ .add( "programStageAttribute", programStageAttribute )
+ .add( "trackedEntityAttribute", trackedEntityAttribute )
+ .add( "trackedEntityAttributeAttribute", trackedEntityAttributeAttribute )
+ .add( "mandatory", mandatory )
+ .add( "attributeValues", attributeValues )
+ .toString();
+ }
}
=== 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 2015-03-10 11:40:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2015-03-19 03:43:44 +0000
@@ -756,6 +756,9 @@
executeSql( "UPDATE attribute SET usergroupattribute=false WHERE usergroupattribute IS NULL" );
executeSql( "UPDATE attribute SET datasetattribute=false WHERE datasetattribute IS NULL" );
executeSql( "UPDATE attribute SET programattribute=false WHERE programattribute IS NULL" );
+ executeSql( "UPDATE attribute SET programstageattribute=false WHERE programstageattribute IS NULL" );
+ executeSql( "UPDATE attribute SET trackedentityattribute=false WHERE trackedentityattribute IS NULL" );
+ executeSql( "UPDATE attribute SET trackedentityattributeattribute=false WHERE trackedentityattributeattribute IS NULL" );
executeSql( "ALTER TABLE trackedentityattributedimension DROP COLUMN operator" );
executeSql( "ALTER TABLE trackedentitydataelementdimension DROP COLUMN operator" );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml 2014-12-23 17:19:20 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml 2015-03-19 03:43:44 +0000
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
- [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
- >
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
+ [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+ >
<hibernate-mapping package="org.hisp.dhis.attribute">
<class name="Attribute" table="attribute">
@@ -43,6 +43,12 @@
<property name="programAttribute" not-null="false" />
+ <property name="programStageAttribute" not-null="false" />
+
+ <property name="trackedEntityAttribute" not-null="false" />
+
+ <property name="trackedEntityAttributeAttribute" not-null="false" />
+
<property name="sortOrder" />
<set name="attributeValues" inverse="true" lazy="true">
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties 2015-03-12 10:55:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties 2015-03-19 03:43:44 +0000
@@ -1,6 +1,8 @@
tracked_entity_management=Tracked entity management
registering_unit=Registering unit
program=Program
+tracked_entity=Tracked Entity
+tracked_entity_attribute=Tracked Entity Attribute
please_select=[Please select]
please_select_a_program=[Please select a program]
no_program_exists=[No program exists]
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java 2015-03-19 03:43:44 +0000
@@ -159,6 +159,27 @@
this.programAttribute = programAttribute;
}
+ private boolean programStageAttribute;
+
+ public void setProgramStageAttribute( boolean programStageAttribute )
+ {
+ this.programStageAttribute = programStageAttribute;
+ }
+
+ private boolean trackedEntityAttribute;
+
+ public void setTrackedEntityAttribute( boolean trackedEntityAttribute )
+ {
+ this.trackedEntityAttribute = trackedEntityAttribute;
+ }
+
+ private boolean trackedEntityAttributeAttribute;
+
+ public void setTrackedEntityAttributeAttribute( boolean trackedEntityAttributeAttribute )
+ {
+ this.trackedEntityAttributeAttribute = trackedEntityAttributeAttribute;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -180,6 +201,9 @@
attribute.setUserAttribute( userAttribute );
attribute.setUserGroupAttribute( userGroupAttribute );
attribute.setProgramAttribute( programAttribute );
+ attribute.setProgramStageAttribute( programStageAttribute );
+ attribute.setTrackedEntityAttribute( trackedEntityAttribute );
+ attribute.setTrackedEntityAttributeAttribute( trackedEntityAttributeAttribute );
attributeService.addAttribute( attribute );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java 2015-03-19 03:43:44 +0000
@@ -167,6 +167,27 @@
this.programAttribute = programAttribute;
}
+ private boolean programStageAttribute;
+
+ public void setProgramStageAttribute( boolean programStageAttribute )
+ {
+ this.programStageAttribute = programStageAttribute;
+ }
+
+ private boolean trackedEntityAttribute;
+
+ public void setTrackedEntityAttribute( boolean trackedEntityAttribute )
+ {
+ this.trackedEntityAttribute = trackedEntityAttribute;
+ }
+
+ private boolean trackedEntityAttributeAttribute;
+
+ public void setTrackedEntityAttributeAttribute( boolean trackedEntityAttributeAttribute )
+ {
+ this.trackedEntityAttributeAttribute = trackedEntityAttributeAttribute;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -193,6 +214,9 @@
attribute.setUserAttribute( userAttribute );
attribute.setUserGroupAttribute( userGroupAttribute );
attribute.setProgramAttribute( programAttribute );
+ attribute.setProgramStageAttribute( programStageAttribute );
+ attribute.setTrackedEntityAttribute( trackedEntityAttribute );
+ attribute.setTrackedEntityAttributeAttribute( trackedEntityAttributeAttribute );
attributeService.updateAttribute( attribute );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties 2015-03-10 11:36:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties 2015-03-19 03:43:44 +0000
@@ -272,6 +272,9 @@
user=User
user_group=User Group
program=Program
+program_stage=Program Stage
+tracked_entity=Tracked Entity
+tracked_entity_attribute=Tracked Entity Attribute
integer=Integer
positive_integer=Positive Integer
negative_integer=Negative Integer
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm 2014-12-23 17:19:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm 2015-03-19 03:43:44 +0000
@@ -60,6 +60,9 @@
<input type="checkbox" id="userAttribute" name="userAttribute" value="true" /><label for="userAttribute">$i18n.getString( 'user' )</label> <br />
<input type="checkbox" id="userGroupAttribute" name="userGroupAttribute" value="true" /><label for="userGroupAttribute">$i18n.getString( 'user_group' )</label> <br />
<input type="checkbox" id="programAttribute" name="programAttribute" value="true" /><label for="programAttribute">$i18n.getString( 'program' )</label> <br />
+ <input type="checkbox" id="programStageAttribute" name="programStageAttribute" value="true" /><label for="programStageAttribute">$i18n.getString( 'program_stage' )</label> <br />
+ <input type="checkbox" id="trackedEntityAttribute" name="trackedEntityAttribute" value="true" /><label for="trackedEntityAttribute">$i18n.getString( 'tracked_entity' )</label> <br />
+ <input type="checkbox" id="trackedEntityAttributeAttribute" name="trackedEntityAttributeAttribute" value="true" /><label for="trackedEntityAttributeAttribute">$i18n.getString( 'tracked_entity_attribute' )</label> <br />
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm 2014-12-23 17:19:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm 2015-03-19 03:43:44 +0000
@@ -50,17 +50,20 @@
<tr>
<td style="vertical-align: text-top;">$i18n.getString( "assigned_to" )</td>
<td>
- <input type="checkbox" id="dataElementAttribute" name="dataElementAttribute" value="true" #if( $attribute.dataElementAttribute ) checked="checked" #end /><label for="dataElementAttribute">$i18n.getString( 'data_element' )</label> <br />
- <input type="checkbox" id="dataElementGroupAttribute" name="dataElementGroupAttribute" value="true" #if( $attribute.dataElementGroupAttribute ) checked="checked" #end /><label for="dataElementGroupAttribute">$i18n.getString( 'data_element_group' )</label> <br />
- <input type="checkbox" id="indicatorAttribute" name="indicatorAttribute" value="true" #if( $attribute.indicatorAttribute ) checked="checked" #end /><label for="indicatorAttribute">$i18n.getString( 'indicator' )</label> <br />
- <input type="checkbox" id="indicatorGroupAttribute" name="indicatorGroupAttribute" value="true" #if( $attribute.indicatorGroupAttribute ) checked="checked" #end /><label for="indicatorGroupAttribute">$i18n.getString( 'indicator_group' )</label> <br />
- <input type="checkbox" id="dataSetAttribute" name="dataSetAttribute" value="true" #if( $attribute.dataSetAttribute ) checked="checked" #end /><label for="dataSetAttribute">$i18n.getString( 'data_set' )</label> <br />
- <input type="checkbox" id="organisationUnitAttribute" name="organisationUnitAttribute" value="true" #if( $attribute.organisationUnitAttribute ) checked="checked" #end /><label for="organisationUnitAttribute">$i18n.getString( 'organisation_unit' )</label> <br />
- <input type="checkbox" id="organisationUnitGroupAttribute" name="organisationUnitGroupAttribute" value="true" #if( $attribute.organisationUnitGroupAttribute ) checked="checked" #end /><label for="organisationUnitGroupAttribute">$i18n.getString( 'organisation_unit_group' )</label> <br />
- <input type="checkbox" id="organisationUnitGroupSetAttribute" name="organisationUnitGroupSetAttribute" value="true" #if( $attribute.organisationUnitGroupSetAttribute ) checked="checked" #end /><label for="organisationUnitGroupSetAttribute">$i18n.getString( 'organisation_unit_group_set' )</label> <br />
- <input type="checkbox" id="userAttribute" name="userAttribute" value="true" #if( $attribute.userAttribute ) checked="checked" #end /><label for="userAttribute">$i18n.getString( 'user' )</label> <br />
- <input type="checkbox" id="userGroupAttribute" name="userGroupAttribute" value="true" #if( $attribute.userGroupAttribute ) checked="checked" #end /><label for="userGroupAttribute">$i18n.getString( 'user_group' )</label> <br />
- <input type="checkbox" id="programAttribute" name="programAttribute" value="true" #if( $attribute.programAttribute ) checked="checked" #end /><label for="programAttribute">$i18n.getString( 'program' )</label> <br />
+ <input type="checkbox" id="dataElementAttribute" name="dataElementAttribute" value="true" #if( $attribute.dataElementAttribute ) checked="checked" #end /><label for="dataElementAttribute">$i18n.getString( 'data_element' )</label> <br />
+ <input type="checkbox" id="dataElementGroupAttribute" name="dataElementGroupAttribute" value="true" #if( $attribute.dataElementGroupAttribute ) checked="checked" #end /><label for="dataElementGroupAttribute">$i18n.getString( 'data_element_group' )</label> <br />
+ <input type="checkbox" id="indicatorAttribute" name="indicatorAttribute" value="true" #if( $attribute.indicatorAttribute ) checked="checked" #end /><label for="indicatorAttribute">$i18n.getString( 'indicator' )</label> <br />
+ <input type="checkbox" id="indicatorGroupAttribute" name="indicatorGroupAttribute" value="true" #if( $attribute.indicatorGroupAttribute ) checked="checked" #end /><label for="indicatorGroupAttribute">$i18n.getString( 'indicator_group' )</label> <br />
+ <input type="checkbox" id="dataSetAttribute" name="dataSetAttribute" value="true" #if( $attribute.dataSetAttribute ) checked="checked" #end /><label for="dataSetAttribute">$i18n.getString( 'data_set' )</label> <br />
+ <input type="checkbox" id="organisationUnitAttribute" name="organisationUnitAttribute" value="true" #if( $attribute.organisationUnitAttribute ) checked="checked" #end /><label for="organisationUnitAttribute">$i18n.getString( 'organisation_unit' )</label> <br />
+ <input type="checkbox" id="organisationUnitGroupAttribute" name="organisationUnitGroupAttribute" value="true" #if( $attribute.organisationUnitGroupAttribute ) checked="checked" #end /><label for="organisationUnitGroupAttribute">$i18n.getString( 'organisation_unit_group' )</label> <br />
+ <input type="checkbox" id="organisationUnitGroupSetAttribute" name="organisationUnitGroupSetAttribute" value="true" #if( $attribute.organisationUnitGroupSetAttribute ) checked="checked" #end /><label for="organisationUnitGroupSetAttribute">$i18n.getString( 'organisation_unit_group_set' )</label> <br />
+ <input type="checkbox" id="userAttribute" name="userAttribute" value="true" #if( $attribute.userAttribute ) checked="checked" #end /><label for="userAttribute">$i18n.getString( 'user' )</label> <br />
+ <input type="checkbox" id="userGroupAttribute" name="userGroupAttribute" value="true" #if( $attribute.userGroupAttribute ) checked="checked" #end /><label for="userGroupAttribute">$i18n.getString( 'user_group' )</label> <br />
+ <input type="checkbox" id="programAttribute" name="programAttribute" value="true" #if( $attribute.programAttribute ) checked="checked" #end /><label for="programAttribute">$i18n.getString( 'program' )</label> <br />
+ <input type="checkbox" id="programStageAttribute" name="programStageAttribute" value="true" #if( $attribute.programStageAttribute ) checked="checked" #end /><label for="programStageAttribute">$i18n.getString( 'program_stage' )</label> <br />
+ <input type="checkbox" id="trackedEntityAttribute" name="trackedEntityAttribute" value="true" #if( $attribute.trackedEntityAttribute ) checked="checked" #end /><label for="trackedEntityAttribute">$i18n.getString( 'tracked_entity' )</label> <br />
+ <input type="checkbox" id="trackedEntityAttributeAttribute" name="trackedEntityAttributeAttribute" value="true" #if( $attribute.trackedEntityAttributeAttribute ) checked="checked" #end /><label for="trackedEntityAttributeAttribute">$i18n.getString( 'tracked_entity_attribute' )</label> <br />
</td>
</tr>