Package org.opencms.module
Class CmsModuleImportExportRepository
- java.lang.Object
-
- org.opencms.module.CmsModuleImportExportRepository
-
public class CmsModuleImportExportRepository extends java.lang.Object
Class which manages import/export of modules from repositories configured in opencms-importexport.xml.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsModuleImportExportRepository.ModuleExportData
Holds exported module data and a modification date.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
EXPORT_FOLDER_PATH
Export folder path.static java.lang.String
IMPORT_FOLDER_PATH
Import folder path.static java.lang.String
SUFFIX
Suffix for module zip files.
-
Constructor Summary
Constructors Constructor Description CmsModuleImportExportRepository()
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
deleteModule(java.lang.String fileName)
Deletes the module corresponding to the given virtual module file name.CmsModuleImportExportRepository.ModuleExportData
getExportedModuleData(java.lang.String virtualModuleFileName, CmsProject project)
Exports a module and returns the export zip file content in a byte array.java.util.List<java.lang.String>
getModuleFileNames()
Gets the list of modules as file names.CmsModuleLog
getModuleLog()
Gets the object used to access the module log.void
importModule(java.lang.String name, byte[] content)
Imports module data.void
initialize(CmsObject adminCms)
Initializes the CMS context.
-
-
-
Field Detail
-
EXPORT_FOLDER_PATH
public static final java.lang.String EXPORT_FOLDER_PATH
Export folder path.- See Also:
- Constant Field Values
-
IMPORT_FOLDER_PATH
public static final java.lang.String IMPORT_FOLDER_PATH
Import folder path.- See Also:
- Constant Field Values
-
SUFFIX
public static final java.lang.String SUFFIX
Suffix for module zip files.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsModuleImportExportRepository
public CmsModuleImportExportRepository()
Creates a new instance.
-
-
Method Detail
-
deleteModule
public boolean deleteModule(java.lang.String fileName) throws CmsException
Deletes the module corresponding to the given virtual module file name.- Parameters:
fileName
- the file name- Returns:
- true if the module could be deleted
- Throws:
CmsException
- if something goes wrong
-
getExportedModuleData
public CmsModuleImportExportRepository.ModuleExportData getExportedModuleData(java.lang.String virtualModuleFileName, CmsProject project) throws CmsException
Exports a module and returns the export zip file content in a byte array.- Parameters:
virtualModuleFileName
- the virtual file name for the moduleproject
- the project from which the module should be exported- Returns:
- the module export data
- Throws:
CmsException
- if something goes wrong
-
getModuleFileNames
public java.util.List<java.lang.String> getModuleFileNames()
Gets the list of modules as file names.- Returns:
- the list of modules as file names
-
getModuleLog
public CmsModuleLog getModuleLog()
Gets the object used to access the module log.- Returns:
- the module log
-
importModule
public void importModule(java.lang.String name, byte[] content) throws CmsException
Imports module data.- Parameters:
name
- the module file namecontent
- the module ZIP file data- Throws:
CmsException
- if something goes wrong
-
initialize
public void initialize(CmsObject adminCms)
Initializes the CMS context.- Parameters:
adminCms
- the admin CMS context
-
-