public class ContentSearchHelper extends AbstractLogEnabled implements Component, Serviceable
| Modifier and Type | Field and Description |
|---|---|
protected ContentHelper |
_contentHelper
The content helper.
|
protected ContentTypeExtensionPoint |
_cTypeEP
The content type extension point.
|
protected ContentTypesHelper |
_cTypeHelper
The content type helper.
|
protected AmetysObjectResolver |
_resolver
The ametys object resolver.
|
protected SystemPropertyExtensionPoint |
_sysPropEP
The system property extension point.
|
static String |
ROLE
The component role.
|
| Constructor and Description |
|---|
ContentSearchHelper() |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
_isSimple(Content content) |
protected List<Map<String,Object>> |
getContentValues(List<Object> values)
Get information for UI on a content metadata
|
protected List<Map<String,Object>> |
getEnumeratedValues(List<Object> values,
Enumerator enumerator)
Transform the list of enumerated values into a list of info (as Maps).
|
protected SearchField |
getIndexingModelSearchField(String fieldPath,
Collection<String> contentTypes)
Get the
SearchField corresponding to the indexing field at the given path in the indexing model. |
MetadataDefinition |
getMetadataDefinition(MetadataIndexingField indexingField,
String[] remainingPathSegments,
List<String> joinPaths,
boolean addLast)
Get the metadata definition from the indexing field and compute the join paths.
|
SearchField |
getMetadataSearchField(String metadataPath,
MetadataType metadataType)
Get a
SearchField corresponding to a metadata. |
Object |
getMetadataValues(Content content,
String fullMetadataPath,
MetadataType type,
boolean multiple,
Enumerator enumerator,
boolean full)
Get the values of a Content's metadata (can be in another content).
|
SearchField |
getSearchField(Collection<String> contentTypes,
String fieldPath)
Get a
SearchField from a field name in a batch of content types. |
MetadataIndexingField |
getTitleMetadataIndexingField()
Get the metadata indexing field for the "title" standard metadata.
|
void |
service(ServiceManager manager) |
getLogger, setLoggerprotected ContentTypeExtensionPoint _cTypeEP
protected ContentTypesHelper _cTypeHelper
protected ContentHelper _contentHelper
protected SystemPropertyExtensionPoint _sysPropEP
protected AmetysObjectResolver _resolver
public ContentSearchHelper()
public void service(ServiceManager manager) throws ServiceException
service in interface ServiceableServiceExceptionpublic MetadataIndexingField getTitleMetadataIndexingField()
public SearchField getMetadataSearchField(String metadataPath, MetadataType metadataType)
SearchField corresponding to a metadata.metadataPath - The metadata path.metadataType - The metadata type.public SearchField getSearchField(Collection<String> contentTypes, String fieldPath)
SearchField from a field name in a batch of content types.contentTypes - The content types, can be empty to search on any content type.
In that case, only the title metadata and system properties will be usable in sort and facets specs.fieldPath - The field path, can be either a system property ID or a indexing field name or path (not joined).SearchField corresponding to theprotected SearchField getIndexingModelSearchField(String fieldPath, Collection<String> contentTypes)
SearchField corresponding to the indexing field at the given path in the indexing model.fieldPath - The field path.contentTypes - The target content types.public MetadataDefinition getMetadataDefinition(MetadataIndexingField indexingField, String[] remainingPathSegments, List<String> joinPaths, boolean addLast)
indexingField - The initial indexing fieldremainingPathSegments - The path to access the metadata or an another indexing field from the initial indexing fieldjoinPaths - The consecutive's path in case of joint to access the field/metadataaddLast - true to add the last join path element to the list, false otherwise.public Object getMetadataValues(Content content, String fullMetadataPath, MetadataType type, boolean multiple, Enumerator enumerator, boolean full)
content - The Content.fullMetadataPath - The full metadata path, can represent a metadata in a joined content.type - The metadata type.multiple - If the metadata is multiple.enumerator - The metadata enumerator.full - True to generate full representation of metadata, false otherwise.protected List<Map<String,Object>> getEnumeratedValues(List<Object> values, Enumerator enumerator)
values - The original list of values.enumerator - The enumerator.protected List<Map<String,Object>> getContentValues(List<Object> values)
values - The list of content IDs.