001/*
002 * (C) Copyright 2010 Nuxeo SA (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.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 *     Anahide Tchertchian
016 */
017
018package org.nuxeo.ecm.platform.query.api;
019
020import java.io.Serializable;
021import java.util.List;
022import java.util.Map;
023
024import org.nuxeo.ecm.core.api.SortInfo;
025
026/**
027 * Page provider descriptor interface handling all attributes common to a {@link PageProvider} generation.
028 *
029 * @author Anahide Tchertchian
030 * @since 5.4
031 */
032public interface PageProviderDefinition extends Serializable {
033
034    String getName();
035
036    /**
037     * @since 6.0
038     */
039    void setName(String name);
040
041    boolean isEnabled();
042
043    /**
044     * @since 5.6
045     */
046    void setEnabled(boolean enabled);
047
048    Map<String, String> getProperties();
049
050    String[] getQueryParameters();
051
052    boolean getQuotePatternParameters();
053
054    boolean getEscapePatternParameters();
055
056    void setPattern(String pattern);
057
058    String getPattern();
059
060    WhereClauseDefinition getWhereClause();
061
062    /**
063     * Returns the search document type used for wher clause, aggregates and named parameters.
064     *
065     * @since 6.0
066     */
067    String getSearchDocumentType();
068
069    boolean isSortable();
070
071    List<SortInfo> getSortInfos();
072
073    String getSortInfosBinding();
074
075    long getPageSize();
076
077    String getPageSizeBinding();
078
079    Long getMaxPageSize();
080
081    /**
082     * Returns the list of page size options to present to users.
083     * <p>
084     * Uses an hardcoded list of values, and adds up the page provider initial page size to it.
085     *
086     * @since 7.3
087     */
088    List<Long> getPageSizeOptions();
089
090    /**
091     * @since 5.6
092     */
093    PageProviderDefinition clone();
094
095    /**
096     * @since 6.0
097     */
098    List<AggregateDefinition> getAggregates();
099
100    /**
101     * @since 7.4
102     */
103    public boolean isUsageTrackingEnabled();
104
105}