=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryOperator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryOperator.java 2014-05-08 17:33:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryOperator.java 2014-06-27 10:12:09 +0000
@@ -1,5 +1,36 @@
package org.hisp.dhis.common;
+/*
+ * Copyright (c) 2004-2014, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @author Lars Helge Overland
+ */
public enum QueryOperator
{
EQ, GT, GE, LT, LE, NE, LIKE, IN;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceQueryParams.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceQueryParams.java 2014-06-14 17:58:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceQueryParams.java 2014-06-27 10:12:09 +0000
@@ -190,8 +190,8 @@
*
* If a query item is specified as an attribute item as well as a filter
* item, the filter item will be removed. In that case, if the attribute
- * item does not have a filter value and the filter item has a filter value,
- * it will be applied to the attribute item.
+ * item does not have any filters and the filter item has one or more filters,
+ * these will be applied to the attribute item.
*
*
*/
@@ -211,7 +211,7 @@
if ( !attribute.hasFilter() && filter.hasFilter() )
{
- attribute.getFilters().add( filter.getFilters().iterator().next() );
+ attribute.getFilters().addAll( filter.getFilters() );
}
filterIter.remove();
@@ -482,6 +482,21 @@
{
return ( getPageWithDefault() - 1 ) * getPageSizeWithDefault();
}
+
+ // -------------------------------------------------------------------------
+ // toString
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String toString()
+ {
+ return "[Query: " + query + ", Attributes: " + attributes + ", filters: " + filters +
+ ", program: " + program + ", program status " + programStatus + ", follow up: " + followUp +
+ ", program start date: " + programStartDate + ", program end date: " + programEndDate +
+ ", tracked entity: " + trackedEntity + ", org unit mode: " + organisationUnitMode +
+ ", event start date: " + eventStartDate + ", event end date: " + eventEndDate +
+ ", event status: " + eventStatus + "]";
+ }
// -------------------------------------------------------------------------
// Getters and setters
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java 2014-05-10 11:18:29 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java 2014-06-27 10:12:09 +0000
@@ -438,7 +438,7 @@
QueryItem queryItem = getQueryItem( program, split[0] );
- if ( split.length > 1 )
+ if ( split.length > 1 ) // Filters specified
{
for ( int i = 1; i < split.length; i += 2 )
{
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java 2014-06-14 17:58:11 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java 2014-06-27 10:12:09 +0000
@@ -177,8 +177,8 @@
// ---------------------------------------------------------------------
// If params of type query and no attributes or filters defined, use
- // attributes from program if exists, if not, use display-in-list
- // attributes.
+ // attributes from program if program is defined, if not, use
+ // display-in-list attributes.
// ---------------------------------------------------------------------
if ( params.isOrQuery() || !params.hasAttributes() )
@@ -222,7 +222,7 @@
{
grid.addHeader( new GridHeader( item.getItem().getUid(), item.getItem().getName() ) );
}
-
+
List