Search in sources :

Example 6 with RepeatableStageParams

use of org.hisp.dhis.common.RepeatableStageParams in project dhis2-core by dhis2.

the class DefaultQueryItemLocator method getRepeatableStageParams.

private static RepeatableStageParams getRepeatableStageParams(String dimension) {
    try {
        RepeatableStageParams repeatableStageParams = RepeatableStageParamsHelper.getRepeatableStageParams(dimension);
        repeatableStageParams.setDimension(dimension);
        return repeatableStageParams;
    } catch (InvalidRepeatableStageParamsException e) {
        ErrorMessage errorMessage = new ErrorMessage(dimension, ErrorCode.E1101);
        throw new IllegalQueryException(errorMessage);
    }
}
Also used : InvalidRepeatableStageParamsException(org.hisp.dhis.common.exception.InvalidRepeatableStageParamsException) RepeatableStageParams(org.hisp.dhis.common.RepeatableStageParams) IllegalQueryException(org.hisp.dhis.common.IllegalQueryException) ErrorMessage(org.hisp.dhis.feedback.ErrorMessage)

Example 7 with RepeatableStageParams

use of org.hisp.dhis.common.RepeatableStageParams in project dhis2-core by dhis2.

the class RepeatableStageParamsHelper method getRepeatableStageParams.

/**
 * @param startIndex
 * @param count
 * @return RepeatableStageParams instance
 */
private static RepeatableStageParams getRepeatableStageParams(int startIndex, int count) {
    final RepeatableStageParams repeatableStageParams = new RepeatableStageParams();
    repeatableStageParams.setStartIndex(startIndex);
    repeatableStageParams.setCount(count);
    repeatableStageParams.setDefaultObject(false);
    return repeatableStageParams;
}
Also used : RepeatableStageParams(org.hisp.dhis.common.RepeatableStageParams)

Example 8 with RepeatableStageParams

use of org.hisp.dhis.common.RepeatableStageParams in project dhis2-core by dhis2.

the class RepeatableStageParamsHelper method getRepeatableStageParams.

/**
 * @param startIndex
 * @param count
 * @param startDate
 * @param endDate
 * @return RepeatableStageParams instance
 */
private static RepeatableStageParams getRepeatableStageParams(int startIndex, int count, Date startDate, Date endDate) {
    final RepeatableStageParams repeatableStageParams = new RepeatableStageParams();
    repeatableStageParams.setStartIndex(startIndex);
    repeatableStageParams.setCount(count);
    repeatableStageParams.setStartDate(startDate);
    repeatableStageParams.setEndDate(endDate);
    repeatableStageParams.setDefaultObject(false);
    return repeatableStageParams;
}
Also used : RepeatableStageParams(org.hisp.dhis.common.RepeatableStageParams)

Example 9 with RepeatableStageParams

use of org.hisp.dhis.common.RepeatableStageParams in project dhis2-core by dhis2.

the class RepeatableStageParamsHelper method getRepeatableStageParams.

/**
 * @param startDate
 * @param endDate
 * @return RepeatableStageParams instance
 */
private static RepeatableStageParams getRepeatableStageParams(Date startDate, Date endDate) {
    final RepeatableStageParams repeatableStageParams = new RepeatableStageParams();
    repeatableStageParams.setStartIndex(0);
    repeatableStageParams.setCount(Integer.MAX_VALUE);
    repeatableStageParams.setStartDate(startDate);
    repeatableStageParams.setEndDate(endDate);
    repeatableStageParams.setDefaultObject(false);
    return repeatableStageParams;
}
Also used : RepeatableStageParams(org.hisp.dhis.common.RepeatableStageParams)

Aggregations

RepeatableStageParams (org.hisp.dhis.common.RepeatableStageParams)9 DimensionalItemObject (org.hisp.dhis.common.DimensionalItemObject)3 QueryItem (org.hisp.dhis.common.QueryItem)3 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)2 BaseDimensionalItemObject (org.hisp.dhis.common.BaseDimensionalItemObject)2 GridHeader (org.hisp.dhis.common.GridHeader)2 Preconditions.checkNotNull (com.google.common.base.Preconditions.checkNotNull)1 Lists (com.google.common.collect.Lists)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 Collectors (java.util.stream.Collectors)1 StringUtils.joinWith (org.apache.commons.lang3.StringUtils.joinWith)1 DIMENSIONS (org.hisp.dhis.analytics.AnalyticsMetaDataKey.DIMENSIONS)1