public abstract class A_CmsVfsDocument extends java.lang.Object implements I_CmsDocumentFactory
CmsResource
,
just requires a specialized implementation of
I_CmsSearchExtractor.extractContent(CmsObject, CmsResource, CmsSearchIndex)
for text extraction from the binary document content.限定符和类型 | 字段和说明 |
---|---|
protected java.lang.String |
m_name
Name of the document type.
|
构造器和说明 |
---|
A_CmsVfsDocument(java.lang.String name)
Creates a new instance of this lucene document factory.
|
限定符和类型 | 方法和说明 |
---|---|
I_CmsSearchDocument |
createDocument(CmsObject cms,
CmsResource resource,
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,
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, wait
isLocaleDependend, isUsingCache
extractContent
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, CmsSearchIndex index) throws CmsException
createDocument
在接口中 I_CmsDocumentFactory
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 forCmsException
- if something goes wrongI_CmsDocumentFactory.createDocument(CmsObject, CmsResource, CmsSearchIndex)
public CmsExtractionResultCache getCache()
I_CmsDocumentFactory
In case null
is returned, then result caching is not supported for this factory.
getCache
在接口中 I_CmsDocumentFactory
I_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
在接口中 I_CmsDocumentFactory
resourceTypes
- 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_CmsDocumentFactory
getName
在接口中 I_CmsDocumentFactory
I_CmsDocumentFactory.getName()
public void setCache(CmsExtractionResultCache cache)
I_CmsDocumentFactory
This should only be used for factories where I_CmsDocumentFactory.isUsingCache()
returns true
.
setCache
在接口中 I_CmsDocumentFactory
cache
- the disk based cache used to store the raw extraction resultsI_CmsDocumentFactory.setCache(org.opencms.search.documents.CmsExtractionResultCache)
protected void logContentExtraction(CmsResource resource, 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