public class BinaryFileWithMetadataBatchIndexer extends AbstractBatchIndexer
BatchIndexer that tries to match the update/deleted files against a series of
metadata/binary path patterns. If a file is matched as metadata, it's is parsed for a reference to it's binary. If
one is found, then an update will be issued for the binary file along with the metadata that is extracted from the
metadata file, or a delete for the referenced binary file. If the file is matched as binary, then an update/delete
is issued without any metadata.| Modifier and Type | Class and Description |
|---|---|
static class |
BinaryFileWithMetadataBatchIndexer.EmptyContent |
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
binaryPathPatterns |
protected List<String> |
excludeMetadataProperties |
protected org.craftercms.core.processors.ItemProcessor |
itemProcessor |
protected List<String> |
metadataPathPatterns |
protected List<String> |
referenceXPaths |
excludeFileNamePatterns, includeFileNamePatterns, searchService| Constructor and Description |
|---|
BinaryFileWithMetadataBatchIndexer() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doSingleFileUpdate(String indexId,
String siteName,
org.craftercms.core.service.ContentStoreService contentStoreService,
org.craftercms.core.service.Context context,
String path,
boolean delete,
IndexingStatus status) |
protected Map<String,List<String>> |
extractMetadata(org.dom4j.Document document) |
protected void |
extractMetadataFromChildren(org.dom4j.Element element,
String key,
org.springframework.util.MultiValueMap<String,String> metadata) |
protected String |
getBinaryFilePath(org.dom4j.Document document) |
protected boolean |
isBinaryFile(String path) |
protected boolean |
isMetadataFile(String path) |
void |
setBinaryPathPatterns(List<String> binaryPathPatterns) |
void |
setExcludeMetadataProperties(List<String> excludeMetadataProperties) |
void |
setItemProcessor(org.craftercms.core.processors.ItemProcessor itemProcessor) |
void |
setItemProcessors(List<org.craftercms.core.processors.ItemProcessor> itemProcessors) |
void |
setMetadataPathPatterns(List<String> metadataPathPatterns) |
void |
setReferenceXPaths(List<String> referenceXPaths) |
doDelete, doUpdate, doUpdateContent, doUpdateContent, getIndexNameStr, getSiteBasedPath, include, setExcludeFileNamePatterns, setIncludeFileNamePatterns, setSearchService, updateIndexpublic void setItemProcessor(org.craftercms.core.processors.ItemProcessor itemProcessor)
public void setItemProcessors(List<org.craftercms.core.processors.ItemProcessor> itemProcessors)
public void setExcludeMetadataProperties(List<String> excludeMetadataProperties)
protected void doSingleFileUpdate(String indexId, String siteName, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context, String path, boolean delete, IndexingStatus status) throws Exception
doSingleFileUpdate in class AbstractBatchIndexerExceptionprotected boolean isMetadataFile(String path)
protected boolean isBinaryFile(String path)
protected String getBinaryFilePath(org.dom4j.Document document)
Copyright © 2017 CrafterCMS. All Rights Reserved.