Interface Transferable
-
- All Known Subinterfaces:
DefaultValueSupport
public interface TransferableInterface to be implemented byMetadataFieldTypeimplementations to support copy, move, import and export of metadata fields and values of this type.- Author:
- Communardo Products GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DataObjectcopyDataObject(DataObject source, MetadataField targetField)Create a copy of a data object handled by this metadata field type so that it can be used as value of the metadata field targetField.DataObjectcreateDataObject(String exportFormat)Create a data object from the serialized metadata value created byexportDataObject(ContentEntityObject).StringexportDataObject(com.atlassian.confluence.core.ContentEntityObject contentEntityObject)Get the data object (metadata value) of the given content entity assigned to the field of this metadata field type and serialize it into a string, so it can be exported and later be re-converted into a data object.StringexportTypeConfiguration()Export the configuration of this metadata field type into a string.voidimportTypeConfiguration(String exportedConfiguration)Import and store the serialized configuration for this metadata field type.
-
-
-
Method Detail
-
copyDataObject
DataObject copyDataObject(DataObject source, MetadataField targetField)
Create a copy of a data object handled by this metadata field type so that it can be used as value of the metadata field targetField. This method should only be called if the type of targetField is compatible with this type.- Parameters:
source- the data object to copytargetField- the field for which the copy should be used as value- Returns:
- the copy of the data object which can be stored with a content entity object that has the targetField metadata field
- See Also:
MetadataFieldType.isCompatible(MetadataFieldType)
-
createDataObject
DataObject createDataObject(String exportFormat) throws MetadataImportException
Create a data object from the serialized metadata value created byexportDataObject(ContentEntityObject).- Parameters:
exportFormat- the serialized metadata value. Can be null.- Returns:
- the data object
- Throws:
MetadataImportException- in case the conversion of the export format into the DataObject failed
-
exportDataObject
String exportDataObject(com.atlassian.confluence.core.ContentEntityObject contentEntityObject) throws MetadataExportException
Get the data object (metadata value) of the given content entity assigned to the field of this metadata field type and serialize it into a string, so it can be exported and later be re-converted into a data object. The format of the serialization is up to the developer.- Parameters:
contentEntityObject- the content entity whose value metadata value should be exported- Returns:
- the serialized metadata value. If the content entity object has no metadata value, null should be returned.
- Throws:
MetadataExportException- in case the serialization failed- See Also:
MetadataFieldType.loadDataObject(ContentEntityObject)
-
exportTypeConfiguration
String exportTypeConfiguration() throws MetadataExportException
Export the configuration of this metadata field type into a string. The export should contain all data which is required to completely restore an exported metadata field of this type when doing an import. The format of the export is up to the developer.- Returns:
- the serialized configuration. Can be null if the field type has no configuration.
- Throws:
MetadataExportException- in case the serialization failed
-
importTypeConfiguration
void importTypeConfiguration(String exportedConfiguration) throws MetadataImportException
Import and store the serialized configuration for this metadata field type.- Parameters:
exportedConfiguration- the serialized configuration which was created byexportTypeConfiguration(). Never null.- Throws:
MetadataImportException- in case the import failed
-
-