Class CmsModuleImportExportRepository


  • public class CmsModuleImportExportRepository
    extends java.lang.Object
    Class which manages import/export of modules from repositories configured in opencms-importexport.xml.

    • 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.
    • 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.
      byte[] 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 byte[] 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 module
        project - 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 name
        content - 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