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 theFileManagerservice.- Author:
- ldoguin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImportBasedFactory.PathOptions
-
Field Summary
Fields Modifier and Type Field Description protected FileManagerfileManagerDeprecated.since 11.1.static StringIMPORT_FILE_PATH_OPTIONstatic StringIMPORT_OVERWRITE_OPTIONprotected FileimportedFileprotected Map<String,String>optionsprotected Booleanoverwrite-
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 voidcreateContentStructure(DocumentModel eventDoc)protected FileManagergetFileManagerService()Deprecated.since 11.1.protected voidimportBlob(File file, String parentPath)Use fileManager to import the given file.booleaninitFactory(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)withFileManagerinstead.
-
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)withFileManagerinstead.
-
-