Package org.ametys.cms.content
Class ContentQueryEnumerator
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.content.ContentQueryEnumerator
- All Implemented Interfaces:
Enumerator<String>,LogEnabled,Component,Configurable,Serviceable
public class ContentQueryEnumerator
extends AbstractLogEnabled
implements Enumerator<String>, Configurable, Serviceable, Component
Enumerator of the contents matching a configured query
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AmetysObjectResolverThe AmetysObjectResolver instanceThe list of content types to fill enum with -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_configureContentTypes(Configuration configuration) Configure the content type idsvoidconfigure(Configuration configuration) Retrieves a single label from a value.Provides the enumerated values with their optional label.voidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.runtime.model.Enumerator
getConfiguration
-
Field Details
-
_contentTypes
The list of content types to fill enum with -
_ametysObjectResolver
The AmetysObjectResolver instance
-
-
Constructor Details
-
ContentQueryEnumerator
public ContentQueryEnumerator()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
getEntry
Description copied from interface:EnumeratorRetrieves a single label from a value.- Specified by:
getEntryin interfaceEnumerator<String>- Parameters:
value- the value.- Returns:
- the label or
nullif not found. - Throws:
Exception- if an error occurs.
-
getTypedEntries
Description copied from interface:EnumeratorProvides the enumerated values with their optional label.- Specified by:
getTypedEntriesin interfaceEnumerator<String>- Returns:
- the enumerated values and their label.
- Throws:
Exception- if an error occurs. TODO NEWATTRIBUTEAPI: rename this method whenEnumeratorwill be removed
-
_configureContentTypes
protected List<String> _configureContentTypes(Configuration configuration) throws ConfigurationException Configure the content type ids- Parameters:
configuration- The content types configuration- Returns:
- The set of content type ids
- Throws:
ConfigurationException- If an error occurs
-