/** * @see org.opencms.importexport.I_CmsImport#importResources(org.opencms.file.CmsObject, java.lang.String, org.opencms.report.I_CmsReport, java.io.File, java.util.zip.ZipFile, org.dom4j.Document) * * @deprecated use {@link #importData(CmsObject, I_CmsReport, CmsImportParameters)} instead */ public void importResources( CmsObject cms, String importPath, I_CmsReport report, File importResource, ZipFile importZip, Document docXml) { CmsImportParameters params = new CmsImportParameters(importResource.getAbsolutePath(), importPath, true); importData(cms, report, params); }
/** * @see org.opencms.importexport.I_CmsImport#importResources(org.opencms.file.CmsObject, java.lang.String, org.opencms.report.I_CmsReport, java.io.File, java.util.zip.ZipFile, org.dom4j.Document) * * @deprecated use {@link #importData(CmsObject, I_CmsReport, CmsImportParameters)} instead */ @Deprecated public void importResources( CmsObject cms, String importPath, I_CmsReport report, File importResource, ZipFile importZip, Document docXml) { CmsImportParameters params = new CmsImportParameters(importResource.getAbsolutePath(), importPath, true); importData(cms, report, params); }
/** * @see org.opencms.importexport.I_CmsImport#importResources(org.opencms.file.CmsObject, java.lang.String, org.opencms.report.I_CmsReport, java.io.File, java.util.zip.ZipFile, org.dom4j.Document) * * @deprecated use {@link #importData(CmsObject, I_CmsReport, CmsImportParameters)} instead */ @Deprecated public void importResources( CmsObject cms, String importPath, I_CmsReport report, File importResource, ZipFile importZip, Document docXml) { CmsImportParameters params = new CmsImportParameters(importResource.getAbsolutePath(), importPath, true); importData(cms, report, params); }
/** * @see org.opencms.importexport.I_CmsImportExportHandler#importData(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.report.I_CmsReport) * * @deprecated use {@link #importData(CmsObject, I_CmsReport)} instead */ @Deprecated public void importData(CmsObject cms, String importFile, String importPath, I_CmsReport report) throws CmsXmlException, CmsImportExportException, CmsRoleViolationException, CmsException { CmsImportParameters parameters = new CmsImportParameters(importFile, importPath, true); setImportParameters(parameters); importData(cms, report); }
/** * Checks if the current user has permissions to import data into the Cms, * and if so, creates a new import handler instance that imports the data.<p> * * @param cms the current OpenCms context object * @param importFile the name (absolute path) of the resource (zipfile or folder) to be imported * @param importPath the name (absolute path) of the destination folder in the Cms if required, or null * @param report a Cms report to print log messages * * @throws CmsRoleViolationException if the current user is not allowed to import the OpenCms database * @throws CmsImportExportException if operation was not successful * @throws CmsXmlException if the manifest of the import could not be unmarshalled * @throws CmsException in case of errors accessing the VFS * * @see I_CmsImportExportHandler * @see #importData(CmsObject, I_CmsReport, CmsImportParameters) * * @deprecated use {@link #importData(CmsObject, I_CmsReport, CmsImportParameters)} instead */ @Deprecated public void importData(CmsObject cms, String importFile, String importPath, I_CmsReport report) throws CmsImportExportException, CmsXmlException, CmsRoleViolationException, CmsException { CmsImportParameters parameters = new CmsImportParameters(importFile, importPath, false); importData(cms, report, parameters); }
/** * @see org.opencms.importexport.I_CmsImportExportHandler#importData(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.report.I_CmsReport) * * @deprecated use {@link #importData(CmsObject, I_CmsReport)} instead */ @Deprecated public void importData(CmsObject cms, String importFile, String importPath, I_CmsReport report) throws CmsXmlException, CmsImportExportException, CmsRoleViolationException, CmsException { CmsImportParameters parameters = new CmsImportParameters(importFile, importPath, true); setImportParameters(parameters); importData(cms, report); }
/** * @see org.opencms.importexport.I_CmsImportExportHandler#importData(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.report.I_CmsReport) * * @deprecated use {@link #importData(CmsObject, I_CmsReport)} instead */ public void importData(CmsObject cms, String importFile, String importPath, I_CmsReport report) throws CmsXmlException, CmsImportExportException, CmsRoleViolationException, CmsException { CmsImportParameters parameters = new CmsImportParameters(importFile, importPath, true); setImportParameters(parameters); importData(cms, report); }
/** * @see org.opencms.importexport.I_CmsImportExportHandler#importData(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.report.I_CmsReport) * * @deprecated use {@link #importData(CmsObject, I_CmsReport)} instead */ public void importData(CmsObject cms, String importFile, String importPath, I_CmsReport report) throws CmsXmlException, CmsImportExportException, CmsRoleViolationException, CmsException { CmsImportParameters parameters = new CmsImportParameters(importFile, importPath, true); setImportParameters(parameters); importData(cms, report); }
/** * @see org.opencms.importexport.I_CmsImport#importResources(org.opencms.file.CmsObject, java.lang.String, org.opencms.report.I_CmsReport, java.io.File, java.util.zip.ZipFile, org.dom4j.Document) * * @deprecated use {@link #importData(CmsObject, I_CmsReport, CmsImportParameters)} instead */ @Deprecated public void importResources( CmsObject cms, String importPath, I_CmsReport report, File importResource, ZipFile importZip, Document docXml) throws CmsImportExportException { CmsImportParameters params = new CmsImportParameters( importResource != null ? importResource.getAbsolutePath() : importZip.getName(), importPath, true); try { importData(cms, report, params); } catch (CmsXmlException e) { throw new CmsImportExportException(e.getMessageContainer(), e); } }
/** * @see org.opencms.importexport.I_CmsImport#importResources(org.opencms.file.CmsObject, java.lang.String, org.opencms.report.I_CmsReport, java.io.File, java.util.zip.ZipFile, org.dom4j.Document) * * @deprecated use {@link #importData(CmsObject, I_CmsReport, CmsImportParameters)} instead */ @Deprecated public void importResources( CmsObject cms, String importPath, I_CmsReport report, File importResource, ZipFile importZip, Document docXml) throws CmsImportExportException { CmsImportParameters params = new CmsImportParameters( importResource != null ? importResource.getAbsolutePath() : importZip.getName(), importPath, false); try { importData(cms, report, params); } catch (CmsXmlException e) { throw new CmsImportExportException(e.getMessageContainer(), e); } }
/** * @see org.opencms.importexport.I_CmsImport#importResources(org.opencms.file.CmsObject, java.lang.String, org.opencms.report.I_CmsReport, java.io.File, java.util.zip.ZipFile, org.dom4j.Document) * * @deprecated use {@link #importData(CmsObject, I_CmsReport, CmsImportParameters)} instead */ public void importResources( CmsObject cms, String importPath, I_CmsReport report, File importResource, ZipFile importZip, Document docXml) throws CmsImportExportException { CmsImportParameters params = new CmsImportParameters(importResource != null ? importResource.getAbsolutePath() : importZip.getName(), importPath, true); try { importData(cms, report, params); } catch (CmsXmlException e) { throw new CmsImportExportException(e.getMessageContainer(), e); } }
/** * Imports a module.<p> * * @param importFile the absolute path of the import module file * * @throws Exception if something goes wrong * * @see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsReport, CmsImportParameters) */ public void importModule(String importFile) throws Exception { CmsImportParameters params = new CmsImportParameters(importFile, "/", true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); }
/** * @see java.lang.Runnable#run() */ @Override public void run() { CmsImportParameters parameters = new CmsImportParameters(m_importFile, "/", m_keepPermissions); try { OpenCms.getImportExportManager().importData(getCms(), getReport(), parameters); } catch (Throwable e) { getReport().println(e); if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle().key(Messages.ERR_DB_IMPORT_0), e); } } } }
/** * Imports a module.<p> * * @param importFile the absolute path of the import module file * * @throws Exception if something goes wrong * * @see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsReport, CmsImportParameters) */ public void importModule(String importFile) throws Exception { CmsImportParameters params = new CmsImportParameters(importFile, "/", true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); }
/** * Imports a module (zipfile) from the default module directory, * creating a temporary project for this.<p> * * @param importFile the name of the import module located in the default module directory * * @throws Exception if something goes wrong * * @see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, org.opencms.report.I_CmsReport, CmsImportParameters) */ protected void importModuleFromDefault(String importFile) throws Exception { String fileName = getModuleFolder() + importFile; OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), new CmsImportParameters(fileName, "/", true)); }
/** * Imports a resource into the Cms.<p> * * @param importFile the name (absolute Path) of the import resource (zip or folder) * @param importPath the name (absolute Path) of folder in which should be imported * * @throws Exception if something goes wrong */ public void importResources(String importFile, String importPath) throws Exception { CmsImportParameters params = new CmsImportParameters( OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(importFile), importPath, true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); }
/** * Imports a resource into the Cms.<p> * * @param importFile the name (absolute Path) of the import resource (zip or folder) * @param importPath the name (absolute Path) of folder in which should be imported * * @throws Exception if something goes wrong */ public void importResources(String importFile, String importPath) throws Exception { CmsImportParameters params = new CmsImportParameters( OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(importFile), importPath, true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); }
/** * Imports a resource into the Cms.<p> * * @param importFile the name (absolute Path) of the import resource (zip or folder) * @param importPath the name (absolute Path) of folder in which should be imported * @param keepPermissions if set, the permissions set on existing resources will not be modified * * @throws Exception if something goes wrong */ public void importResources(String importFile, String importPath, boolean keepPermissions) throws Exception { CmsImportParameters params = new CmsImportParameters( OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(importFile), importPath, keepPermissions); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); }
/** * Imports a module (zipfile) from the default module directory, * creating a temporary project for this.<p> * * @param importFile the name of the import module located in the default module directory * * @throws Exception if something goes wrong * * @see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsReport, CmsImportParameters) */ public void importModuleFromDefault(String importFile) throws Exception { String exportPath = OpenCms.getSystemInfo().getPackagesRfsPath(); String fileName = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf( exportPath + CmsSystemInfo.FOLDER_MODULES + importFile); CmsImportParameters params = new CmsImportParameters(fileName, "/", true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); }
/** * Imports a folder or a ZIP file to the root folder of the * current site, creating a temporary project for this.<p> * * @param importFile the absolute path of the import resource * @throws Exception if something goes wrong */ public void importResourcesWithTempProject(String importFile) throws Exception { CmsProject project = m_cms.createProject( "SystemUpdate", getMessages().key(Messages.GUI_SHELL_IMPORT_TEMP_PROJECT_NAME_0), OpenCms.getDefaultUsers().getGroupAdministrators(), OpenCms.getDefaultUsers().getGroupAdministrators(), CmsProject.PROJECT_TYPE_TEMPORARY); CmsUUID id = project.getUuid(); m_cms.getRequestContext().setCurrentProject(project); m_cms.copyResourceToProject("/"); CmsImportParameters params = new CmsImportParameters(importFile, "/", true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); m_cms.unlockProject(id); OpenCms.getPublishManager().publishProject(m_cms); OpenCms.getPublishManager().waitWhileRunning(); }