/** * Returns the extendedHtmlImportDefault.<p> * * @return the extendedHtmlImportDefault */ public CmsExtendedHtmlImportDefault getExtendedHtmlImportDefault() { return getExtendedHtmlImportDefault(false); }
/** * 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); }
/** * Sets the extendedHtmlImportManager.<p> * * @param extendedHtmlImportManager the extendedHtmlImportManager to set */ public void setExtendedHtmlImportManager(CmsExtendedHtmlImportDefault extendedHtmlImportManager) { m_importExportManager.setExtendedHtmlImportDefault(extendedHtmlImportManager); }
List handlers = m_importExportManager.getImportExportHandlers(); Iterator i = handlers.iterator(); while (i.hasNext()) { String.valueOf(m_importExportManager.overwriteCollidingResources())); importElement.addElement(N_CONVERT).setText(String.valueOf(m_importExportManager.convertToXmlPage())); if (m_importExportManager.getOldWebAppUrl() != null) { importElement.addElement(N_OLDWEBAPPURL).setText(m_importExportManager.getOldWebAppUrl()); i = m_importExportManager.getImportVersionClasses().iterator(); while (i.hasNext()) { resourcetypesElement.addElement(N_IMPORTVERSION).addAttribute(A_CLASS, i.next().getClass().getName()); i = m_importExportManager.getImmutableResources().iterator(); while (i.hasNext()) { String uri = (String)i.next(); i = m_importExportManager.getImportUserTranslations().keySet().iterator(); while (i.hasNext()) { String from = (String)i.next(); String to = (String)m_importExportManager.getImportUserTranslations().get(from); principalsElement.addElement(N_PRINCIPALTRANSLATION).addAttribute(A_TYPE, I_CmsPrincipal.PRINCIPAL_USER).addAttribute( A_FROM, from).addAttribute(A_TO, to); i = m_importExportManager.getImportGroupTranslations().keySet().iterator(); while (i.hasNext()) {
List<String> deleteProperties = OpenCms.getImportExportManager().getIgnoredProperties(); if (deleteProperties == null) { deleteProperties = new ArrayList<String>(); List<String> immutableResources = OpenCms.getImportExportManager().getImmutableResources(); if (immutableResources == null) { immutableResources = Collections.EMPTY_LIST; m_convertToXmlPage = OpenCms.getImportExportManager().convertToXmlPage(); principal = OpenCms.getImportExportManager().translateGroup(principal); principalId = m_cms.readGroup(principal).getId().toString(); } else { principal = OpenCms.getImportExportManager().translateUser(principal); principalId = m_cms.readUser(principal).getId().toString();
m_webappUrl = OpenCms.getImportExportManager().getOldWebAppUrl(); if (m_webappUrl == null) { List<String> deleteProperties = OpenCms.getImportExportManager().getIgnoredProperties(); List<String> immutableResources = OpenCms.getImportExportManager().getImmutableResources(); if (immutableResources == null) { immutableResources = Collections.EMPTY_LIST; old_overwriteCollidingResources = OpenCms.getImportExportManager().overwriteCollidingResources(); OpenCms.getImportExportManager().setOverwriteCollidingResources(true); } finally { OpenCms.getImportExportManager().setOverwriteCollidingResources(old_overwriteCollidingResources);
/** * This function fills the <code> {@link CmsExtendedHtmlImportDefault} </code> Object based on * the current values in the dialog. <p> */ private void fillExtendedHtmlImportDefault() { CmsExtendedHtmlImportDefault extimport = OpenCms.getImportExportManager().getExtendedHtmlImportDefault(); extimport.setDestinationDir(m_htmlimport.getDestinationDir()); extimport.setInputDir(m_htmlimport.getInputDir()); extimport.setDownloadGallery(m_htmlimport.getDownloadGallery()); extimport.setImageGallery(m_htmlimport.getImageGallery()); extimport.setLinkGallery(m_htmlimport.getLinkGallery()); extimport.setTemplate(m_htmlimport.getTemplate()); extimport.setElement(m_htmlimport.getElement()); extimport.setLocale(m_htmlimport.getLocale()); extimport.setEncoding(m_htmlimport.getInputEncoding()); extimport.setStartPattern(m_htmlimport.getStartPattern()); extimport.setEndPattern(m_htmlimport.getEndPattern()); extimport.setOverwrite(Boolean.toString(m_htmlimport.isOverwrite())); extimport.setKeepBrokenLinks(Boolean.toString(m_htmlimport.isKeepBrokenLinks())); OpenCms.getImportExportManager().setExtendedHtmlImportDefault(extimport); }
vfsExportHandler.setExportParams(params); OpenCms.getImportExportManager().exportData( m_cms, vfsExportHandler,
CmsUserExportSettings settings = OpenCms.getImportExportManager().getUserExportSettings();
/** * Returns the list of properties to ignore during import.<p> * * @return the list of properties to ignore during import */ protected List<String> getIgnoredProperties() { if (m_ignoredProperties == null) { // get list of ignored properties m_ignoredProperties = OpenCms.getImportExportManager().getIgnoredProperties(); if (m_ignoredProperties == null) { m_ignoredProperties = Collections.emptyList(); } } return m_ignoredProperties; }
/** * Returns the list of immutable resources.<p> * * @return the list of immutable resources */ protected List<String> getImmutableResources() { if (m_immutables == null) { // get list of immutable resources m_immutables = OpenCms.getImportExportManager().getImmutableResources(); if (m_immutables == null) { m_immutables = Collections.emptyList(); } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_IMPORTEXPORT_IMMUTABLE_RESOURCES_SIZE_1, Integer.toString(m_immutables.size()))); } } return m_immutables; }
OpenCms.fireCmsEvent( new CmsEvent(I_CmsEventListener.EVENT_CLEAR_CACHES, Collections.<String, Object> emptyMap())); I_CmsImportExportHandler handler = getImportExportHandler(parameters); synchronized (handler) { handler.setImportParameters(parameters);
List<I_CmsImportExportHandler> handlers = m_importExportManager.getImportExportHandlers(); Iterator<I_CmsImportExportHandler> handlerIt = handlers.iterator(); while (handlerIt.hasNext()) { String.valueOf(m_importExportManager.overwriteCollidingResources())); importElement.addElement(N_CONVERT).setText(String.valueOf(m_importExportManager.convertToXmlPage())); if (m_importExportManager.getOldWebAppUrl() != null) { importElement.addElement(N_OLDWEBAPPURL).setText(m_importExportManager.getOldWebAppUrl()); Iterator<I_CmsImport> importVersions = m_importExportManager.getImportVersionClasses().iterator(); while (importVersions.hasNext()) { resourcetypesElement.addElement(N_IMPORTVERSION).addAttribute( Iterator<String> immutables = m_importExportManager.getImmutableResources().iterator(); while (immutables.hasNext()) { String uri = immutables.next(); Iterator<String> userTranslationKeys = m_importExportManager.getImportUserTranslations().keySet().iterator(); while (userTranslationKeys.hasNext()) { String from = userTranslationKeys.next(); String to = m_importExportManager.getImportUserTranslations().get(from); principalsElement.addElement(N_PRINCIPALTRANSLATION).addAttribute( A_TYPE, I_CmsPrincipal.PRINCIPAL_USER).addAttribute(A_FROM, from).addAttribute(A_TO, to); Iterator<String> groupTranslationKeys = m_importExportManager.getImportGroupTranslations().keySet().iterator(); while (groupTranslationKeys.hasNext()) {
List deleteProperties = OpenCms.getImportExportManager().getIgnoredProperties(); if (deleteProperties == null) { deleteProperties = new ArrayList(); List immutableResources = OpenCms.getImportExportManager().getImmutableResources(); if (immutableResources == null) { immutableResources = Collections.EMPTY_LIST; m_convertToXmlPage = OpenCms.getImportExportManager().convertToXmlPage(); principal = OpenCms.getImportExportManager().translateGroup(principal); principalId = m_cms.readGroup(principal).getId().toString(); } else { principal = OpenCms.getImportExportManager().translateUser(principal); principalId = m_cms.readUser(principal).getId().toString();
m_webappUrl = OpenCms.getImportExportManager().getOldWebAppUrl(); if (m_webappUrl == null) { List deleteProperties = OpenCms.getImportExportManager().getIgnoredProperties(); List immutableResources = OpenCms.getImportExportManager().getImmutableResources(); if (immutableResources == null) { immutableResources = Collections.EMPTY_LIST; old_overwriteCollidingResources = OpenCms.getImportExportManager().overwriteCollidingResources(); OpenCms.getImportExportManager().setOverwriteCollidingResources(true); } finally { OpenCms.getImportExportManager().setOverwriteCollidingResources(old_overwriteCollidingResources);
vfsExportHandler.setExportParams(params); OpenCms.getImportExportManager().exportData( m_cms, vfsExportHandler,
/** * Returns the list of properties to ignore during import.<p> * * @return the list of properties to ignore during import */ protected List<String> getIgnoredProperties() { if (m_ignoredProperties == null) { // get list of ignored properties m_ignoredProperties = OpenCms.getImportExportManager().getIgnoredProperties(); if (m_ignoredProperties == null) { m_ignoredProperties = Collections.emptyList(); } } return m_ignoredProperties; }
/** * Returns the list of immutable resources.<p> * * @return the list of immutable resources */ protected List<String> getImmutableResources() { if (m_immutables == null) { // get list of immutable resources m_immutables = OpenCms.getImportExportManager().getImmutableResources(); if (m_immutables == null) { m_immutables = Collections.emptyList(); } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_IMPORTEXPORT_IMMUTABLE_RESOURCES_SIZE_1, Integer.toString(m_immutables.size()))); } } return m_immutables; }
I_CmsImportExportHandler handler = getImportExportHandler(parameters); synchronized (handler) { handler.setImportParameters(parameters);
List<String> immutableResources = OpenCms.getImportExportManager().getImmutableResources(); if (immutableResources == null) { immutableResources = Collections.emptyList(); List<String> ignoredProperties = OpenCms.getImportExportManager().getIgnoredProperties(); if (ignoredProperties == null) { ignoredProperties = Collections.emptyList(); m_convertToXmlPage = OpenCms.getImportExportManager().convertToXmlPage(); userlastmodified = OpenCms.getImportExportManager().translateUser(userlastmodified); usercreated = OpenCms.getImportExportManager().translateUser(usercreated); principal = OpenCms.getImportExportManager().translateGroup(principal); principalId = m_cms.readGroup(principal).getId().toString(); } else { principal = OpenCms.getImportExportManager().translateUser(principal); principalId = m_cms.readUser(principal).getId().toString();