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
MetadataCollector
knows.- Author:
- Thomas Roger
-
-
Field Summary
Fields Modifier and Type Field Description protected DocumentModel
doc
protected Properties
metadataProperties
-
Constructor Summary
Constructors Modifier Constructor Description protected
MetadataFile(DocumentModel doc)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAllProperties(String schema)
void
addProperty(String propertyKey, Object value)
protected String
computePropertyKey(String propertyKey, String schema)
static MetadataFile
createFromDocument(DocumentModel doc)
Create aMetadataFile
from aDocumentModel
's schemas.static MetadataFile
createFromProperties(DocumentModel doc, List<String> properties)
Create aMetadataFile
from the listed properties of aDocumentModel
static MetadataFile
createFromSchemas(DocumentModel doc, List<String> allPropertiesSchemas)
Create aMetadataFile
from the listed schemas (with all properties) of aDocumentModel
static MetadataFile
createFromSchemasAndProperties(DocumentModel doc, List<String> allPropertiesSchemas, List<String> properties)
Create aMetadataFile
from the listed schemas (with all properties) and the listed properties of aDocumentModel
protected void
load()
protected void
load(List<String> allPropertiesSchemas, List<String> properties)
void
writeTo(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 aMetadataFile
from aDocumentModel
's schemas.- Returns:
- a new MetadataFile object
-
createFromSchemasAndProperties
public static MetadataFile createFromSchemasAndProperties(DocumentModel doc, List<String> allPropertiesSchemas, List<String> properties)
Create aMetadataFile
from 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 aMetadataFile
from the listed schemas (with all properties) of aDocumentModel
- Returns:
- a new MetadataFile object
-
createFromProperties
public static MetadataFile createFromProperties(DocumentModel doc, List<String> properties)
Create aMetadataFile
from the listed properties of aDocumentModel
- Returns:
- a new MetadataFile object
-
addAllProperties
protected void addAllProperties(String schema)
-
load
protected void load()
-
writeTo
public void writeTo(File file)
Write the properties file to the givenfile
-
-