Class DefaultDocumentModelFactory
- java.lang.Object
-
- org.nuxeo.ecm.platform.importer.factories.AbstractDocumentModelFactory
-
- org.nuxeo.ecm.platform.importer.factories.DefaultDocumentModelFactory
-
- All Implemented Interfaces:
ImporterDocumentModelFactory
- Direct Known Subclasses:
ScanedFileFactory
public class DefaultDocumentModelFactory extends AbstractDocumentModelFactory
Default implementation for DocumentModel factory The default empty constructor create Folder for folderish file and File for other. But you can specify them using the other constructor. Also, if you are using .properties files to setup metada, you can use the ecm:primaryType xpath to specify the type of document to create. This will override the default ones, and works for files and folders. If no .properties file is provided of it the current node has a .properties file but no ecm:primaryType, the default types are created. This works for leafType but also for folderish type.- Author:
- Thierry Delprat, Daniel Tellez, Thibaud Arguillere
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuxeo.ecm.platform.importer.factories.AbstractDocumentModelFactory
AbstractDocumentModelFactory.CompatFilenameNormalizer, AbstractDocumentModelFactory.DefaultFilenameNormalizer, AbstractDocumentModelFactory.FilenameNormalizer
-
-
Field Summary
Fields Modifier and Type Field Description static String
DOCTYPE_KEY_NAME
static String
FACETS_KEY_NAME
protected String
folderishType
protected String
leafType
-
Fields inherited from class org.nuxeo.ecm.platform.importer.factories.AbstractDocumentModelFactory
filenameNormalizer
-
-
Constructor Summary
Constructors Constructor Description DefaultDocumentModelFactory()
Instantiate a DefaultDocumentModelFactory that creates Folder and FileDefaultDocumentModelFactory(String folderishType, String leafType)
Instantiate a DefaultDocumentModelFactory that creates specified types doc
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DocumentModel
createFolderishNode(CoreSession session, DocumentModel parent, SourceNode node)
DocumentModel
createLeafNode(CoreSession session, DocumentModel parent, SourceNode node)
protected DocumentModel
defaultCreateLeafNode(CoreSession session, DocumentModel parent, SourceNode node)
protected String
getDocTypeToUse(BlobHolder inBH)
protected List<String>
getFacetsToUse(BlobHolder inBH)
protected String
getMimeType(String name)
Deprecated.since 10.1 seems unusedvoid
setFolderishType(String folderishType)
void
setLeafType(String leafType)
-
Methods inherited from class org.nuxeo.ecm.platform.importer.factories.AbstractDocumentModelFactory
getValidNameFromFileName, isTargetDocumentModelFolderish, processFolderishNodeCreationError, processLeafNodeCreationError, setDocumentProperties
-
-
-
-
Field Detail
-
DOCTYPE_KEY_NAME
public static final String DOCTYPE_KEY_NAME
- See Also:
- Constant Field Values
-
FACETS_KEY_NAME
public static final String FACETS_KEY_NAME
- See Also:
- Constant Field Values
-
folderishType
protected String folderishType
-
leafType
protected String leafType
-
-
Method Detail
-
createFolderishNode
public DocumentModel createFolderishNode(CoreSession session, DocumentModel parent, SourceNode node) throws IOException
- Throws:
IOException
-
createLeafNode
public DocumentModel createLeafNode(CoreSession session, DocumentModel parent, SourceNode node) throws IOException
- Throws:
IOException
-
defaultCreateLeafNode
protected DocumentModel defaultCreateLeafNode(CoreSession session, DocumentModel parent, SourceNode node) throws IOException
- Throws:
IOException
-
getDocTypeToUse
protected String getDocTypeToUse(BlobHolder inBH)
-
getFacetsToUse
protected List<String> getFacetsToUse(BlobHolder inBH)
-
getMimeType
@Deprecated protected String getMimeType(String name)
Deprecated.since 10.1 seems unusedModify this to get right mime types depending on the file input
-
setFolderishType
public void setFolderishType(String folderishType)
-
setLeafType
public void setLeafType(String leafType)
-
-