Class MetadataFile
- java.lang.Object
-
- org.nuxeo.ecm.platform.importer.properties.MetadataFile
-
public class MetadataFile extends Object
Handle properties file creation from aDocumentModel.Only support the types that
MetadataCollectorknows.- Author:
- Thomas Roger
-
-
Field Summary
Fields Modifier and Type Field Description protected DocumentModeldocprotected PropertiesmetadataProperties
-
Constructor Summary
Constructors Modifier Constructor Description protectedMetadataFile(DocumentModel doc)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAllProperties(String schema)voidaddProperty(String propertyKey, Object value)protected StringcomputePropertyKey(String propertyKey, String schema)static MetadataFilecreateFromDocument(DocumentModel doc)Create aMetadataFilefrom aDocumentModel's schemas.static MetadataFilecreateFromProperties(DocumentModel doc, List<String> properties)Create aMetadataFilefrom the listed properties of aDocumentModelstatic MetadataFilecreateFromSchemas(DocumentModel doc, List<String> allPropertiesSchemas)Create aMetadataFilefrom the listed schemas (with all properties) of aDocumentModelstatic MetadataFilecreateFromSchemasAndProperties(DocumentModel doc, List<String> allPropertiesSchemas, List<String> properties)Create aMetadataFilefrom the listed schemas (with all properties) and the listed properties of aDocumentModelprotected voidload()protected voidload(List<String> allPropertiesSchemas, List<String> properties)voidwriteTo(File file)Write the properties file to the givenfile
-
-
-
Field Detail
-
doc
protected DocumentModel doc
-
metadataProperties
protected Properties metadataProperties
-
-
Constructor Detail
-
MetadataFile
protected MetadataFile(DocumentModel doc)
-
-
Method Detail
-
createFromDocument
public static MetadataFile createFromDocument(DocumentModel doc)
Create aMetadataFilefrom aDocumentModel's schemas.- Returns:
- a new MetadataFile object
-
createFromSchemasAndProperties
public static MetadataFile createFromSchemasAndProperties(DocumentModel doc, List<String> allPropertiesSchemas, List<String> properties)
Create aMetadataFilefrom the listed schemas (with all properties) and the listed properties of aDocumentModel- Returns:
- a new MetadataFile object
-
createFromSchemas
public static MetadataFile createFromSchemas(DocumentModel doc, List<String> allPropertiesSchemas)
Create aMetadataFilefrom the listed schemas (with all properties) of aDocumentModel- Returns:
- a new MetadataFile object
-
createFromProperties
public static MetadataFile createFromProperties(DocumentModel doc, List<String> properties)
Create aMetadataFilefrom the listed properties of aDocumentModel- Returns:
- a new MetadataFile object
-
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()
-
-