public abstract class A_CmsVfsDocument extends java.lang.Object implements I_CmsDocumentFactory
CmsResource,
just requires a specialized implementation of
I_CmsSearchExtractor.extractContent(CmsObject, CmsResource, I_CmsSearchIndex)
for text extraction from the binary document content.| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
m_name
Name of the document type.
|
| Constructor and Description |
|---|
A_CmsVfsDocument(java.lang.String name)
Creates a new instance of this lucene document factory.
|
| Modifier and Type | Method and Description |
|---|---|
I_CmsSearchDocument |
createDocument(CmsObject cms,
CmsResource resource,
I_CmsSearchIndex index)
Generates a new lucene document instance from contents of the given resource for the provided index.
|
CmsExtractionResultCache |
getCache()
Returns the disk based cache used to store the raw extraction results.
|
static java.lang.String |
getDocumentKey(java.lang.String type,
java.lang.String mimeType)
Creates a document factory lookup key for the given resource type name / MIME type configuration.
|
java.util.List<java.lang.String> |
getDocumentKeys(java.util.List<java.lang.String> resourceTypes,
java.util.List<java.lang.String> mimeTypes)
Returns the list of accepted keys for the resource types that can be indexed using this document factory.
|
java.lang.String |
getName()
Returns the name of this document type factory.
|
protected void |
logContentExtraction(CmsResource resource,
I_CmsSearchIndex index)
Logs content extraction for the specified resource and index.
|
protected CmsFile |
readFile(CmsObject cms,
CmsResource resource)
Upgrades the given resource to a
CmsFile with content. |
void |
setCache(CmsExtractionResultCache cache)
Sets the disk based cache used to store the raw extraction results.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisLocaleDependend, isUsingCacheextractContentprotected java.lang.String m_name
public A_CmsVfsDocument(java.lang.String name)
name - name of the documenttypepublic static java.lang.String getDocumentKey(java.lang.String type, java.lang.String mimeType)
If the given mimeType is null, this indicates that the key should
match all VFS resource of the given resource type regardless of the MIME type.
type - the resource type name to usemimeType - the MIME type to usepublic I_CmsSearchDocument createDocument(CmsObject cms, CmsResource resource, I_CmsSearchIndex index) throws CmsException
createDocument in interface I_CmsDocumentFactorycms - 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 forCmsException - if something goes wrongI_CmsDocumentFactory.createDocument(CmsObject, CmsResource, I_CmsSearchIndex)public CmsExtractionResultCache getCache()
I_CmsDocumentFactory
In case null is returned, then result caching is not supported for this factory.
getCache in interface I_CmsDocumentFactoryI_CmsDocumentFactory.getCache()public java.util.List<java.lang.String> getDocumentKeys(java.util.List<java.lang.String> resourceTypes, java.util.List<java.lang.String> mimeTypes) throws CmsException
I_CmsDocumentFactory
The result List contains String objects.
This String is later matched against getDocumentKey(String, String) to find
the corrospondig I_CmsDocumentFactory for a resource to index.
The list of accepted resource types may contain a catch-all entry "*"; in this case, a list for all possible resource types is returned, calculated by a logic depending on the document handler class.
getDocumentKeys in interface I_CmsDocumentFactoryresourceTypes - list of accepted resource typesmimeTypes - list of accepted mime typesCmsException - if something goes wrongI_CmsDocumentFactory.getDocumentKeys(java.util.List, java.util.List)public java.lang.String getName()
I_CmsDocumentFactorygetName in interface I_CmsDocumentFactoryI_CmsDocumentFactory.getName()public void setCache(CmsExtractionResultCache cache)
I_CmsDocumentFactory
This should only be used for factories where I_CmsDocumentFactory.isUsingCache() returns true.
setCache in interface I_CmsDocumentFactorycache - the disk based cache used to store the raw extraction resultsI_CmsDocumentFactory.setCache(org.opencms.search.documents.CmsExtractionResultCache)protected void logContentExtraction(CmsResource resource, I_CmsSearchIndex index)
resource - the resource to log content extraction forindex - the search index to log content extraction forprotected CmsFile readFile(CmsObject cms, CmsResource resource) throws CmsException, CmsIndexNoContentException
CmsFile with content.cms - the current users OpenCms contextresource - the resource to upgradeCmsFile with contentCmsException - if the resource could not be readCmsIndexNoContentException - if the resource has no content