Class MetadataFile

java.lang.Object
org.nuxeo.ecm.platform.importer.properties.MetadataFile

public class MetadataFile extends Object
Handle properties file creation from a DocumentModel.

Only support the types that MetadataCollector knows.

Author:
Thomas Roger
  • Field Details

  • Constructor Details

  • Method Details

    • createFromDocument

      public static MetadataFile createFromDocument(DocumentModel doc)
      Create a MetadataFile from a DocumentModel's schemas.
      Returns:
      a new MetadataFile object
    • createFromSchemasAndProperties

      public static MetadataFile createFromSchemasAndProperties(DocumentModel doc, List<String> allPropertiesSchemas, List<String> properties)
      Create a MetadataFile from the listed schemas (with all properties) and the listed properties of a DocumentModel
      Returns:
      a new MetadataFile object
    • createFromSchemas

      public static MetadataFile createFromSchemas(DocumentModel doc, List<String> allPropertiesSchemas)
      Create a MetadataFile from the listed schemas (with all properties) of a DocumentModel
      Returns:
      a new MetadataFile object
    • createFromProperties

      public static MetadataFile createFromProperties(DocumentModel doc, List<String> properties)
      Create a MetadataFile from the listed properties of a DocumentModel
      Returns:
      a new MetadataFile object
    • load

      protected void load(List<String> allPropertiesSchemas, List<String> properties)
    • addAllProperties

      protected void addAllProperties(String schema)
    • addProperty

      public void addProperty(String propertyKey, Object value)
    • computePropertyKey

      protected String computePropertyKey(String propertyKey, String schema)
    • load

      protected void load()
    • writeTo

      public void writeTo(File file)
      Write the properties file to the given file