Class ImportBasedFactory
- java.lang.Object
-
- org.nuxeo.ecm.platform.content.template.factories.BaseContentFactory
-
- org.nuxeo.ecm.platform.content.template.factories.ImportBasedFactory
-
- All Implemented Interfaces:
ContentFactory
public class ImportBasedFactory extends BaseContentFactory
This factory will import a file using a path defined in the option of the factoryBinding extension point. This path can be defined using three different prefix. absolute:myAbsolute path will reference a file on the server's filesystem, nxData:myPath will reference a file inside nuxeo data folder and resource:myPath will reference a file in the bundle's resources. If the file exist, it's imported by theFileManager
service.- Author:
- ldoguin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImportBasedFactory.PathOptions
-
Field Summary
Fields Modifier and Type Field Description protected FileManager
fileManager
Deprecated.since 11.1.static String
IMPORT_FILE_PATH_OPTION
static String
IMPORT_OVERWRITE_OPTION
protected File
importedFile
protected Map<String,String>
options
protected Boolean
overwrite
-
Fields inherited from class org.nuxeo.ecm.platform.content.template.factories.BaseContentFactory
session
-
-
Constructor Summary
Constructors Constructor Description ImportBasedFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
createContentStructure(DocumentModel eventDoc)
protected FileManager
getFileManagerService()
Deprecated.since 11.1.protected void
importBlob(File file, String parentPath)
Use fileManager to import the given file.boolean
initFactory(Map<String,String> options, List<ACEDescriptor> rootAcl, List<TemplateItemDescriptor> template)
-
Methods inherited from class org.nuxeo.ecm.platform.content.template.factories.BaseContentFactory
initSession
-
-
-
-
Field Detail
-
IMPORT_FILE_PATH_OPTION
public static final String IMPORT_FILE_PATH_OPTION
- See Also:
- Constant Field Values
-
IMPORT_OVERWRITE_OPTION
public static final String IMPORT_OVERWRITE_OPTION
- See Also:
- Constant Field Values
-
fileManager
@Deprecated protected FileManager fileManager
Deprecated.since 11.1. UseFramework.getService(Class)
withFileManager
instead.
-
importedFile
protected File importedFile
-
-
Constructor Detail
-
ImportBasedFactory
public ImportBasedFactory()
-
-
Method Detail
-
initFactory
public boolean initFactory(Map<String,String> options, List<ACEDescriptor> rootAcl, List<TemplateItemDescriptor> template)
-
createContentStructure
public void createContentStructure(DocumentModel eventDoc)
-
importBlob
protected void importBlob(File file, String parentPath) throws IOException
Use fileManager to import the given file.- Parameters:
file
- to importparentPath
- of the targetDocument- Throws:
IOException
-
getFileManagerService
@Deprecated protected FileManager getFileManagerService()
Deprecated.since 11.1. UseFramework.getService(Class)
withFileManager
instead.
-
-