001/* 002 * (C) Copyright 2014 Nuxeo SAS (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl-2.1.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Benoit Delbosc 016 */ 017 018package org.nuxeo.ecm.platform.query.api; 019 020import java.util.List; 021import java.util.Map; 022 023/** 024 * @since 6.0 025 */ 026public interface AggregateDefinition { 027 028 String getId(); 029 030 void setId(String id); 031 032 String getType(); 033 034 void setType(String type); 035 036 void setProperty(String name, String value); 037 038 Map<String, String> getProperties(); 039 040 List<AggregateRangeDefinition> getRanges(); 041 042 void setRanges(List<AggregateRangeDefinition> ranges); 043 044 List<AggregateRangeDateDefinition> getDateRanges(); 045 046 void setDateRanges(List<AggregateRangeDateDefinition> ranges); 047 048 /** 049 * Get the document aggregator field 050 */ 051 String getDocumentField(); 052 053 void setDocumentField(String parameter); 054 055 /** 056 * Get the ref of the search input, the type of the field must be nxs:stringList 057 */ 058 PredicateFieldDefinition getSearchField(); 059 060 void setSearchField(PredicateFieldDefinition field); 061 062 AggregateDefinition clone(); 063 064 /** 065 * @return a map associating the key of the date range to its position in the definition. 066 */ 067 Map<String, Integer> getAggregateDateRangeDefinitionOrderMap(); 068 069 /** 070 * @return a map associating the key of the range to its position in the definition. 071 */ 072 Map<String, Integer> getAggregateRangeDefinitionOrderMap(); 073 074}