001/* 002 * (C) Copyright 2010 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Anahide Tchertchian 018 */ 019 020package org.nuxeo.ecm.platform.query.api; 021 022import java.util.List; 023import java.util.Map; 024 025import org.nuxeo.ecm.core.api.SortInfo; 026 027/** 028 * Page provider descriptor interface handling all attributes common to a {@link PageProvider} generation. 029 * 030 * @author Anahide Tchertchian 031 * @since 5.4 032 */ 033public interface PageProviderDefinition { 034 035 String getName(); 036 037 /** 038 * @since 6.0 039 */ 040 void setName(String name); 041 042 boolean isEnabled(); 043 044 /** 045 * @since 5.6 046 */ 047 void setEnabled(boolean enabled); 048 049 Map<String, String> getProperties(); 050 051 String[] getQueryParameters(); 052 053 boolean getQuotePatternParameters(); 054 055 boolean getEscapePatternParameters(); 056 057 void setPattern(String pattern); 058 059 String getPattern(); 060 061 WhereClauseDefinition getWhereClause(); 062 063 /** 064 * Returns the search document type used for wher clause, aggregates and named parameters. 065 * 066 * @since 6.0 067 */ 068 String getSearchDocumentType(); 069 070 boolean isSortable(); 071 072 List<SortInfo> getSortInfos(); 073 074 String getSortInfosBinding(); 075 076 long getPageSize(); 077 078 String getPageSizeBinding(); 079 080 Long getMaxPageSize(); 081 082 /** 083 * Returns the list of page size options to present to users. 084 * <p> 085 * Uses an hardcoded list of values, and adds up the page provider initial page size to it. 086 * 087 * @since 7.3 088 */ 089 List<Long> getPageSizeOptions(); 090 091 /** 092 * @since 5.6 093 */ 094 PageProviderDefinition clone(); 095 096 /** 097 * @since 6.0 098 */ 099 List<AggregateDefinition> getAggregates(); 100 101 /** 102 * @since 7.4 103 */ 104 boolean isUsageTrackingEnabled(); 105 106 /** 107 * @since 8.4 108 */ 109 List<QuickFilter> getQuickFilters(); 110 111}