Package org.opencms.search.solr
Class CmsSolrDocumentXmlContent
java.lang.Object
org.opencms.search.documents.A_CmsVfsDocument
org.opencms.search.solr.CmsSolrDocumentXmlContent
- All Implemented Interfaces:
I_CmsDocumentFactory
,I_CmsSearchExtractor
- Direct Known Subclasses:
CmsSolrDocumentContainerPage
Special document text extraction factory for Solr index.
- Since:
- 8.5.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Mapping name used to indicate that the value should be used for the gallery description.static final String
Mapping name used to indicate that the value should be used for the gallery name.Fields inherited from class org.opencms.search.documents.A_CmsVfsDocument
DEFAULT_ALL_TYPES, DEFAULT_ALL_UNCONFIGURED_TYPES, m_name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
collectSchemaXpathsForSimpleValues
(CmsObject cms, CmsXmlContentDefinition def, String path, Set<String> result) Collects a list of all possible XPaths for a content definition.extractContent
(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) Extracts the content of a given index resource according to the resource file type and the configuration of the given index.static CmsExtractionResult
extractXmlContent
(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) Extracts the content of a single XML content resource.static CmsExtractionResult
extractXmlContent
(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, Locale forceLocale) Extracts the content of a single XML content resource.static CmsExtractionResult
extractXmlContent
(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, Locale forceLocale, Set<CmsUUID> alreadyExtracted) Extracts the content of a single XML content resource.static CmsExtractionResult
extractXmlContent
(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, Locale forceLocale, Set<CmsUUID> alreadyExtracted, Consumer<A_CmsXmlDocument> contentConsumer) Extracts the content of a single XML content resource.boolean
Solr index content is stored in multiple languages, so the result is NOT locale dependent.boolean
Returnstrue
if the extraction result dependent on the resources content itself, i.e., has not to be re-extracted if the content date is unchanged.boolean
Returnstrue
if result caching is supported for this factory.Methods inherited from class org.opencms.search.documents.A_CmsVfsDocument
createDocument, getCache, getDocumentKey, getDocumentKeys, getName, logContentExtraction, readFile, setCache
-
Field Details
-
MAPPING_GALLERY_DESCRIPTION
Mapping name used to indicate that the value should be used for the gallery description.- See Also:
-
MAPPING_GALLERY_NAME
Mapping name used to indicate that the value should be used for the gallery name.- See Also:
-
-
Constructor Details
-
CmsSolrDocumentXmlContent
Public constructor.- Parameters:
name
- the name for the document type
-
-
Method Details
-
collectSchemaXpathsForSimpleValues
public static void collectSchemaXpathsForSimpleValues(CmsObject cms, CmsXmlContentDefinition def, String path, Set<String> result) Collects a list of all possible XPaths for a content definition.- Parameters:
cms
- the CMS context to usedef
- the content definitionpath
- the path of the given content definitionresult
- the set used to collect the XPaths
-
extractXmlContent
public static CmsExtractionResult extractXmlContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) throws CmsException Extracts the content of a single XML content resource.- Parameters:
cms
- the cms contextresource
- the resourceindex
- the used index- Returns:
- the extraction result
- Throws:
CmsException
- in case reading or unmarshalling the content fails
-
extractXmlContent
public static CmsExtractionResult extractXmlContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, Locale forceLocale) throws CmsException Extracts the content of a single XML content resource.- Parameters:
cms
- the cms contextresource
- the resourceindex
- the used indexforceLocale
- if set, only the content values for the given locale will be extracted- Returns:
- the extraction result
- Throws:
CmsException
- in case reading or unmarshalling the content fails
-
extractXmlContent
public static CmsExtractionResult extractXmlContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, Locale forceLocale, Set<CmsUUID> alreadyExtracted) throws CmsException Extracts the content of a single XML content resource.- Parameters:
cms
- the cms contextresource
- the resourceindex
- the used indexforceLocale
- if set, only the content values for the given locale will be extractedalreadyExtracted
- keeps track of ids of contents which have already been extracted- Returns:
- the extraction result
- Throws:
CmsException
- in case reading or unmarshalling the content fails
-
extractXmlContent
public static CmsExtractionResult extractXmlContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, Locale forceLocale, Set<CmsUUID> alreadyExtracted, Consumer<A_CmsXmlDocument> contentConsumer) throws CmsException Extracts the content of a single XML content resource.- Parameters:
cms
- the cms contextresource
- the resourceindex
- the used indexforceLocale
- if set, only the content values for the given locale will be extractedalreadyExtracted
- keeps track of ids of contents which have already been extractedcontentConsumer
- gets called with the unmarshalled content object- Returns:
- the extraction result
- Throws:
CmsException
- in case reading or unmarshalling the content fails
-
extractContent
public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) throws CmsException Description copied from interface:I_CmsSearchExtractor
Extracts the content of a given index resource according to the resource file type and the configuration of the given index.- Parameters:
cms
- the cms objectresource
- the resource to extract the content fromindex
- the index to extract the content for- Returns:
- the extracted content of the resource
- Throws:
CmsException
- if something goes wrong- See Also:
-
isLocaleDependend
Solr index content is stored in multiple languages, so the result is NOT locale dependent.- Returns:
true
if this document factory is locale depended- See Also:
-
isOnlyDependentOnContent
Description copied from interface:I_CmsDocumentFactory
Returnstrue
if the extraction result dependent on the resources content itself, i.e., has not to be re-extracted if the content date is unchanged.- Returns:
true
if the extraction result dependent on the resources content itself, i.e., has not to be re-extracted if the content date is unchanged.- See Also:
-
isUsingCache
Description copied from interface:I_CmsDocumentFactory
Returnstrue
if result caching is supported for this factory.- Returns:
true
if result caching is supported for this factory- See Also:
-