Interface MetaDataType<T extends MetaData>

All Known Subinterfaces:
MetaDataType.BooleanMetaDataType, MetaDataType.DateTimeMetaDataType, MetaDataType.HiddenMetaDataType, MetaDataType.HtmlMetaDataType, MetaDataType.ImageMetaDataType, MetaDataType.MTSymbolMetaDataType, MetaDataType.NumberMetaDataType, MetaDataType.OptionsMetaDataType, MetaDataType.TextMetaDataType, MetaDataType.UrlMetaDataType

public interface MetaDataType<T extends MetaData>
A type of meta-data that can be read from documents from a specific source. Meta data types are used by Modeling Tool to construct a proper UI for meta data of that type. The types available are displayed below with typical editors. Some editors can be changed by the InputDescriptor of the MetaData.
  • Boolean values - A yes/no option, typically a checkbox.
  • Hidden values - A hidden value that is never displayed to the user.
  • Text values - A string, typically a text input field.
  • Html values - A string, typically a rich text input field.
  • Image values - An image, typically a file chooser.
  • Url values - A string that must be a proper URL, typically a text input field.
  • Option values - A list of pre-existing options, typically a drop down box.
  • Date time values - A date and/or time, typically a date picker.
  • Number values - A string, typically a text input field where only numbers are allowed.
  • Method Details

    • getDocumentSource

      DocumentSource getDocumentSource()
      Returns:
      The source of this meta-data.
    • getID

      String getID()
      Returns:
      An id that is unique for this provider and meta-data type.
    • getIcon

      default Icon getIcon()
      A 16x16 icon representing the meta-data type
      Returns:
      A 16x16 icon representing the meta-data type
    • getTitle

      String getTitle()
      Returns:
      The title of the meta-data, e.g. "Creator".
    • getDataType

      Class<T> getDataType()
      Returns:
      The data type for the meta-data.
    • getInputDescriptor

      default Optional<? extends InputDescriptor<T>> getInputDescriptor()
      Returns:
      An input descriptor for the data type. Some data types works well without an input descriptor but if using for example data type MultipleOptions an input descriptor is needed to supply the available options to choose from. The input descriptor must match the data type of the meta-data, e.g use "TextDescriptor" for "Text", otherwise an exception will be thrown when viewing or editing the data.
    • isEditable

      default boolean isEditable(Document doc)
      Parameters:
      doc - The document to test.
      Returns:
      true if values for this meta-data type can be set from the user interface in 2c8 Modeling Tool.
    • isListColumn

      default boolean isListColumn()
      Return true if the values can be selected as a column in lists.
      Returns:
      true if the values can be selected as a column in lists.
    • getDefaultValue

      default T getDefaultValue(Document doc)
      Parameters:
      doc - A document
      Returns:
      a default value for types that are editable but does not necessarily have a current value for the type.
    • populate

      default void populate(Document doc)
    • isNullable

      default boolean isNullable()
      Returns true if the values can be null.
      Returns:
      true if the values can be null.
    • getColumnType

      default MetaDataType.ColumnType getColumnType()
      Returns:
      Possible return values are: ColumnType.CUSTOM - unique data for this source that should be shown in a column in lists. Any other ColumnType - A predefined column type. These values will be shown in lists, and values from different sources with the same column type will be merged into the same column. There can only be one meta-data-type for each of these predefined column types per document source, and they must have the correct data type as specified by the column type. In addition there may be one other type defined per column type with the value type ImageValue. This will be used as an icon for values in that column. null - The values of this type will never be shown in list columns. All sources are required to implement at least two meta-data: 1. TextValue with ColumnType.TITLE 2. ImageValue with ColumnType.TITLE (icon for the document)
    • isValue

      default boolean isValue(MetaDataType.ColumnType columnType)
    • isIcon

      default boolean isIcon(MetaDataType.ColumnType columnType)