public class BinaryMetadataServiceImpl extends Object implements BinaryMetadataService
| Modifier and Type | Field and Description | 
|---|---|
protected BinaryMetadataComponent | 
binaryMetadataComponent  | 
| Modifier | Constructor and Description | 
|---|---|
protected  | 
BinaryMetadataServiceImpl(BinaryMetadataComponent binaryMetadataComponent)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected Set<MetadataRuleDescriptor> | 
checkFilter(ActionContext actionContext)
Check for each Binary Rule if the document is accepted or not. 
 | 
protected ActionContext | 
createActionContext(DocumentModel doc)  | 
protected List<MetadataMappingDescriptor> | 
getMapping(Set<String> mappingDescriptorIds)  | 
protected BinaryMetadataProcessor | 
getProcessor(String processorId)  | 
List<MetadataMappingDescriptor> | 
getSyncMapping(DocumentModel doc)  | 
void | 
handleSyncUpdate(DocumentModel doc)
Handle document and blob updates according to following rules in an event context: - Define if rule should be
 executed in async or sync mode. 
 | 
void | 
handleUpdate(List<MetadataMappingDescriptor> mappingDescriptors,
            DocumentModel doc)
Handle document and blob updates according to following rules in an event context: - Define if rule should be
 executed in async or sync mode. 
 | 
protected boolean | 
isDirtyMapping(MetadataMappingDescriptor mappingDescriptor,
              DocumentModel doc)
Maps inspector only. 
 | 
Map<String,Object> | 
readMetadata(Blob blob,
            boolean ignorePrefix)
Read and return metadata from a given binary with Nuxeo default processor. 
 | 
Map<String,Object> | 
readMetadata(Blob blob,
            List<String> metadataNames,
            boolean ignorePrefix)
Read and return metadata from a given binary and a given metadata list with Nuxeo default processor. 
 | 
Map<String,Object> | 
readMetadata(String processorName,
            Blob blob,
            boolean ignorePrefix)
Read and return metadata from a given binary with a given processor. 
 | 
Map<String,Object> | 
readMetadata(String processorName,
            Blob blob,
            List<String> metadataNames,
            boolean ignorePrefix)
Read and return metadata from a given binary and a given metadata list with a given processor. 
 | 
Blob | 
writeMetadata(Blob blob,
             Map<String,Object> metadata,
             boolean ignorePrefix)
Write given metadata into a given binary with a Nuxeo default processor. 
 | 
Blob | 
writeMetadata(Blob blob,
             String mappingDescriptorId,
             DocumentModel doc)
Write given metadata mapping id into a given binary with a Nuxeo default processor. 
 | 
void | 
writeMetadata(DocumentModel doc)
Write metadata (from a binary) into a given Nuxeo Document according to the metadata mapping and rules
 contributions. 
 | 
void | 
writeMetadata(DocumentModel doc,
             String mappingDescriptorId)
Apply metadata mapping and override document properties according to the contribution. 
 | 
Blob | 
writeMetadata(String processorName,
             Blob blob,
             Map<String,Object> metadata,
             boolean ignorePrefix)
Write given metadata into a given binary with a given processor. 
 | 
Blob | 
writeMetadata(String processorName,
             Blob blob,
             String mappingDescriptorId,
             DocumentModel doc)
Write given metadata mapping id into a given binary with a Nuxeo default processor. 
 | 
protected BinaryMetadataComponent binaryMetadataComponent
protected BinaryMetadataServiceImpl(BinaryMetadataComponent binaryMetadataComponent)
public Map<String,Object> readMetadata(String processorName, Blob blob, List<String> metadataNames, boolean ignorePrefix)
BinaryMetadataServicereadMetadata in interface BinaryMetadataServiceprocessorName - Name of the contributed processor to run.blob - Binary which metadata are read.metadataNames - Metadata list to extract from the binary.ignorePrefix - Since 7.3public Map<String,Object> readMetadata(Blob blob, List<String> metadataNames, boolean ignorePrefix)
BinaryMetadataServicereadMetadata in interface BinaryMetadataServiceblob - Binary which metadata are read.metadataNames - Metadata list to extract from the binary.ignorePrefix - Since 7.3public Map<String,Object> readMetadata(Blob blob, boolean ignorePrefix)
BinaryMetadataServicereadMetadata in interface BinaryMetadataServiceblob - Binary which metadata are read.ignorePrefix - Since 7.3public Map<String,Object> readMetadata(String processorName, Blob blob, boolean ignorePrefix)
BinaryMetadataServicereadMetadata in interface BinaryMetadataServiceprocessorName - Name of the contributed processor to run.blob - Binary which metadata are read.ignorePrefix - Since 7.3public Blob writeMetadata(String processorName, Blob blob, Map<String,Object> metadata, boolean ignorePrefix)
BinaryMetadataServicewriteMetadata in interface BinaryMetadataServiceprocessorName - Name of the contributed processor to run.blob - Binary which metadata are written.metadata - Injected metadata.ignorePrefix - Since 7.3null if there was an error (since 7.4)public Blob writeMetadata(Blob blob, Map<String,Object> metadata, boolean ignorePrefix)
BinaryMetadataServicewriteMetadata in interface BinaryMetadataServiceblob - Binary which metadata are written.metadata - Injected metadata.ignorePrefix - Since 7.3null if there was an error (since 7.4)public Blob writeMetadata(String processorName, Blob blob, String mappingDescriptorId, DocumentModel doc)
BinaryMetadataServicewriteMetadata in interface BinaryMetadataServiceprocessorName - Name of the contributed processor to run.blob - Binary which metadata are written.mappingDescriptorId - The metadata mapping to apply on the document.doc - Document from properties will be read.null if there was an error (since 7.4)public Blob writeMetadata(Blob blob, String mappingDescriptorId, DocumentModel doc)
BinaryMetadataServicewriteMetadata in interface BinaryMetadataServiceblob - Binary which metadata are written.mappingDescriptorId - The metadata mapping to apply on the document.doc - Document from properties will be read.null if there was an error (since 7.4)public void writeMetadata(DocumentModel doc)
BinaryMetadataServiceThe document is not saved in the session, it's up to the caller to deal with this.
writeMetadata in interface BinaryMetadataServicedoc - Nuxeo Document which metadata are written.public void writeMetadata(DocumentModel doc, String mappingDescriptorId)
BinaryMetadataServiceThe document is not saved in the session, it's up to the caller to deal with this.
writeMetadata in interface BinaryMetadataServicedoc - The input document.mappingDescriptorId - The metadata mapping to apply on the document.public void handleSyncUpdate(DocumentModel doc)
BinaryMetadataServiceThe document is not saved in the session, it's up to the caller to deal with this.
handleSyncUpdate in interface BinaryMetadataServicepublic void handleUpdate(List<MetadataMappingDescriptor> mappingDescriptors, DocumentModel doc)
BinaryMetadataServiceThe document is not saved in the session, it's up to the caller to deal with this.
handleUpdate in interface BinaryMetadataServiceprotected Set<MetadataRuleDescriptor> checkFilter(ActionContext actionContext)
protected ActionContext createActionContext(DocumentModel doc)
protected BinaryMetadataProcessor getProcessor(String processorId) throws NoSuchMethodException
NoSuchMethodExceptionpublic List<MetadataMappingDescriptor> getSyncMapping(DocumentModel doc)
protected List<MetadataMappingDescriptor> getMapping(Set<String> mappingDescriptorIds)
protected boolean isDirtyMapping(MetadataMappingDescriptor mappingDescriptor, DocumentModel doc)
Copyright © 2019 Nuxeo. All rights reserved.