Skip to content

Commit

Permalink
Merge pull request #28 from uonafya/upstream-updates
Browse files Browse the repository at this point in the history
Upstream updates
  • Loading branch information
bangadennis authored May 12, 2017
2 parents d6efe89 + 25d5b05 commit 4e62c32
Show file tree
Hide file tree
Showing 99 changed files with 1,198 additions and 3,135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,20 @@ public DateTimeUnit isoStartOfYear( int year )
{
return new DateTimeUnit( year, 1, 1 );
}

@Override
public boolean isValid( DateTimeUnit dateTime )
{
if ( dateTime.getMonth() < 1 || dateTime.getMonth() > monthsInYear() )
{
return false;
}

if ( dateTime.getDay() < 1 || dateTime.getDay() > daysInMonth( dateTime.getYear(), dateTime.getMonth() ) )
{
return false;
}

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,12 @@ public interface Calendar
* @return
*/
DateTimeUnit isoStartOfYear( int year );

/**
* Is DateTimeUnit valid for this calendar.
*
* @param dateTime DateTime to check
* @return true if valid, false if not
*/
boolean isValid( DateTimeUnit dateTime );
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.schema.annotation.PropertyRange;
import org.hisp.dhis.user.User;

import java.util.ArrayList;
Expand Down Expand Up @@ -420,6 +421,7 @@ public void setRangeAxisMaxValue( Double rangeAxisMaxValue )

@JsonProperty
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
@PropertyRange( min = Integer.MIN_VALUE )
public Double getRangeAxisMinValue()
{
return rangeAxisMinValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ public abstract class BaseAnalyticalObject

protected String title;

protected String subtitle;

protected Set<Interpretation> interpretations = new HashSet<>();

// -------------------------------------------------------------------------
Expand Down Expand Up @@ -853,12 +855,14 @@ public void mergeWith( IdentifiableObject other, MergeMode mergeMode )
relatives = object.getRelatives();
aggregationType = object.getAggregationType();
title = object.getTitle();
subtitle = object.getSubtitle();
}
else if ( mergeMode.isMerge() )
{
relatives = object.getRelatives() == null ? relatives : object.getRelatives();
aggregationType = object.getAggregationType() == null ? aggregationType : object.getAggregationType();
title = object.getTitle() == null ? title : object.getTitle();
subtitle = object.getSubtitle() == null ? subtitle : object.getSubtitle();
}

dataDimensionItems.addAll( object.getDataDimensionItems() );
Expand Down Expand Up @@ -1167,6 +1171,18 @@ public void setTitle( String title )
this.title = title;
}

@JsonProperty
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public String getSubtitle()
{
return subtitle;
}

public void setSubtitle( String subtitle )
{
this.subtitle = subtitle;
}

@JsonProperty
@JsonSerialize( contentAs = BaseIdentifiableObject.class )
@JacksonXmlElementWrapper( localName = "interpretations", namespace = DxfNamespaces.DXF_2_0 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,10 @@ List<DataValue> getRecursiveDeflatedDataValues( DataElement dataElement, DataEle
* date time.
*
* @param date the date time.
* @param includeDeleted whether to include deleted data values.
* @return the number of DataValues.
*/
int getDataValueCountLastUpdatedAfter( Date date );
int getDataValueCountLastUpdatedAfter( Date date, boolean includeDeleted );

/**
* Returns a map of values for each attribute option combo found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ List<DeflatedDataValue> sumRecursiveDeflatedDataValues(
* date time.
*
* @param date the date time.
* @param includeDeleted whether to include deleted data values.
* @return the number of DataValues.
*/
int getDataValueCountLastUpdatedAfter( Date date );
int getDataValueCountLastUpdatedAfter( Date date, boolean includeDeleted );

/**
* Returns a map of values for each attribute option combo found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

import java.util.List;
import java.util.Date;

/**
* @author Stian Sandvold
Expand All @@ -48,6 +49,14 @@ public interface KeyJsonValueService
*/
List<String> getKeysInNamespace( String namespace );

/**
* Retrieves a list of keys from a namespace which are updated after lastUpdated time
* @param namespace the namespace to retrieve keys from
* @param lastUpdated the lastUpdated time to retrieve keys from
* @return a list of strings representing the keys from the namespace
*/
List<String> getKeysInNamespace( String namespace, Date lastUpdated );

/**
* Deletes all keys associated with a given namespace
* @param namespace the namespace to delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.hisp.dhis.common.GenericIdentifiableObjectStore;

import java.util.List;
import java.util.Date;

/**
* @author Stian Sandvold
Expand All @@ -51,6 +52,14 @@ public interface KeyJsonValueStore
*/
List<String> getKeysInNamespace( String namespace );

/**
* Retrieves a list of keys associated with a given namespace which are updated after lastUpdated time.
* @param namespace the namespace to retrieve keys from
* @param lastUpdated the lastUpdated time to retrieve keys from
* @return a list of strings representing the different keys in the namespace
*/
List<String> getKeysInNamespace( String namespace, Date lastUpdated );

/**
* Retrieves a list of KeyJsonValue objects based on a given namespace
* @param namespace the namespace to retrieve KeyJsonValues from
Expand Down

This file was deleted.

Loading

0 comments on commit 4e62c32

Please sign in to comment.