Interface I_CmsImportExportHandler
-
- All Known Implementing Classes:
CmsModuleImportExportHandler
,CmsVfsImportExportHandler
public interface I_CmsImportExportHandler
An import/export handler is an abstract layer to hide the logic how to import/export a specific type of Cms data.To export data, you would create an instance of a class implementing this interface, and call the implementation's setter methods to arrange which data should be exported. To write the export, call
CmsImportExportManager.exportData(CmsObject, I_CmsImportExportHandler, I_CmsReport)
.To import data, call
CmsImportExportManager.importData(CmsObject, I_CmsReport, CmsImportParameters)
. You don't have to worry about the contents of an imported a ZIP archive - the import/export manager finds the right import/export handler implementation to import the data. You can assign null to the importPath argument in case of a Cms module import.Use
OpenCms.getImportExportManager()
to get the Cms import/export manager.- Since:
- 6.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
exportData(CmsObject cms, I_CmsReport report)
Exports the data from the Cms.java.lang.String
getDescription()
Returns the description of this import/export handler.CmsImportParameters
getImportParameters()
Returns the import parameters.void
importData(CmsObject cms, java.lang.String importFile, java.lang.String importPath, I_CmsReport report)
Deprecated.useimportData(CmsObject, I_CmsReport)
insteadvoid
importData(CmsObject cms, I_CmsReport report)
Imports the data into the Cms.boolean
matches(org.dom4j.Document manifest)
Checks, if this import/export handler matches with a specified manifest document of an import, so that it is able to import the data listed in the manifest document.void
setDescription(java.lang.String description)
Sets the description of this import/export handler.void
setImportParameters(CmsImportParameters parameters)
Sets the import parameters.
-
-
-
Method Detail
-
exportData
void exportData(CmsObject cms, I_CmsReport report) throws CmsConfigurationException, CmsImportExportException, CmsRoleViolationException
Exports the data from the Cms.- Parameters:
cms
- the current OpenCms context objectreport
- a Cms report to print log messages- Throws:
CmsImportExportException
- if operation was not successfulCmsRoleViolationException
- if the current user has not the required roleCmsConfigurationException
- if a specified module to be exported does not exist
-
getDescription
java.lang.String getDescription()
Returns the description of this import/export handler.The description is useful to print some info about the purpose of this handler.
- Returns:
- the description of this import/export handler
-
getImportParameters
CmsImportParameters getImportParameters()
Returns the import parameters.- Returns:
- the import parameters
-
importData
void importData(CmsObject cms, I_CmsReport report) throws CmsXmlException, CmsImportExportException, CmsRoleViolationException, CmsException
Imports the data into the Cms.- Parameters:
cms
- the current OpenCms context objectreport
- a Cms report to print log messages- Throws:
CmsImportExportException
- if operation was not successfulCmsRoleViolationException
- if the current user has not the required roleCmsXmlException
- if the manifest of the import could not be unmarshalledCmsException
- in case of errors accessing the VFS
-
importData
@Deprecated void importData(CmsObject cms, java.lang.String importFile, java.lang.String importPath, I_CmsReport report) throws CmsXmlException, CmsImportExportException, CmsRoleViolationException, CmsException
Deprecated.useimportData(CmsObject, I_CmsReport)
insteadImports the data into the Cms.- Parameters:
cms
- the current OpenCms context objectimportFile
- the name (absolute path) of the resource (zip file or folder) to be importedimportPath
- the name (absolute path) of the destination folder in the Cms (if required)report
- a Cms report to print log messages- Throws:
CmsImportExportException
- if operation was not successfulCmsRoleViolationException
- if the current user has not the required roleCmsXmlException
- if the manifest of the import could not be unmarshalledCmsException
- in case of errors accessing the VFS
-
matches
boolean matches(org.dom4j.Document manifest)
Checks, if this import/export handler matches with a specified manifest document of an import, so that it is able to import the data listed in the manifest document.- Parameters:
manifest
- the manifest.xml of the import as a dom4j XML document- Returns:
- true, this handler is able to import the data listed in the manifest document
-
setDescription
void setDescription(java.lang.String description)
Sets the description of this import/export handler.The description is useful to print some info about the purpose of this handler.
- Parameters:
description
- the description of this import/export handler
-
setImportParameters
void setImportParameters(CmsImportParameters parameters)
Sets the import parameters.- Parameters:
parameters
- the import parameters to set
-
-