org.opencms.importexport
Class CmsVfsImportExportHandler

java.lang.Object
  extended byorg.opencms.importexport.CmsVfsImportExportHandler
All Implemented Interfaces:
I_CmsImportExportHandler

public class CmsVfsImportExportHandler
extends java.lang.Object
implements I_CmsImportExportHandler

Import/export handler implementation for VFS data.

Since:
6.0.0
Version:
$Revision: 1.24 $
Author:
Thomas Weckert

Constructor Summary
CmsVfsImportExportHandler()
          Creates a new VFS import/export handler.
 
Method Summary
 void exportData(CmsObject cms, I_CmsReport report)
          Exports the data from the Cms.
protected  void finalize()
           
 long getContentAge()
          Returns the timestamp to limit the resources to be exported by date.
 java.lang.String getDescription()
          Returns the description of this import/export handler.
 java.util.List getExportPaths()
          Returns the list with VFS paths to be exported.
 java.lang.String getFileName()
          Returns the name of the export file in the real file system.
 void importData(CmsObject cms, java.lang.String importFile, java.lang.String importPath, I_CmsReport report)
          Imports the data into the Cms.
 boolean isExportUserdata()
          Returns the boolean flag to decide whether user/group data should be exported or not.
 boolean isIncludeSystem()
          Returns the boolean flag to decide whether VFS resources under /system/ should be exported or not.
 boolean isIncludeUnchanged()
          Returns the boolean flag to decide whether unchanged resources should be exported or not.
 boolean isProjectOnly()
          Returns the projectOnly.
 boolean isRecursive()
          Returns the recursive flag.
 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 setContentAge(long contentAge)
          Sets the timestamp to limit the resources to be exported by date.
 void setDescription(java.lang.String description)
          Sets the description of this import/export handler.
 void setExportPaths(java.util.List exportPaths)
          Sets the list with VFS paths to be exported.
 void setExportUserdata(boolean exportUserdata)
          Sets the boolean flag to decide whether user/group data should be exported or not.
 void setFileName(java.lang.String fileName)
          Sets the name of the export file in the real file system.
 void setIncludeSystem(boolean excludeSystem)
          Sets the boolean flag to decide whether VFS resources under /system/ should be exported or not.
 void setIncludeUnchanged(boolean excludeUnchanged)
          Sets the boolean flag to decide whether unchanged resources should be exported or not.
 void setProjectOnly(boolean projectOnly)
          Sets the projectOnly.
 void setRecursive(boolean recursive)
          Sets the recursive flag.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsVfsImportExportHandler

public CmsVfsImportExportHandler()
Creates a new VFS import/export handler.

Method Detail

exportData

public void exportData(CmsObject cms,
                       I_CmsReport report)
                throws CmsImportExportException,
                       CmsRoleViolationException
Description copied from interface: I_CmsImportExportHandler
Exports the data from the Cms.

Specified by:
exportData in interface I_CmsImportExportHandler
Parameters:
cms - the current OpenCms context object
report - a Cms report to print log messages
Throws:
CmsRoleViolationException - if the current user has not the required role
CmsImportExportException - if operation was not successful
See Also:
I_CmsImportExportHandler.exportData(org.opencms.file.CmsObject, org.opencms.report.I_CmsReport)

getContentAge

public long getContentAge()
Returns the timestamp to limit the resources to be exported by date.

Only resources that have been modified after this date will be exported.

Returns:
the timestamp to limit the resources to be exported by date

getDescription

public java.lang.String getDescription()
Description copied from interface: I_CmsImportExportHandler
Returns the description of this import/export handler.

The description is useful to print some info about the purpose of this handler.

Specified by:
getDescription in interface I_CmsImportExportHandler
Returns:
the description of this import/export handler
See Also:
I_CmsImportExportHandler.getDescription()

getExportPaths

public java.util.List getExportPaths()
Returns the list with VFS paths to be exported.

Returns:
the list with VFS paths to be exported

getFileName

public java.lang.String getFileName()
Returns the name of the export file in the real file system.

Returns:
the name of the export file in the real file system

importData

public void importData(CmsObject cms,
                       java.lang.String importFile,
                       java.lang.String importPath,
                       I_CmsReport report)
                throws CmsImportExportException,
                       CmsXmlException,
                       CmsRoleViolationException
Description copied from interface: I_CmsImportExportHandler
Imports the data into the Cms.

Specified by:
importData in interface I_CmsImportExportHandler
Parameters:
cms - the current OpenCms context object
importFile - the name (absolute path) of the resource (zipfile or folder) to be imported
importPath - 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 successful
CmsRoleViolationException - if the current user has not the required role
CmsXmlException - if the manifest of the import could not be unmarshalled
See Also:
I_CmsImportExportHandler.importData(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.report.I_CmsReport)

isExportUserdata

public boolean isExportUserdata()
Returns the boolean flag to decide whether user/group data should be exported or not.

Returns:
true, if user/group data should be exported

isIncludeSystem

public boolean isIncludeSystem()
Returns the boolean flag to decide whether VFS resources under /system/ should be exported or not.

Returns:
true, if VFS resources under /system/ should not be exported

isIncludeUnchanged

public boolean isIncludeUnchanged()
Returns the boolean flag to decide whether unchanged resources should be exported or not.

Returns:
true, if unchanged resources should not be exported

isProjectOnly

public boolean isProjectOnly()
Returns the projectOnly.

Returns:
the projectOnly

isRecursive

public boolean isRecursive()
Returns the recursive flag.

Returns:
the recursive flag

matches

public boolean matches(org.dom4j.Document manifest)
Description copied from interface: I_CmsImportExportHandler
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.

Specified by:
matches in interface I_CmsImportExportHandler
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
See Also:
I_CmsImportExportHandler.matches(org.dom4j.Document)

setContentAge

public void setContentAge(long contentAge)
Sets the timestamp to limit the resources to be exported by date.

Only resources that have been modified after this date will be exported.

Parameters:
contentAge - the timestamp to limit the resources to be exported by date

setDescription

public void setDescription(java.lang.String description)
Description copied from interface: I_CmsImportExportHandler
Sets the description of this import/export handler.

The description is useful to print some info about the purpose of this handler.

Specified by:
setDescription in interface I_CmsImportExportHandler
Parameters:
description - the description of this import/export handler
See Also:
I_CmsImportExportHandler.setDescription(java.lang.String)

setExportPaths

public void setExportPaths(java.util.List exportPaths)
Sets the list with VFS paths to be exported.

Parameters:
exportPaths - the list with VFS paths to be exported

setExportUserdata

public void setExportUserdata(boolean exportUserdata)
Sets the boolean flag to decide whether user/group data should be exported or not.

Parameters:
exportUserdata - true, if user/group data should not be exported

setFileName

public void setFileName(java.lang.String fileName)
Sets the name of the export file in the real file system.

Parameters:
fileName - the name of the export file in the real file system

setIncludeSystem

public void setIncludeSystem(boolean excludeSystem)
Sets the boolean flag to decide whether VFS resources under /system/ should be exported or not.

Parameters:
excludeSystem - true, if VFS resources under /system/ should not be exported

setIncludeUnchanged

public void setIncludeUnchanged(boolean excludeUnchanged)
Sets the boolean flag to decide whether unchanged resources should be exported or not.

Parameters:
excludeUnchanged - true, if unchanged resources should not be exported

setProjectOnly

public void setProjectOnly(boolean projectOnly)
Sets the projectOnly.

Parameters:
projectOnly - the projectOnly to set

setRecursive

public void setRecursive(boolean recursive)
Sets the recursive flag.

Parameters:
recursive - the recursive flag to set

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable
See Also:
Object.finalize()