Class PageProviderServiceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.query.core.PageProviderServiceImpl
-
- All Implemented Interfaces:
Serializable
,PageProviderService
,Adaptable
,Component
,Extensible
,TimestampedService
public class PageProviderServiceImpl extends DefaultComponent implements PageProviderService
- Since:
- 5.4
- Author:
- Anahide Tchertchian
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ELASTICSEARCH_NXQL_PAGE_PROVIDER_CLASS_NAME
static String
PROVIDER_EP
protected PageProviderRegistry
providerReg
static String
REPLACER_EP
protected PageProviderClassReplacerRegistry
replacersReg
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Fields inherited from interface org.nuxeo.ecm.platform.query.api.PageProviderService
NAMED_PARAMETERS
-
-
Constructor Summary
Constructors Constructor Description PageProviderServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PageProvider<?>
getPageProvider(String name, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, Object... parameters)
Returns an instance of page provider with given name.PageProvider<?>
getPageProvider(String name, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, List<String> highlights, List<QuickFilter> quickFilters, Object... parameters)
Returns an instance of page provider with given name.PageProvider<?>
getPageProvider(String name, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Long currentOffset, Map<String,Serializable> properties, List<String> highlights, List<QuickFilter> quickFilters, Object... parameters)
Returns an instance of page provider with given name.PageProvider<?>
getPageProvider(String name, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, Object... parameters)
Returns an instance of page provider with given name.PageProvider<?>
getPageProvider(String name, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, List<String> highlights, List<QuickFilter> quickFilters, Object... parameters)
Returns an instance of page provider with given name.PageProvider<?>
getPageProvider(String name, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, List<QuickFilter> quickFilters, Object... parameters)
Returns an instance of page provider with given name.PageProvider<?>
getPageProvider(String name, PageProviderDefinition desc, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Long currentOffset, Map<String,Serializable> properties, List<String> highlights, List<QuickFilter> quickFilters, Object... parameters)
Returns an instance of page provider with given name and definition.PageProvider<?>
getPageProvider(String name, PageProviderDefinition desc, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, Object... parameters)
Returns an instance of page provider with given name and definition.PageProvider<?>
getPageProvider(String name, PageProviderDefinition desc, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, List<String> highlights, List<QuickFilter> quickFilters, Object... parameters)
Returns an instance of page provider with given name.PageProvider<?>
getPageProvider(String name, PageProviderDefinition desc, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, List<QuickFilter> quickFilters, Object... parameters)
Returns an instance of page provider with given name.PageProviderDefinition
getPageProviderDefinition(String name)
Returns a named page provider definition.Set<String>
getPageProviderDefinitionNames()
Returns all the registered page provider names, or an empty set if no page provider is registered.PageProviderType
getPageProviderType(PageProvider<?> pageProvider)
Returns thePageProviderType
of the given page provider.protected PageProvider<?>
newCoreQueryPageProviderInstance(String name)
protected PageProvider<?>
newPageProviderInstance(String name, Class<? extends PageProvider<?>> klass)
protected PageProvider<?>
newPageProviderInstance(String name, PageProviderDefinition desc)
void
registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
void
registerPageProviderDefinition(PageProviderDefinition desc)
void
start(ComponentContext context)
Start the component.void
unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
void
unregisterPageProviderDefinition(PageProviderDefinition desc)
-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, stop, unregister, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
PROVIDER_EP
public static final String PROVIDER_EP
- See Also:
- Constant Field Values
-
REPLACER_EP
public static final String REPLACER_EP
- See Also:
- Constant Field Values
-
ELASTICSEARCH_NXQL_PAGE_PROVIDER_CLASS_NAME
public static final String ELASTICSEARCH_NXQL_PAGE_PROVIDER_CLASS_NAME
- Since:
- 2021.8
- See Also:
- Constant Field Values
-
providerReg
protected PageProviderRegistry providerReg
-
replacersReg
protected PageProviderClassReplacerRegistry replacersReg
-
-
Method Detail
-
getPageProviderDefinition
public PageProviderDefinition getPageProviderDefinition(String name)
Description copied from interface:PageProviderService
Returns a named page provider definition.Useful to share the definition between the page provider service, and the content view service (as content views can reference a named page provider that is already registered instead of redefining it).
- Specified by:
getPageProviderDefinition
in interfacePageProviderService
- Parameters:
name
- the page provider name- Returns:
- the page provider definition or null, if no page provider with this name was found.
-
getPageProvider
public PageProvider<?> getPageProvider(String name, PageProviderDefinition desc, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, List<String> highlights, List<QuickFilter> quickFilters, Object... parameters)
Description copied from interface:PageProviderService
Returns an instance of page provider with given name.- Specified by:
getPageProvider
in interfacePageProviderService
- See Also:
PageProviderService.getPageProvider(String, PageProviderDefinition, DocumentModel, List, Long, Long, Map, Object...)
-
getPageProvider
public PageProvider<?> getPageProvider(String name, PageProviderDefinition desc, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Long currentOffset, Map<String,Serializable> properties, List<String> highlights, List<QuickFilter> quickFilters, Object... parameters)
Description copied from interface:PageProviderService
Returns an instance of page provider with given name and definition.If not null, parameters sortInfos and pageSize will override information computed in the XML file. If not null, currentPage will override default current page (0).
- Specified by:
getPageProvider
in interfacePageProviderService
- Parameters:
name
- the name that will be set on the provider.desc
- the definition used to build the provider instance.searchDocument
- the search document to be used by the provider.sortInfos
- sort information to set on the provider instance.pageSize
- the provider page size.currentPage
- the provider current page index. Ignored if currentOffset set.currentOffset
- the provider current page offset.properties
- the provider properties.highlights
- list of the fields to be highlighted.quickFilters
- list of the quickFilters to be applied.parameters
- the provider parameters.- Returns:
- the page provider instance.
-
getPageProvider
public PageProvider<?> getPageProvider(String name, PageProviderDefinition desc, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, List<QuickFilter> quickFilters, Object... parameters)
Description copied from interface:PageProviderService
Returns an instance of page provider with given name.- Specified by:
getPageProvider
in interfacePageProviderService
- See Also:
PageProviderService.getPageProvider(String, PageProviderDefinition, DocumentModel, List, Long, Long, Map, Object...)
-
getPageProvider
public PageProvider<?> getPageProvider(String name, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, List<String> highlights, List<QuickFilter> quickFilters, Object... parameters)
Description copied from interface:PageProviderService
Returns an instance of page provider with given name.- Specified by:
getPageProvider
in interfacePageProviderService
- See Also:
PageProviderService.getPageProvider(String, List, Long, Long, Map, Object...)
-
getPageProvider
public PageProvider<?> getPageProvider(String name, PageProviderDefinition desc, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, Object... parameters)
Description copied from interface:PageProviderService
Returns an instance of page provider with given name and definition.Useful to share the definition between the page provider service, and the content view service (as content views can reference a named page provider that is already registered instead of redefining it).
If not null, parameters sortInfos and pageSize will override information computed in the XML file. If not null, currentPage will override default current page (0).
- Specified by:
getPageProvider
in interfacePageProviderService
- Parameters:
name
- the name that will be set on the provider.desc
- the definition used to build the provider instance.searchDocument
- the search document to be used by the provider.sortInfos
- sort information to set on the provider instance.pageSize
- the provider page size.currentPage
- the provider current page index.properties
- the provider propertiesparameters
- the provider parameters.- Returns:
- the page provider instance.
-
newPageProviderInstance
protected PageProvider<?> newPageProviderInstance(String name, PageProviderDefinition desc)
-
newCoreQueryPageProviderInstance
protected PageProvider<?> newCoreQueryPageProviderInstance(String name)
-
newPageProviderInstance
protected PageProvider<?> newPageProviderInstance(String name, Class<? extends PageProvider<?>> klass)
-
getPageProvider
public PageProvider<?> getPageProvider(String name, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, Object... parameters)
Description copied from interface:PageProviderService
Returns an instance of page provider with given name.- Specified by:
getPageProvider
in interfacePageProviderService
- See Also:
PageProviderService.getPageProvider(String, PageProviderDefinition, DocumentModel, List, Long, Long, Map, Object...)
-
getPageProvider
public PageProvider<?> getPageProvider(String name, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, List<String> highlights, List<QuickFilter> quickFilters, Object... parameters)
Description copied from interface:PageProviderService
Returns an instance of page provider with given name.- Specified by:
getPageProvider
in interfacePageProviderService
- See Also:
PageProviderService.getPageProvider(String, DocumentModel, List, Long, Long, Map, Object...)
-
getPageProvider
public PageProvider<?> getPageProvider(String name, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Long currentOffset, Map<String,Serializable> properties, List<String> highlights, List<QuickFilter> quickFilters, Object... parameters)
Description copied from interface:PageProviderService
Returns an instance of page provider with given name.- Specified by:
getPageProvider
in interfacePageProviderService
- Parameters:
name
- the name that will be set on the provider.searchDocument
- the search document to be used by the provider.sortInfos
- sort information to set on the provider instance.pageSize
- the provider page size.currentPage
- the provider current page index. Ignored if currentOffset set.currentOffset
- the provider current offset.properties
- the provider properties.highlights
- list of the fields to be highlighted.quickFilters
- list of the quickFilters to be applied.parameters
- the provider parameters.- Returns:
- the page provider instance.
-
getPageProvider
public PageProvider<?> getPageProvider(String name, DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, List<QuickFilter> quickFilters, Object... parameters)
Description copied from interface:PageProviderService
Returns an instance of page provider with given name.- Specified by:
getPageProvider
in interfacePageProviderService
- See Also:
PageProviderService.getPageProvider(String, DocumentModel, List, Long, Long, Map, Object...)
-
getPageProvider
public PageProvider<?> getPageProvider(String name, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Map<String,Serializable> properties, Object... parameters)
Description copied from interface:PageProviderService
Returns an instance of page provider with given name.- Specified by:
getPageProvider
in interfacePageProviderService
- Parameters:
name
- the page provider namesortInfos
- sort information to set on the provider instance.pageSize
- the provider page size.currentPage
- the provider current page index.properties
- the provider propertiesparameters
- the provider parameters.- Returns:
- the page provider instance.
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContribution
in classDefaultComponent
-
start
public void start(ComponentContext context)
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
registerPageProviderDefinition
public void registerPageProviderDefinition(PageProviderDefinition desc)
- Specified by:
registerPageProviderDefinition
in interfacePageProviderService
-
unregisterPageProviderDefinition
public void unregisterPageProviderDefinition(PageProviderDefinition desc)
- Specified by:
unregisterPageProviderDefinition
in interfacePageProviderService
-
getPageProviderDefinitionNames
public Set<String> getPageProviderDefinitionNames()
Description copied from interface:PageProviderService
Returns all the registered page provider names, or an empty set if no page provider is registered.- Specified by:
getPageProviderDefinitionNames
in interfacePageProviderService
-
getPageProviderType
public PageProviderType getPageProviderType(PageProvider<?> pageProvider)
Description copied from interface:PageProviderService
Returns thePageProviderType
of the given page provider.- Specified by:
getPageProviderType
in interfacePageProviderService
-
-