dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41445
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21122: move attributeValues to idObject, rename TEI.attributeValues => TEI.trackedEntityAttributeValues ...
------------------------------------------------------------
revno: 21122
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-11-19 11:01:09 +0700
message:
move attributeValues to idObject, rename TEI.attributeValues => TEI.trackedEntityAttributeValues (was already done in JSON/XML)
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObject.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntity.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceReminderService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityInstance.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java
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/trackedentity/AbstractTrackedEntityInstanceService.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.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/attribute/Attribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java 2015-11-18 05:35:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java 2015-11-19 04:01:09 +0000
@@ -59,9 +59,7 @@
import org.hisp.dhis.user.UserGroup;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
@@ -112,8 +110,6 @@
private OptionSet optionSet;
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
public Attribute()
{
@@ -398,16 +394,6 @@
this.sortOrder = sortOrder;
}
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
public List<Class<? extends IdentifiableObject>> getSupportedClasses()
{
List<Class<? extends IdentifiableObject>> klasses = new ArrayList<>();
@@ -470,9 +456,6 @@
valueType = attribute.getValueType() == null ? valueType : attribute.getValueType();
sortOrder = attribute.getSortOrder() == null ? sortOrder : attribute.getSortOrder();
}
-
- attributeValues.clear();
- attributeValues.addAll( attribute.getAttributeValues() );
}
}
@@ -499,7 +482,6 @@
.add( "categoryOptionAttribute", categoryOptionAttribute )
.add( "categoryOptionGroupAttribute", categoryOptionGroupAttribute )
.add( "mandatory", mandatory )
- .add( "attributeValues", attributeValues )
.toString();
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java 2015-10-13 07:44:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java 2015-11-19 04:01:09 +0000
@@ -36,8 +36,7 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import org.apache.commons.lang3.Validate;
-import org.hisp.dhis.security.acl.Access;
-import org.hisp.dhis.security.acl.AccessStringHelper;
+import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.annotation.Description;
import org.hisp.dhis.common.view.DetailedView;
import org.hisp.dhis.common.view.DimensionalView;
@@ -45,6 +44,8 @@
import org.hisp.dhis.schema.PropertyType;
import org.hisp.dhis.schema.annotation.Property;
import org.hisp.dhis.schema.annotation.PropertyRange;
+import org.hisp.dhis.security.acl.Access;
+import org.hisp.dhis.security.acl.AccessStringHelper;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserGroupAccess;
@@ -94,6 +95,11 @@
protected Date lastUpdated;
/**
+ * Set of the dynamic attributes values that belong to this data element.
+ */
+ protected Set<AttributeValue> attributeValues = new HashSet<>();
+
+ /**
* This object is available as external read-only
*/
protected boolean externalAccess;
@@ -161,7 +167,7 @@
@Override
public int compareTo( IdentifiableObject object )
{
- return name == null ? ( object.getDisplayName() == null ? 0 : -1 ) : name.compareTo( object.getDisplayName() );
+ return name == null ? (object.getDisplayName() == null ? 0 : -1) : name.compareTo( object.getDisplayName() );
}
// -------------------------------------------------------------------------
@@ -272,6 +278,20 @@
this.lastUpdated = lastUpdated;
}
+ @JsonProperty( "attributeValues" )
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
+ public Set<AttributeValue> getAttributeValues()
+ {
+ return attributeValues;
+ }
+
+ public void setAttributeValues( Set<AttributeValue> attributeValues )
+ {
+ this.attributeValues = attributeValues;
+ }
+
@Override
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@@ -582,5 +602,8 @@
userGroupAccesses.clear();
userGroupAccesses.addAll( other.getUserGroupAccesses() );
}
+
+ attributeValues.clear();
+ attributeValues.addAll( other.getAttributeValues() );
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObject.java 2015-10-05 17:23:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObject.java 2015-11-19 04:01:09 +0000
@@ -28,6 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.security.acl.Access;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserGroupAccess;
@@ -67,6 +68,8 @@
boolean getExternalAccess();
+ Set<AttributeValue> getAttributeValues();
+
User getUser();
Set<UserGroupAccess> getUserGroupAccesses();
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java 2015-08-19 11:13:46 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroup.java 2015-11-19 04:01:09 +0000
@@ -34,8 +34,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.BaseNameableObject;
import org.hisp.dhis.common.DataDimensionType;
@@ -63,11 +61,6 @@
private DataDimensionType dataDimensionType;
- /**
- * Set of the dynamic attributes values that belong to this data element.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -145,20 +138,6 @@
this.dataDimensionType = dataDimensionType;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
{
@@ -185,9 +164,6 @@
{
addCategoryOption( categoryOption );
}
-
- attributeValues.clear();
- attributeValues.addAll( categoryOptionGroup.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2015-11-02 04:27:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2015-11-19 04:01:09 +0000
@@ -141,11 +141,6 @@
private boolean zeroIsSignificant;
/**
- * Set of the dynamic attributes values that belong to this data element.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
- /**
* The option set for data values linked to this data element.
*/
private OptionSet optionSet;
@@ -629,20 +624,6 @@
this.zeroIsSignificant = zeroIsSignificant;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
@@ -706,9 +687,6 @@
aggregationLevels.clear();
aggregationLevels.addAll( dataElement.getAggregationLevels() );
-
- attributeValues.clear();
- attributeValues.addAll( dataElement.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java 2015-10-05 17:45:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java 2015-11-19 04:01:09 +0000
@@ -34,7 +34,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.BaseNameableObject;
import org.hisp.dhis.common.DxfNamespaces;
@@ -72,11 +71,6 @@
private Set<CategoryOptionGroup> groups = new HashSet<>();
- /**
- * Set of the dynamic attributes values that belong to this data element.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -260,20 +254,6 @@
this.groups = groups;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
{
@@ -303,8 +283,6 @@
categories.addAll( categoryOption.getCategories() );
groups.addAll( categoryOption.getGroups() );
categoryOptionCombos.addAll( categoryOption.getCategoryOptionCombos() );
- attributeValues.clear();
- attributeValues.addAll( categoryOption.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java 2015-10-05 17:45:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroup.java 2015-11-19 04:01:09 +0000
@@ -35,7 +35,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import org.hisp.dhis.analytics.AggregationType;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.BaseNameableObject;
import org.hisp.dhis.common.DxfNamespaces;
@@ -62,11 +61,6 @@
private DataElementGroupSet groupSet;
- /**
- * Set of the dynamic attributes values that belong to this dataElement group.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -183,20 +177,6 @@
this.groupSet = groupSet;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
{
@@ -221,9 +201,6 @@
{
addDataElement( dataElement );
}
-
- attributeValues.clear();
- attributeValues.addAll( dataElementGroup.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java 2015-11-02 04:27:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java 2015-11-19 04:01:09 +0000
@@ -36,7 +36,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.google.common.collect.Sets;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.BaseNameableObject;
import org.hisp.dhis.common.DxfNamespaces;
@@ -161,11 +160,6 @@
*/
private boolean approveData;
- /**
- * Set of the dynamic attributes values that belong to this data element.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Form properties
// -------------------------------------------------------------------------
@@ -647,20 +641,6 @@
this.approveData = approveData;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
@@ -825,9 +805,6 @@
removeAllOrganisationUnits();
dataSet.getSources().forEach( this::addOrganisationUnit );
-
- attributeValues.clear();
- attributeValues.addAll( dataSet.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java 2015-10-05 17:45:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java 2015-11-19 04:01:09 +0000
@@ -35,8 +35,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.BaseNameableObject;
import org.hisp.dhis.common.DxfNamespaces;
@@ -87,11 +85,6 @@
private Set<DataSet> dataSets = new HashSet<>();
/**
- * Set of the dynamic attributes values that belong to this indicator.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
- /**
* The legend set for this indicator.
*/
private LegendSet legendSet;
@@ -334,20 +327,6 @@
this.dataSets = dataSets;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@JsonProperty
@JsonSerialize( as = BaseIdentifiableObject.class )
@JsonView( { DetailedView.class, ExportView.class } )
@@ -398,9 +377,6 @@
dataSets.clear();
groups.clear();
-
- removeAllAttributeValues();
- attributeValues.addAll( indicator.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java 2015-10-05 17:45:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java 2015-11-19 04:01:09 +0000
@@ -34,7 +34,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.IdentifiableObject;
@@ -58,11 +57,6 @@
private IndicatorGroupSet groupSet;
- /**
- * Set of the dynamic attributes values that belong to this indicator group.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -158,20 +152,6 @@
this.groupSet = groupSet;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
{
@@ -196,9 +176,6 @@
{
addIndicator( indicator );
}
-
- attributeValues.clear();
- attributeValues.addAll( indicatorGroup.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java 2015-11-17 13:49:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java 2015-11-19 04:01:09 +0000
@@ -37,7 +37,6 @@
import com.google.common.base.Joiner;
import com.google.common.collect.Sets;
import org.apache.commons.lang3.StringUtils;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.BaseNameableObject;
import org.hisp.dhis.common.DisplayProperty;
@@ -128,12 +127,6 @@
private Set<User> users = new HashSet<>();
- /**
- * Set of the dynamic attributes values that belong to this
- * organisationUnit.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Transient fields
// -------------------------------------------------------------------------
@@ -1125,20 +1118,6 @@
this.users = users;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
// -------------------------------------------------------------------------
// Getters and setters for transient fields
// -------------------------------------------------------------------------
@@ -1215,9 +1194,6 @@
users.clear();
dataSets.clear();
programs.clear();
-
- attributeValues.clear();
- attributeValues.addAll( organisationUnit.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java 2015-10-05 17:45:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java 2015-11-19 04:01:09 +0000
@@ -34,7 +34,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.BaseNameableObject;
import org.hisp.dhis.common.DxfNamespaces;
@@ -61,12 +60,6 @@
private OrganisationUnitGroupSet groupSet;
- /**
- * Set of the dynamic attributes values that belong to this organisationUnit
- * group.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -174,20 +167,6 @@
this.groupSet = groupSet;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
{
@@ -214,9 +193,6 @@
{
addOrganisationUnit( organisationUnit );
}
-
- attributeValues.clear();
- attributeValues.addAll( organisationUnitGroup.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java 2015-10-05 17:45:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java 2015-11-19 04:01:09 +0000
@@ -34,8 +34,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseDimensionalObject;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DimensionType;
@@ -69,11 +67,6 @@
@Scanned
private Set<OrganisationUnitGroup> organisationUnitGroups = new HashSet<>();
- /**
- * Set of the dynamic attributes values that belong to this data element.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -246,20 +239,6 @@
this.organisationUnitGroups = organisationUnitGroups;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
{
@@ -286,9 +265,6 @@
{
addOrganisationUnitGroup( organisationUnitGroup );
}
-
- attributeValues.clear();
- attributeValues.addAll( organisationUnitGroupSet.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2015-11-18 14:08:06 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2015-11-19 04:01:09 +0000
@@ -35,7 +35,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.google.common.collect.Sets;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.IdentifiableObject;
@@ -121,18 +120,13 @@
private TrackedEntity trackedEntity;
- /**
- * Set of the dynamic attributes values that belong to this data element.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
private DataEntryForm dataEntryForm;
/**
* The CategoryCombo used for data attributes.
*/
private DataElementCategoryCombo categoryCombo;
-
+
/**
* Property indicating whether offline storage is enabled for this program
* or not
@@ -635,20 +629,6 @@
this.trackedEntity = trackedEntity;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( localName = "dataEntryForm", namespace = DxfNamespaces.DXF_2_0 )
@@ -684,7 +664,7 @@
{
return categoryCombo != null && !DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME.equals( categoryCombo.getName() );
}
-
+
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
@@ -768,9 +748,6 @@
instanceReminders.clear();
instanceReminders.addAll( program.getInstanceReminders() );
-
- attributeValues.clear();
- attributeValues.addAll( program.getAttributeValues() );
}
}
}
=== 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-10-23 03:41:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2015-11-19 04:01:09 +0000
@@ -35,7 +35,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.IdentifiableObject;
@@ -117,11 +116,6 @@
private PeriodType periodType;
- /**
- * Set of the dynamic attributes values that belong to this data element.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -488,20 +482,6 @@
this.periodType = periodType;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
{
@@ -584,9 +564,6 @@
reminders.clear();
reminders.addAll( programStage.getReminders() );
-
- attributeValues.clear();
- attributeValues.addAll( programStage.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntity.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntity.java 2015-10-05 17:45:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntity.java 2015-11-19 04:01:09 +0000
@@ -28,21 +28,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseNameableObject;
import org.hisp.dhis.common.DxfNamespaces;
-import org.hisp.dhis.common.IdentifiableObject;
-import org.hisp.dhis.common.MergeStrategy;
-import org.hisp.dhis.common.view.DetailedView;
-import org.hisp.dhis.common.view.ExportView;
-
-import java.util.HashSet;
-import java.util.Set;
/**
* @author Chau Thu Tran
@@ -51,11 +39,6 @@
public class TrackedEntity
extends BaseNameableObject
{
- /**
- * Set of the dynamic attributes values that belong to this data element.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Constructor
// -------------------------------------------------------------------------
@@ -70,32 +53,4 @@
this.name = name;
this.description = description;
}
-
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
- @Override
- public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
- {
- super.mergeWith( other, strategy );
-
- if ( other.getClass().isInstance( this ) )
- {
- TrackedEntity trackedEntity = (TrackedEntity) other;
-
- attributeValues.clear();
- attributeValues.addAll( trackedEntity.getAttributeValues() );
- }
- }
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java 2015-09-30 07:07:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java 2015-11-19 04:01:09 +0000
@@ -31,11 +31,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseDimensionalObject;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DimensionType;
@@ -49,9 +46,6 @@
import org.hisp.dhis.option.OptionSet;
import org.hisp.dhis.schema.annotation.PropertyRange;
-import java.util.HashSet;
-import java.util.Set;
-
/**
* @author Abyot Asalefew
*/
@@ -91,11 +85,6 @@
private Boolean programScope = false;
- /**
- * Set of the dynamic attributes values that belong to this data element.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -179,7 +168,7 @@
{
return DimensionType.PROGRAM_ATTRIBUTE;
}
-
+
// -------------------------------------------------------------------------
// Helper getters
// -------------------------------------------------------------------------
@@ -396,20 +385,6 @@
this.confidential = confidential;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
{
@@ -453,9 +428,6 @@
confidential = trackedEntityAttribute.getConfidential() == null ? confidential : trackedEntityAttribute.getConfidential();
optionSet = trackedEntityAttribute.getOptionSet() == null ? optionSet : trackedEntityAttribute.getOptionSet();
}
-
- attributeValues.clear();
- attributeValues.addAll( trackedEntityAttribute.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java 2015-10-19 09:38:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java 2015-11-19 04:01:09 +0000
@@ -56,7 +56,7 @@
{
public static String PREFIX_TRACKED_ENTITY_ATTRIBUTE = "attr";
- private Set<TrackedEntityAttributeValue> attributeValues = new HashSet<>();
+ private Set<TrackedEntityAttributeValue> trackedEntityAttributeValues = new HashSet<>();
private Set<ProgramInstance> programInstances = new HashSet<>();
@@ -82,13 +82,13 @@
public void addAttributeValue( TrackedEntityAttributeValue attributeValue )
{
- attributeValues.add( attributeValue );
+ trackedEntityAttributeValues.add( attributeValue );
attributeValue.setEntityInstance( this );
}
public void removeAttributeValue( TrackedEntityAttributeValue attributeValue )
{
- attributeValues.remove( attributeValue );
+ trackedEntityAttributeValues.remove( attributeValue );
attributeValue.setEntityInstance( null );
}
@@ -114,14 +114,14 @@
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlElementWrapper( localName = "trackedEntityAttributeValues", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "trackedEntityAttributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<TrackedEntityAttributeValue> getAttributeValues()
+ public Set<TrackedEntityAttributeValue> getTrackedEntityAttributeValues()
{
- return attributeValues;
+ return trackedEntityAttributeValues;
}
- public void setAttributeValues( Set<TrackedEntityAttributeValue> attributeValues )
+ public void setTrackedEntityAttributeValues( Set<TrackedEntityAttributeValue> trackedEntityAttributeValues )
{
- this.attributeValues = attributeValues;
+ this.trackedEntityAttributeValues = trackedEntityAttributeValues;
}
@JsonProperty
@@ -168,7 +168,6 @@
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "inactive", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "inactive", namespace = DxfNamespaces.DXF_2_0 )
public Boolean isInactive()
{
@@ -204,8 +203,8 @@
representative = trackedEntityInstance.getRepresentative() == null ? representative : trackedEntityInstance.getRepresentative();
}
- attributeValues.clear();
- attributeValues.addAll( trackedEntityInstance.getAttributeValues() );
+ trackedEntityAttributeValues.clear();
+ trackedEntityAttributeValues.addAll( trackedEntityInstance.getTrackedEntityAttributeValues() );
programInstances.clear();
programInstances.addAll( trackedEntityInstance.getProgramInstances() );
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java 2015-10-05 17:45:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java 2015-11-19 04:01:09 +0000
@@ -34,9 +34,7 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-
import org.apache.commons.collections.CollectionUtils;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.IdentifiableObject;
@@ -115,11 +113,6 @@
private Set<OrganisationUnit> dataViewOrganisationUnits = new HashSet<>();
/**
- * Set of the dynamic attributes values that belong to this User.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
- /**
* Ordered favorite apps.
*/
private List<String> apps = new ArrayList<>();
@@ -194,13 +187,13 @@
{
return CollectionUtils.isEmpty( organisationUnits ) ? null : organisationUnits.iterator().next();
}
-
+
public List<OrganisationUnit> getSortedOrganisationUnits()
{
List<OrganisationUnit> sortedOrgUnits = new ArrayList<>( organisationUnits );
-
+
Collections.sort( sortedOrgUnits, IdentifiableObjectNameComparator.INSTANCE );
-
+
return sortedOrgUnits;
}
@@ -246,7 +239,7 @@
{
return IdentifiableObjectUtils.join( organisationUnits );
}
-
+
public String getUsername()
{
return userCredentials != null ? userCredentials.getUsername() : null;
@@ -265,7 +258,7 @@
{
return userCredentials != null && userCredentials.isAuthorized( auth );
}
-
+
public Set<UserGroup> getManagedGroups()
{
Set<UserGroup> managedGroups = new HashSet<>();
@@ -340,7 +333,7 @@
/**
* Indicates whether this user is managed by the given user.
*
- * @param userGroup the user to test.
+ * @param user the user to test.
* @return true if the given user is managed by this user, false if not.
*/
public boolean isManagedBy( User user )
@@ -365,7 +358,7 @@
{
return user != null && user.getUsername() != null ? user.getUsername() : "[Unknown]";
}
-
+
// -------------------------------------------------------------------------
// Getters and setters
// -------------------------------------------------------------------------
@@ -618,20 +611,6 @@
this.dataViewOrganisationUnits = dataViewOrganisationUnits;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
public List<String> getApps()
{
return apps;
@@ -688,9 +667,6 @@
userCredentials = user.getUserCredentials() == null ? userCredentials : user.getUserCredentials();
}
- attributeValues.clear();
- attributeValues.addAll( user.getAttributeValues() );
-
organisationUnits.clear();
organisationUnits.addAll( user.getOrganisationUnits() );
@@ -721,7 +697,6 @@
", groups=" + groups +
", organisationUnits=" + organisationUnits +
", dataViewOrganisationUnits=" + dataViewOrganisationUnits +
- ", attributeValues=" + attributeValues +
", apps=" + apps +
'}';
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.java 2015-10-20 04:33:01 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.java 2015-11-19 04:01:09 +0000
@@ -35,7 +35,6 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.IdentifiableObject;
@@ -79,11 +78,6 @@
*/
private Set<UserGroup> managedByGroups = new HashSet<>();
- /**
- * Set of the dynamic attributes values that belong to this user group.
- */
- private Set<AttributeValue> attributeValues = new HashSet<>();
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -219,20 +213,6 @@
this.managedByGroups = managedByGroups;
}
- @JsonProperty( "attributeValues" )
- @JsonView( { DetailedView.class, ExportView.class } )
- @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
- @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
- public Set<AttributeValue> getAttributeValues()
- {
- return attributeValues;
- }
-
- public void setAttributeValues( Set<AttributeValue> attributeValues )
- {
- this.attributeValues = attributeValues;
- }
-
@Override
public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
{
@@ -244,9 +224,6 @@
members.clear();
members.addAll( userGroup.getMembers() );
-
- attributeValues.clear();
- attributeValues.addAll( userGroup.getAttributeValues() );
}
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceReminderService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceReminderService.java 2015-09-11 11:54:53 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceReminderService.java 2015-11-19 04:01:09 +0000
@@ -127,8 +127,7 @@
if ( matcher.group( 1 ).equals( ATTRIBUTE ) )
{
String uid = matcher.group( 2 );
- for ( TrackedEntityAttributeValue attributeValue : programInstance.getEntityInstance()
- .getAttributeValues() )
+ for ( TrackedEntityAttributeValue attributeValue : programInstance.getEntityInstance().getTrackedEntityAttributeValues() )
{
if ( attributeValue.getAttribute().getUid().equals( uid ) )
{
@@ -175,8 +174,8 @@
if ( matcher.group( 1 ).equals( ATTRIBUTE ) )
{
String uid = matcher.group( 2 );
- for ( TrackedEntityAttributeValue attributeValue : programStageInstance.getProgramInstance()
- .getEntityInstance().getAttributeValues() )
+ for ( TrackedEntityAttributeValue attributeValue :
+ programStageInstance.getProgramInstance().getEntityInstance().getTrackedEntityAttributeValues() )
{
if ( attributeValue.getAttribute().getUid().equals( uid ) )
{
@@ -229,7 +228,7 @@
case TrackedEntityInstanceReminder.SEND_TO_ATTRIBUTE_TYPE_USERS:
if ( entityInstance.getAttributeValues() != null )
{
- for ( TrackedEntityAttributeValue attributeValue : entityInstance.getAttributeValues() )
+ for ( TrackedEntityAttributeValue attributeValue : entityInstance.getTrackedEntityAttributeValues() )
{
if ( ValueType.USERNAME == attributeValue.getAttribute().getValueType() )
{
@@ -262,7 +261,7 @@
default:
if ( entityInstance.getAttributeValues() != null )
{
- for ( TrackedEntityAttributeValue attributeValue : entityInstance.getAttributeValues() )
+ for ( TrackedEntityAttributeValue attributeValue : entityInstance.getTrackedEntityAttributeValues() )
{
if ( ValueType.PHONE_NUMBER == attributeValue.getAttribute().getValueType() )
{
@@ -289,7 +288,7 @@
case TrackedEntityInstanceReminder.SEND_TO_ATTRIBUTE_TYPE_USERS:
if ( entityInstance.getAttributeValues() != null )
{
- for ( TrackedEntityAttributeValue attributeValue : entityInstance.getAttributeValues() )
+ for ( TrackedEntityAttributeValue attributeValue : entityInstance.getTrackedEntityAttributeValues() )
{
if ( ValueType.USERNAME == attributeValue.getAttribute().getValueType() )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java 2015-11-17 18:29:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java 2015-11-19 04:01:09 +0000
@@ -532,7 +532,7 @@
for ( TrackedEntityAttributeValue pav : attributeValues )
{
attributeValueService.addTrackedEntityAttributeValue( pav );
- instance.getAttributeValues().add( pav );
+ instance.getTrackedEntityAttributeValues().add( pav );
}
// ---------------------------------------------------------------------
@@ -661,7 +661,7 @@
if ( instance.getAttributeValues() != null && instance.getAttributeValues().size() > 0 )
{
- for ( TrackedEntityAttributeValue attributeValue : instance.getAttributeValues() )
+ for ( TrackedEntityAttributeValue attributeValue : instance.getTrackedEntityAttributeValues() )
{
String valid = trackedEntityInstanceStore.validate( instance, attributeValue, program );
@@ -680,7 +680,7 @@
{
for ( ValidationCriteria criteria : program.getValidationCriteria() )
{
- for ( TrackedEntityAttributeValue attributeValue : instance.getAttributeValues() )
+ for ( TrackedEntityAttributeValue attributeValue : instance.getTrackedEntityAttributeValues() )
{
if ( attributeValue.getAttribute().getUid().equals( criteria.getProperty() ) )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java 2015-11-17 17:21:07 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java 2015-11-19 04:01:09 +0000
@@ -120,7 +120,7 @@
private String buildTrackedEntityInstanceHql( TrackedEntityInstanceQueryParams params )
{
- String hql = "select distinct tei from TrackedEntityInstance tei left join fetch tei.attributeValues";
+ String hql = "select distinct tei from TrackedEntityInstance tei left join fetch tei.trackedEntityAttributeValues";
SqlHelper hlp = new SqlHelper( true );
if ( params.hasTrackedEntity() )
@@ -496,7 +496,7 @@
{
Criteria criteria = getCriteria();
criteria.add( Restrictions.ne( "id", instance.getId() ) );
- criteria.createAlias( "attributeValues", "attributeValue" );
+ criteria.createAlias( "trackedEntityAttributeValues", "attributeValue" );
criteria.createAlias( "attributeValue.attribute", "attribute" );
criteria.add( Restrictions.eq( "attributeValue.value", attributeValue.getValue() ) );
criteria.add( Restrictions.eq( "attributeValue.attribute", attribute ) );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityInstance.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityInstance.hbm.xml 2015-10-07 13:22:46 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityInstance.hbm.xml 2015-11-19 04:01:09 +0000
@@ -12,9 +12,9 @@
</id>
&identifiableProperties;
- <property name="inactive" column="inactive" />
-
- <set name="attributeValues" inverse="true">
+ <property name="inactive" column="inactive" />
+
+ <set name="trackedEntityAttributeValues" inverse="true">
<key column="trackedentityinstanceid" />
<one-to-many class="org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue" />
</set>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java 2015-10-23 03:41:44 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java 2015-11-19 04:01:09 +0000
@@ -28,17 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.common.ValueType;
import org.hisp.dhis.dataelement.DataElement;
@@ -61,6 +50,14 @@
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.junit.Assert.*;
+
/**
* @author Chau Thu Tran
*/
@@ -175,7 +172,7 @@
attributeValue.setValue( "123456789" );
attributeValueService.addTrackedEntityAttributeValue( attributeValue );
- entityInstanceA.getAttributeValues().add( attributeValue );
+ entityInstanceA.getTrackedEntityAttributeValues().add( attributeValue );
entityInstanceService.updateTrackedEntityInstance( entityInstanceA );
/**
@@ -186,7 +183,7 @@
stageA = new ProgramStage( "A", programA );
stageA.setSortOrder( 1 );
-
+
TrackedEntityInstanceReminder reminderA = new TrackedEntityInstanceReminder( "A", 0,
"Test program stage message template", TrackedEntityInstanceReminder.DUE_DATE_TO_COMPARE,
TrackedEntityInstanceReminder.SEND_TO_TRACKED_ENTITY_INSTANCE, null, TrackedEntityInstanceReminder.MESSAGE_TYPE_BOTH );
@@ -267,7 +264,7 @@
testDate1.withTimeAtStartOfDay();
testDate1 = testDate1.minusDays( 70 );
incidenDate = testDate1.toDate();
-
+
DateTime testDate2 = DateTime.now();
testDate2.withTimeAtStartOfDay();
enrollmentDate = testDate2.toDate();
@@ -442,7 +439,7 @@
int idA = programStageInstanceService.addProgramStageInstance( programStageInstanceA );
programStageInstanceService.completeProgramStageInstance( programStageInstanceA, mockFormat );
-
+
assertEquals( true, programStageInstanceService.getProgramStageInstance( idA ).isCompleted() );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java 2015-09-03 08:15:09 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java 2015-11-19 04:01:09 +0000
@@ -203,7 +203,7 @@
attributeValue.setValue( "123456789" );
attributeValueService.addTrackedEntityAttributeValue( attributeValue );
- entityInstance.getAttributeValues().add( attributeValue );
+ entityInstance.getTrackedEntityAttributeValues().add( attributeValue );
entityInstanceService.updateTrackedEntityInstance( entityInstance );
Set<String> phoneNumbers = reminderService.getPhoneNumbers( reminderA, entityInstance );
=== 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 2015-10-23 05:32:46 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java 2015-11-19 04:01:09 +0000
@@ -544,7 +544,7 @@
attributeValueMap.put( attribute.getAttribute(), attribute.getValue() );
}
- trackedEntityInstance.getAttributeValues().stream()
+ trackedEntityInstance.getTrackedEntityAttributeValues().stream()
.filter( value -> attributeValueMap.containsKey( value.getAttribute().getUid() ) )
.forEach( value -> {
String newValue = attributeValueMap.get( value.getAttribute().getUid() );
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/trackedentity/AbstractTrackedEntityInstanceService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/trackedentity/AbstractTrackedEntityInstanceService.java 2015-10-23 05:08:59 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/trackedentity/AbstractTrackedEntityInstanceService.java 2015-11-19 04:01:09 +0000
@@ -174,7 +174,7 @@
}
}
- for ( TrackedEntityAttributeValue attributeValue : entityInstance.getAttributeValues() )
+ for ( TrackedEntityAttributeValue attributeValue : entityInstance.getTrackedEntityAttributeValues() )
{
Attribute attribute = new Attribute();
@@ -434,7 +434,7 @@
private void removeAttributeValues( org.hisp.dhis.trackedentity.TrackedEntityInstance entityInstance )
{
- entityInstance.getAttributeValues().forEach( trackedEntityAttributeValueService::deleteTrackedEntityAttributeValue );
+ entityInstance.getTrackedEntityAttributeValues().forEach( trackedEntityAttributeValueService::deleteTrackedEntityAttributeValue );
teiService.updateTrackedEntityInstance( entityInstance );
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2015-11-18 16:46:20 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2015-11-19 04:01:09 +0000
@@ -805,7 +805,7 @@
patientModel.setTrackedEntityName( "" );
}
- List<TrackedEntityAttributeValue> atts = new ArrayList<>( patient.getAttributeValues() );
+ List<TrackedEntityAttributeValue> atts = new ArrayList<>( patient.getTrackedEntityAttributeValues() );
for ( TrackedEntityAttributeValue value : atts )
{
@@ -876,7 +876,7 @@
// get relative's name
TrackedEntityInstance relative = entityInstanceService.getTrackedEntityInstance( relationshipMobile
.getPersonBId() );
- List<TrackedEntityAttributeValue> attributes = new ArrayList<>( relative.getAttributeValues() );
+ List<TrackedEntityAttributeValue> attributes = new ArrayList<>( relative.getTrackedEntityAttributeValues() );
List<TrackedEntityAttributeValue> attributesInList = new ArrayList<>();
for ( TrackedEntityAttributeValue value : attributes )
@@ -1590,7 +1590,7 @@
valuesForUpdate.add( attributeValue );
valuesForDelete.remove( attributeValue );
}
- tempTEI.getAttributeValues().add( attributeValue );
+ tempTEI.getTrackedEntityAttributeValues().add( attributeValue );
}
}
}
@@ -1917,8 +1917,8 @@
&& lostEvent.getSMS() != null )
{
List<User> recipientsList = new ArrayList<>();
- for ( TrackedEntityAttributeValue attrValue : programStageInstance.getProgramInstance()
- .getEntityInstance().getAttributeValues() )
+ for ( TrackedEntityAttributeValue attrValue :
+ programStageInstance.getProgramInstance().getEntityInstance().getTrackedEntityAttributeValues() )
{
if ( ValueType.PHONE_NUMBER == attrValue.getAttribute().getValueType() )
{
=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2015-11-18 16:46:20 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2015-11-19 04:01:09 +0000
@@ -111,7 +111,6 @@
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
-
import java.io.File;
import java.io.PrintWriter;
import java.io.StringReader;
@@ -1050,16 +1049,16 @@
return legendSet;
}
-
+
public static Chart createChart( char uniqueCharacter )
{
Chart chart = new Chart();
chart.setAutoFields();
chart.setName( "Chart" + uniqueCharacter );
chart.setType( ChartType.COLUMN );
-
+
return chart;
-
+
}
public static Chart createChart( char uniqueCharacter, List<Indicator> indicators, List<Period> periods,
@@ -1302,7 +1301,7 @@
attributeValue.setAttribute( attribute );
attributeValue.setEntityInstance( entityInstance );
attributeValue.setValue( "Attribute" + uniqueChar );
- entityInstance.getAttributeValues().add( attributeValue );
+ entityInstance.getTrackedEntityAttributeValues().add( attributeValue );
return entityInstance;
}
@@ -1572,7 +1571,7 @@
* @param auths authorities to grant to user.
* @return the user.
*/
- protected User createUserAndInjectSecurityContext( Set<OrganisationUnit> organisationUnits,
+ protected User createUserAndInjectSecurityContext( Set<OrganisationUnit> organisationUnits,
Set<OrganisationUnit> dataViewOrganisationUnits, boolean allAuth, String... auths )
{
Assert.notNull( userService, "UserService must be injected in test" );