Package org.ametys.cms.data.type.impl
Class BinaryRepositoryElementType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.model.type.AbstractModelItemType
org.ametys.core.model.type.AbstractElementType<Binary>
org.ametys.cms.data.type.AbstractBinaryElementType
org.ametys.cms.data.type.impl.BinaryRepositoryElementType
- All Implemented Interfaces:
ComplexRepositoryElementType<Binary>
,RepositoryElementType<Binary>
,RepositoryModelItemType
,ElementType<Binary>
,ModelItemType
,LogEnabled
,PluginAware
,Component
,Configurable
,Contextualizable
,Serviceable
public class BinaryRepositoryElementType
extends AbstractBinaryElementType
implements ComplexRepositoryElementType<Binary>
Class for binary type of elements stored in the repository
-
Field Summary
Fields inherited from class org.ametys.cms.data.type.AbstractBinaryElementType
_binaryType, _context, _uploadManager, _userProvider, UNTOUCHED
Fields inherited from class org.ametys.core.model.type.AbstractElementType
_jsonUtils
Fields inherited from interface org.ametys.plugins.repository.data.type.ComplexRepositoryElementType
TYPE_ID_DATA_NAME
Fields inherited from interface org.ametys.plugins.repository.data.type.RepositoryModelItemType
EMPTY_METADATA_SUFFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
emptySingleValue
(ModifiableRepositoryData parentData, String name) Empties the single value into the given repositoryData This method is called by theComplexRepositoryElementType.write(ModifiableRepositoryData, String, Object)
method, when the given value isnull
Retrieves the type of repository data used for this typeboolean
isSingleValueEmpty
(RepositoryData singleValueData) Checks if the single value is emptyreadSingleValue
(RepositoryData singleValueData) Read the single value in the given repository databoolean
Determines if the existing value has to be removed before writing the new onevoid
writeSingleValue
(ModifiableRepositoryData parentData, String name, Binary value) Write the single value into the given repository data This method is called by theComplexRepositoryElementType.write(ModifiableRepositoryData, String, Object)
method, once for each value if the value is an arrayMethods inherited from class org.ametys.cms.data.type.AbstractBinaryElementType
_compareMultipleValues, _compareSingleValues, _singleValueFromXML, _singleValueToJSON, _singleValueToSAX, _useJSONForEdition, configure, contextualize, fromJSONForClient, isCompatible, isSimple, service, toString
Methods inherited from class org.ametys.core.model.type.AbstractElementType
_getValueAttributes, _isValueFromXMLMultiple, _valueToSAX, _valueToSAX, _valueToSAXForEdition, castValue, compareValues, convertValue, getManagedClass, getManagedClassArray, parseConfiguration, valueFromXML, valueToJSONForClient, valueToSAX, valueToSAXForEdition
Methods inherited from class org.ametys.core.model.type.AbstractModelItemType
_getContextAttributes, getId, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.repository.data.type.ComplexRepositoryElementType
hasNonEmptyValue, isCompatible, read, write
Methods inherited from interface org.ametys.runtime.model.type.ElementType
castValue, compareValues, fromJSONForClient, getManagedClass, getManagedClassArray, isCompatible, isSimple, parseConfiguration, toString, valueFromXML, valueToJSONForClient
Methods inherited from interface org.ametys.runtime.model.type.ModelItemType
getId, valueToSAX, valueToSAX, valueToSAXForEdition
Methods inherited from interface org.ametys.runtime.plugin.component.PluginAware
setPluginInfo
Methods inherited from interface org.ametys.plugins.repository.data.type.RepositoryElementType
externalizableValueToSAX
Methods inherited from interface org.ametys.plugins.repository.data.type.RepositoryModelItemType
hasValue, isMultiple, remove
-
Constructor Details
-
BinaryRepositoryElementType
public BinaryRepositoryElementType()
-
-
Method Details
-
isSingleValueEmpty
Description copied from interface:ComplexRepositoryElementType
Checks if the single value is empty- Specified by:
isSingleValueEmpty
in interfaceComplexRepositoryElementType<Binary>
- Parameters:
singleValueData
- repository data containing the value to check- Returns:
true
if the value is empty,false
otherwise
-
readSingleValue
Description copied from interface:ComplexRepositoryElementType
Read the single value in the given repository data- Specified by:
readSingleValue
in interfaceComplexRepositoryElementType<Binary>
- Parameters:
singleValueData
- repository data containing the value- Returns:
- the value. Can return null if the given data does not contain the necessary elements
-
emptySingleValue
Description copied from interface:ComplexRepositoryElementType
Empties the single value into the given repositoryData This method is called by theComplexRepositoryElementType.write(ModifiableRepositoryData, String, Object)
method, when the given value isnull
- Specified by:
emptySingleValue
in interfaceComplexRepositoryElementType<Binary>
- Parameters:
parentData
- repository where to empty the single value.name
- the name of the element to empty
-
writeSingleValue
Description copied from interface:ComplexRepositoryElementType
Write the single value into the given repository data This method is called by theComplexRepositoryElementType.write(ModifiableRepositoryData, String, Object)
method, once for each value if the value is an array- Specified by:
writeSingleValue
in interfaceComplexRepositoryElementType<Binary>
- Parameters:
parentData
- repository where to store the single value.name
- the name of the element to writevalue
- the single value to write. Can be null. In this case, an empty data must be created
-
removeValueBeforeWritingIt
Description copied from interface:ComplexRepositoryElementType
Determines if the existing value has to be removed before writing the new one- Specified by:
removeValueBeforeWritingIt
in interfaceComplexRepositoryElementType<Binary>
- Returns:
true
if the previous value has to be removed,false
otherwise
-
getRepositoryDataType
Description copied from interface:RepositoryModelItemType
Retrieves the type of repository data used for this type- Specified by:
getRepositoryDataType
in interfaceRepositoryModelItemType
- Returns:
- the type of repository data used for this type
-