Class AbstractDocumentModelFactory
- java.lang.Object
-
- org.nuxeo.ecm.platform.importer.factories.AbstractDocumentModelFactory
-
- All Implemented Interfaces:
ImporterDocumentModelFactory
- Direct Known Subclasses:
DefaultDocumentModelFactory
,FileManagerDocumentModelFactory
public abstract class AbstractDocumentModelFactory extends Object implements ImporterDocumentModelFactory
Base class for classes implementingImporterDocumentModelFactory
. Contains common methods.- Author:
- Thomas Roger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractDocumentModelFactory.CompatFilenameNormalizer
protected static class
AbstractDocumentModelFactory.DefaultFilenameNormalizer
protected static interface
AbstractDocumentModelFactory.FilenameNormalizer
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDocumentModelFactory.FilenameNormalizer
filenameNormalizer
-
Constructor Summary
Constructors Constructor Description AbstractDocumentModelFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getValidNameFromFileName(String fileName)
Returns a valid Nuxeo name from the givenfileName
.boolean
isTargetDocumentModelFolderish(SourceNode node)
boolean
processFolderishNodeCreationError(CoreSession session, DocumentModel parent, SourceNode node)
By default there is no process bound to a folderish node creation error, and the global import task will continue.boolean
processLeafNodeCreationError(CoreSession session, DocumentModel parent, SourceNode node)
By default there is no process bound to a leaf node creation error, and the global import task will continue.protected DocumentModel
setDocumentProperties(CoreSession session, Map<String,Serializable> properties, DocumentModel doc)
Set all the properties to the givendoc
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.platform.importer.factories.ImporterDocumentModelFactory
createFolderishNode, createLeafNode
-
-
-
-
Field Detail
-
filenameNormalizer
protected final AbstractDocumentModelFactory.FilenameNormalizer filenameNormalizer
-
-
Method Detail
-
processFolderishNodeCreationError
public boolean processFolderishNodeCreationError(CoreSession session, DocumentModel parent, SourceNode node)
By default there is no process bound to a folderish node creation error, and the global import task will continue.You should override this method if you want a specific process to be executed after such an error and/or if you want the global import task to stop immediately after the error occurs, in which case the method should return false.
- Specified by:
processFolderishNodeCreationError
in interfaceImporterDocumentModelFactory
- Returns:
- true if the global import task should continue after processing the error, false if it should be stopped immediately after processing the error.
-
processLeafNodeCreationError
public boolean processLeafNodeCreationError(CoreSession session, DocumentModel parent, SourceNode node)
By default there is no process bound to a leaf node creation error, and the global import task will continue.You should override this method if you want a specific process to be executed after such an error and/or if you want the global import task to stop immediately after the error occurs, in which case the method should return false.
- Specified by:
processLeafNodeCreationError
in interfaceImporterDocumentModelFactory
- Returns:
- true if the global import task should continue after processing the error, false if it should be stopped immediately after processing the error.
-
isTargetDocumentModelFolderish
public boolean isTargetDocumentModelFolderish(SourceNode node)
- Specified by:
isTargetDocumentModelFolderish
in interfaceImporterDocumentModelFactory
-
getValidNameFromFileName
protected String getValidNameFromFileName(String fileName)
Returns a valid Nuxeo name from the givenfileName
.
-
setDocumentProperties
protected DocumentModel setDocumentProperties(CoreSession session, Map<String,Serializable> properties, DocumentModel doc)
Set all the properties to the givendoc
. The key is field xpath, the value is the value to set on the document.
-
-