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
public class CmsSolrDocumentXmlContent extends A_CmsVfsDocument
Special document text extraction factory for Solr index.- Since:
- 8.5.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MAPPING_GALLERY_DESCRIPTION
Mapping name used to indicate that the value should be used for the gallery description.static java.lang.String
MAPPING_GALLERY_NAME
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
Constructors Constructor Description CmsSolrDocumentXmlContent(java.lang.String name)
Public constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
collectSchemaXpathsForSimpleValues(CmsObject cms, CmsXmlContentDefinition def, java.lang.String path, java.util.Set<java.lang.String> result)
Collects a list of all possible XPaths for a content definition.I_CmsExtractionResult
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, java.util.Locale forceLocale)
Extracts the content of a single XML content resource.static CmsExtractionResult
extractXmlContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, java.util.Locale forceLocale, java.util.Set<CmsUUID> alreadyExtracted)
Extracts the content of a single XML content resource.static CmsExtractionResult
extractXmlContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index, java.util.Locale forceLocale, java.util.Set<CmsUUID> alreadyExtracted, java.util.function.Consumer<A_CmsXmlDocument> contentConsumer)
Extracts the content of a single XML content resource.boolean
isLocaleDependend()
Solr index content is stored in multiple languages, so the result is NOT locale dependent.boolean
isUsingCache()
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 Detail
-
MAPPING_GALLERY_DESCRIPTION
public static final java.lang.String MAPPING_GALLERY_DESCRIPTION
Mapping name used to indicate that the value should be used for the gallery description.- See Also:
- Constant Field Values
-
MAPPING_GALLERY_NAME
public static final java.lang.String MAPPING_GALLERY_NAME
Mapping name used to indicate that the value should be used for the gallery name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsSolrDocumentXmlContent
public CmsSolrDocumentXmlContent(java.lang.String name)
Public constructor.- Parameters:
name
- the name for the document type
-
-
Method Detail
-
collectSchemaXpathsForSimpleValues
public static void collectSchemaXpathsForSimpleValues(CmsObject cms, CmsXmlContentDefinition def, java.lang.String path, java.util.Set<java.lang.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, java.util.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, java.util.Locale forceLocale, java.util.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 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, java.util.Locale forceLocale, java.util.Set<CmsUUID> alreadyExtracted, java.util.function.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:
CmsDocumentXmlContent.extractContent(org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.I_CmsSearchIndex)
-
isLocaleDependend
public boolean 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:
I_CmsDocumentFactory.isLocaleDependend()
-
isUsingCache
public boolean 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:
I_CmsDocumentFactory.isUsingCache()
-
-