Class CmsDocumentXmlContent
- All Implemented Interfaces:
I_CmsDocumentFactory
,I_CmsSearchExtractor
CmsResourceTypeXmlContent
.
All XML nodes from the content for all locales will be stored separately in the item map
which you can access using CmsExtractionResult.getContentItems()
. The XML elements will be
accessible using their xpath. The xpath will have the form like for example
Text[1]
or Nested[1]/Text[1]
.
- Since:
- 6.0.0
-
Field Summary
Fields inherited from class org.opencms.search.documents.A_CmsVfsDocument
DEFAULT_ALL_TYPES, DEFAULT_ALL_UNCONFIGURED_TYPES, m_name
-
Constructor Summary
ConstructorDescriptionCmsDocumentXmlContent
(String name) Creates a new instance of this lucene document factory. -
Method Summary
Modifier and TypeMethodDescriptioncreateDocument
(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) Creates the Lucene Document for the given VFS resource and the given search index.extractContent
(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) Returns the raw text content of a given VFS resource of typeCmsResourceTypeXmlContent
.boolean
Returnstrue
if this document factory is locale depended.boolean
Returnstrue
if result caching is supported for this factory.Methods inherited from class org.opencms.search.documents.A_CmsVfsDocument
getCache, getDocumentKey, getDocumentKeys, getName, logContentExtraction, readFile, setCache
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.search.documents.I_CmsDocumentFactory
isOnlyDependentOnContent
-
Constructor Details
-
CmsDocumentXmlContent
Creates a new instance of this lucene document factory.- Parameters:
name
- name of the document type
-
-
Method Details
-
createDocument
public I_CmsSearchDocument createDocument(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) throws CmsException Description copied from class:A_CmsVfsDocument
Creates the Lucene Document for the given VFS resource and the given search index.This triggers the indexing process for the given VFS resource according to the configuration of the provided index.
The provided index resource contains the basic contents to index. The provided search index contains the configuration what to index, such as the locale and possible special field mappings.
- Specified by:
createDocument
in interfaceI_CmsDocumentFactory
- Overrides:
createDocument
in classA_CmsVfsDocument
- Parameters:
cms
- the OpenCms user context used to access the OpenCms VFSresource
- the search index resource to create the Lucene document fromindex
- the search index to create the Document for- Returns:
- the Search Document for the given index resource and the given search index
- Throws:
CmsException
- if something goes wrong- See Also:
-
extractContent
public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) throws CmsException Returns the raw text content of a given VFS resource of typeCmsResourceTypeXmlContent
.All XML nodes from the content for all locales will be stored separately in the item map which you can access using
CmsExtractionResult.getContentItems()
. The XML elements will be accessible using their xpath. The xpath will have the form like for exampleText[1]
orNested[1]/Text[1]
.- 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
Description copied from interface:I_CmsDocumentFactory
Returnstrue
if this document factory is locale depended.- Returns:
true
if this document factory is locale depended- 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:
-