Interface Transferable

  • All Known Subinterfaces:
    DefaultValueSupport

    public interface Transferable
    Interface to be implemented by MetadataFieldType implementations to support copy, move, import and export of metadata fields and values of this type.
    Author:
    Communardo Products GmbH
    • 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 copy
        targetField - 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)
      • 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