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
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
The AmetysObjectResolver instanceThe list of content types to fill enum with -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_configureContentTypes
(Configuration configuration) Configure the content type idsvoid
configure
(Configuration configuration) Retrieves a single label from a value.Provides the enumerated values with their optional label.void
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getEntry
Description copied from interface:Enumerator
Retrieves a single label from a value.- Specified by:
getEntry
in interfaceEnumerator<String>
- Parameters:
value
- the value.- Returns:
- the label or
null
if not found. - Throws:
Exception
- if an error occurs.
-
getTypedEntries
Description copied from interface:Enumerator
Provides the enumerated values with their optional label.- Specified by:
getTypedEntries
in interfaceEnumerator<String>
- Returns:
- the enumerated values and their label.
- Throws:
Exception
- if an error occurs. TODO NEWATTRIBUTEAPI: rename this method whenEnumerator
will 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
-