Class ExternalBlobProperty
java.lang.Object
org.nuxeo.ecm.core.api.model.impl.AbstractProperty
org.nuxeo.ecm.core.api.model.impl.ComplexProperty
org.nuxeo.ecm.core.api.model.impl.MapProperty
org.nuxeo.ecm.core.api.model.impl.primitives.ExternalBlobProperty
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Property>
,Map<String,
,Property> Property
Property handling an external blob: create/edit is done from a map, and the value returned is a blob.
Create/edit from a blob is not handled, and the blob uri cannot be retrieved from the blob (no api for now).
- Author:
- Anahide Tchertchian
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class org.nuxeo.ecm.core.api.model.impl.MapProperty
field
Fields inherited from class org.nuxeo.ecm.core.api.model.impl.ComplexProperty
children
Fields inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty
flags, forceDirty, IS_DEPRECATED, IS_READONLY, IS_SECURED, NON_CANON_INDEX, parent
Fields inherited from interface org.nuxeo.ecm.core.api.model.Property
DIRTY_MASK, IS_DIRTY, IS_MODIFIED, IS_MOVED, IS_NEW, IS_PHANTOM, IS_REMOVED, NONE
-
Constructor Summary
ConstructorDescriptionExternalBlobProperty
(Property parent, Field field) ExternalBlobProperty
(Property parent, Field field, int flags) -
Method Summary
Modifier and TypeMethodDescriptionstatic Blob
getBlobFromMap
(Map<String, Object> mapValue) static Map<String,
Serializable> getMapFromBlob
(Blob blob) getMapFromBlobWithUri
(Blob blob) <T> T
Gets the property value as the given type.Gets the property normalized value for write.void
init
(Serializable value) Initializes the property with the given normalized value.protected boolean
isSameValue
(Serializable value1, Serializable value2) void
Overridden to be able to set a blob from a given map.Methods inherited from class org.nuxeo.ecm.core.api.model.impl.MapProperty
accept, clone, getField, getName, getType, internalSetValue, isContainer
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.ComplexProperty
addEmpty, addValue, addValue, clear, clearDirtyFlags, containsKey, containsValue, entrySet, get, get, get, getChild, getChildren, getDefaultValue, getDirtyChildren, getNonPhantomChild, getNonPhantomChildren, internalGetChild, isEmpty, isNormalized, isSameAs, keySet, normalize, put, putAll, remove, set, values, visitChildren
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty
appendDirtyFlags, areFlagsSet, clearFlags, collectPath, computeRemovedProperty, convertTo, getDeprecatedFallback, getDeprecatedParent, getDirtyFlags, getObjectResolver, getParent, getRoot, getSchema, getValue, getValue, getValue, getValueDeprecation, getXPath, getXPath, hasDefaultValue, isComplex, isDeprecated, isDirty, isForceDirty, isList, isModified, isMoved, isNew, isPhantom, isReadOnly, isRemoved, isScalar, isSecured, isSecuredForContext, iterator, moveTo, newDeprecatedMessage, newInstance, remove, removePhantomFlag, resolvePath, resolvePath, setDirtyFlags, setFlags, setForceDirty, setIsModified, setIsMoved, setIsNew, setIsRemoved, setReadOnly, setValue, setValue, setValueDeprecation, size, toString, validateType
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll, size
-
Field Details
-
ENCODING
- See Also:
-
MIME_TYPE
- See Also:
-
FILE_NAME
- See Also:
-
DIGEST
- See Also:
-
LENGTH
- See Also:
-
URI
- See Also:
-
-
Constructor Details
-
ExternalBlobProperty
-
ExternalBlobProperty
-
-
Method Details
-
init
Description copied from interface:Property
Initializes the property with the given normalized value.The given value must be normalized - note that no check is done on that.
The phantom flag is unset by this operation.
This method should be used to initialize properties.
- Specified by:
init
in interfaceProperty
- Overrides:
init
in classComplexProperty
- Parameters:
value
- the normalized value to set- Throws:
PropertyException
-
internalGetValue
- Overrides:
internalGetValue
in classComplexProperty
- Throws:
PropertyException
-
getValue
Description copied from interface:Property
Gets the property value as the given type.The value is converted using the registered converter to the given type.
If conversion is not supported a runtime exception will be triggered.
- Specified by:
getValue
in interfaceProperty
- Overrides:
getValue
in classAbstractProperty
- Returns:
- the property value, which may be null
- Throws:
PropertyException
-
getValueForWrite
Description copied from interface:Property
Gets the property normalized value for write.Can be different fropm
Property.getValue()
in cases where the property adapts the value it is given to store.- Specified by:
getValueForWrite
in interfaceProperty
- Overrides:
getValueForWrite
in classComplexProperty
- Returns:
- the property value to use for write, which may be null
- Throws:
PropertyException
-
setValue
Overridden to be able to set a blob from a given map.Take care of not overriding the uri if set as this information is not on the blob.
- Specified by:
setValue
in interfaceProperty
- Overrides:
setValue
in classComplexProperty
- Parameters:
value
- the value to set- Throws:
PropertyException
- if one of the sub properties throws an exception or if trying to set values to a blob without any already existing uri set.
-
isSameValue
- Overrides:
isSameValue
in classAbstractProperty
-
getBlobFromMap
-
getMapFromBlobWithUri
- Throws:
PropertyException
-
getMapFromBlob
-