Package org.nuxeo.ecm.core.utils
Class BlobsExtractor
- java.lang.Object
-
- org.nuxeo.ecm.core.utils.BlobsExtractor
-
public class BlobsExtractor extends Object
Extractor for all the blobs of a document.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,List<String>>docBlobPathsLocal cache of blob paths per doc type.protected Map<String,List<String>>docBlobPathsPerSchemaLocal cache of blob paths per schema.static StringLIST_ONLY_DOC_TYPE_BLOB_PROPERTY_NAMEFramework boolean property name to fall back on legacy behavior.
-
Constructor Summary
Constructors Constructor Description BlobsExtractor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfindBlobPaths(ComplexType complexType, String path, Schema schema, List<String> paths)protected voidfindBlobsProperties(Property property, List<String> split, List<Property> properties)List<String>getBlobPaths(DocumentType documentType)Gets the blob paths of the document type.List<String>getBlobPaths(Schema schema)Gets the blob paths of the document's schemas.List<Blob>getBlobs(DocumentModel doc)Gets the blobs of the document.List<Property>getBlobsProperties(DocumentModel doc)Gets the blob properties of the document.protected booleanisInterestingPath(String path)protected Set<String>normalizePaths(Set<String> paths)Removes the "/data" suffix used by FulltextConfiguration.voidsetExtractorProperties(Set<String> includedPaths, Set<String> excludedPaths, boolean allBlobs)Sets extractor properties, controlling what properties or values are returned bygetBlobsProperties(org.nuxeo.ecm.core.api.DocumentModel)orgetBlobs(org.nuxeo.ecm.core.api.DocumentModel).
-
-
-
Field Detail
-
LIST_ONLY_DOC_TYPE_BLOB_PROPERTY_NAME
public static final String LIST_ONLY_DOC_TYPE_BLOB_PROPERTY_NAME
Framework boolean property name to fall back on legacy behavior. If true, only blobs referenced by static schemas (attached to the doc type of a document) will be listed i.e. blobs added through dynamic facets will be ignored.- Since:
- 2021.37
- See Also:
- Constant Field Values
-
docBlobPaths
protected final Map<String,List<String>> docBlobPaths
Local cache of blob paths per doc type.
-
-
Method Detail
-
setExtractorProperties
public void setExtractorProperties(Set<String> includedPaths, Set<String> excludedPaths, boolean allBlobs)
Sets extractor properties, controlling what properties or values are returned bygetBlobsProperties(org.nuxeo.ecm.core.api.DocumentModel)orgetBlobs(org.nuxeo.ecm.core.api.DocumentModel).The properties have to be defined without prefix if there is no prefix in the schema definition. For blob properties, the path must include the
/datapart.
-
isInterestingPath
protected boolean isInterestingPath(String path)
-
normalizePaths
protected Set<String> normalizePaths(Set<String> paths)
Removes the "/data" suffix used by FulltextConfiguration.Adds missing schema name as prefix if no prefix ("content" -> "file:content").
-
getBlobs
public List<Blob> getBlobs(DocumentModel doc)
Gets the blobs of the document.- Parameters:
doc- the document- Returns:
- the list of blobs
-
getBlobsProperties
public List<Property> getBlobsProperties(DocumentModel doc)
Gets the blob properties of the document.- Parameters:
doc- the document- Returns:
- the list of blob properties
-
getBlobPaths
public List<String> getBlobPaths(DocumentType documentType)
Gets the blob paths of the document type. Extractor properties are ignored.- Parameters:
documentType- the document type- Returns:
- the list of blob paths
- Since:
- 8.3
-
getBlobPaths
public List<String> getBlobPaths(Schema schema)
Gets the blob paths of the document's schemas. Extractor properties are ignored.- Parameters:
schema- the schema- Returns:
- the list of blob paths
- Since:
- 2021.32
-
findBlobsProperties
protected void findBlobsProperties(Property property, List<String> split, List<Property> properties)
-
findBlobPaths
protected void findBlobPaths(ComplexType complexType, String path, Schema schema, List<String> paths)
-
-