|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.opencms.file.CmsExport
Provides the functionality to export files from the OpenCms VFS to a ZIP file.
The ZIP file written will contain a copy of all exported files with their contents.
It will also contain a manifest.xml file in wich all meta-information
about this files are stored, like permissions etc.
| Field Summary | |
static String |
C_EXPORT_TAG_CHANNELS
|
static String |
C_EXPORT_TAG_FILES
|
static String |
C_EXPORT_TAG_MASTERS
|
protected CmsObject |
m_cms
The CmsObject to do the operations |
protected Document |
m_docXml
The xml manifest-file |
protected Set |
m_exportedChannelIds
The channelid and the resourceobject of the exported channels |
protected String |
m_exportFile
The export ZIP file to store resources in |
protected boolean |
m_exportingModuleData
Indicates if module data is exported |
protected ZipOutputStream |
m_exportZipStream
The export ZIP stream to write resources to |
protected Element |
m_filesElement
The xml element to store file information in |
protected Element |
m_mastersElement
The xml-element to store masters information in |
protected I_CmsReport |
m_report
The report for the log messages |
| Constructor Summary | |
CmsExport()
Constructs a new uninitialized export, required for the module data export. |
|
CmsExport(CmsObject cms,
String exportFile,
String[] resourcesToExport,
boolean excludeSystem,
boolean excludeUnchanged)
Constructs a new export. |
|
CmsExport(CmsObject cms,
String exportFile,
String[] resourcesToExport,
boolean excludeSystem,
boolean excludeUnchanged,
Node moduleNode,
boolean exportUserdata,
long contentAge,
I_CmsReport report)
Constructs a new export. |
|
| Method Summary | |
protected void |
addCdataElement(Document docXml,
Element element,
String name,
String value)
Adds a CDATA element to the XML document. |
protected void |
addElement(Document docXml,
Element element,
String name,
String value)
Adds a text element to the XML document. |
protected void |
closeExportFile()
Closes the export ZIP file and saves the internal XML document for the manifest. |
protected void |
exportAllResources(String[] resourcesToExport)
Exports all resources and possible sub-folders form the provided list of resources. |
protected void |
openExportFile(Node moduleNode)
Opens the export ZIP file and initializes the internal XML document for the manifest. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static String C_EXPORT_TAG_FILES
public static String C_EXPORT_TAG_CHANNELS
public static String C_EXPORT_TAG_MASTERS
protected boolean m_exportingModuleData
protected String m_exportFile
protected ZipOutputStream m_exportZipStream
protected CmsObject m_cms
protected Document m_docXml
protected Element m_filesElement
protected Element m_mastersElement
protected I_CmsReport m_report
protected Set m_exportedChannelIds
| Constructor Detail |
public CmsExport()
CmsExportModuledata
public CmsExport(CmsObject cms,
String exportFile,
String[] resourcesToExport,
boolean excludeSystem,
boolean excludeUnchanged)
throws CmsException
cms - the cmsObject to work withexportFile - the file or folder to export toresourcesToExport - the paths of folders and files to exportexcludeSystem - if true, the system folder is excluded, if false all the resources in
resourcesToExport are includedexcludeUnchanged - true, if unchanged files should be excluded
CmsException - if something goes wrong
public CmsExport(CmsObject cms,
String exportFile,
String[] resourcesToExport,
boolean excludeSystem,
boolean excludeUnchanged,
Node moduleNode,
boolean exportUserdata,
long contentAge,
I_CmsReport report)
throws CmsException
cms - the cmsObject to work withexportFile - the file or folder to export toresourcesToExport - the paths of folders and files to exportexcludeSystem - if true, the system folder is excluded, if false all the resources in
resourcesToExport are includedexcludeUnchanged - true, if unchanged files should be excludedexportUserdata - if true, the user and grou pdata will also be exportedreport - to handle the log messages
CmsException - if something goes wrong| Method Detail |
protected void openExportFile(Node moduleNode)
throws CmsException
moduleNode - optional modul node if a module is to be exported
CmsException - if something goes wrong
protected void closeExportFile()
throws CmsException
CmsException - if something goes wrong
protected void exportAllResources(String[] resourcesToExport)
throws CmsException
resourcesToExport - the list of resources to export
CmsException - if something goes wrong
protected void addCdataElement(Document docXml,
Element element,
String name,
String value)
docXml - Document to create the new element inelement - the element to add the subelement toname - the name of the new subelementvalue - the value of the element
protected void addElement(Document docXml,
Element element,
String name,
String value)
docXml - Document to create the new element inelement - the element to add the subelement toname - the name of the new subelementvalue - the value of the element
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||