📄 cmsimportexportconfiguration.java
字号:
/*
* File : $Source: /usr/local/cvs/opencms/src/org/opencms/configuration/CmsImportExportConfiguration.java,v $
* Date : $Date: 2006/03/27 14:52:46 $
* Version: $Revision: 1.25 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
*
* Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software GmbH, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.configuration;
import org.opencms.importexport.CmsImportExportManager;
import org.opencms.importexport.I_CmsImportExportHandler;
import org.opencms.main.CmsLog;
import org.opencms.security.I_CmsPrincipal;
import org.opencms.staticexport.CmsStaticExportExportRule;
import org.opencms.staticexport.CmsStaticExportManager;
import org.opencms.staticexport.CmsStaticExportRfsRule;
import java.io.File;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.commons.digester.Digester;
import org.dom4j.Element;
/**
* Import / export master configuration class.<p>
*
* @author Alexander Kandzior
*
* @version $Revision: 1.25 $
*
* @since 6.0.0
*/
public class CmsImportExportConfiguration extends A_CmsXmlConfiguration implements I_CmsXmlConfiguration {
/** The name of the DTD for this configuration. */
public static final String CONFIGURATION_DTD_NAME = "opencms-importexport.dtd";
/** The name of the default XML file for this configuration. */
public static final String DEFAULT_XML_FILE_NAME = "opencms-importexport.xml";
/** Node that indicates page conversion. */
protected static final String N_CONVERT = "convert";
/** Node that contains a list of properties ignored during import. */
protected static final String N_IGNOREDPROPERTIES = "ignoredproperties";
/** The import immutable resources node. */
protected static final String N_IMMUTABLES = "immutables";
/** The node name of the import subconfiguration. */
protected static final String N_IMPORT = "import";
/** The main configuration node name. */
protected static final String N_IMPORTEXPORT = "importexport";
/** The node name of an individual import/export handler. */
protected static final String N_IMPORTEXPORTHANDLER = "importexporthandler";
/** Master node for import/export handlers. */
protected static final String N_IMPORTEXPORTHANDLERS = "importexporthandlers";
/** The node name of an individual import version class. */
protected static final String N_IMPORTVERSION = "importversion";
/** Master node for import version class names. */
protected static final String N_IMPORTVERSIONS = "importversions";
/** Node the contains an optional URL of old web application. */
protected static final String N_OLDWEBAPPURL = "oldwebappurl";
/** The import overwrite node name. */
protected static final String N_OVERWRITE = "overwrite";
/** An individual principal translation node. */
protected static final String N_PRINCIPALTRANSLATION = "principaltranslation";
/** The principal translation node. */
protected static final String N_PRINCIPALTRANSLATIONS = "principaltranslations";
/** The main configuration node for static export name. */
protected static final String N_STATICEXPORT = "staticexport";
/** The node name of the static export acceptcharset node. */
protected static final String N_STATICEXPORT_ACCEPTCHARSET = "acceptcharset";
/** The node name of the static export acceptlanguage node. */
protected static final String N_STATICEXPORT_ACCEPTLANGUAGE = "acceptlanguage";
/** The node name of the static export default node. */
protected static final String N_STATICEXPORT_DEFAULT = "defaultpropertyvalue";
/** The node name of the static export defualtsuffix node. */
protected static final String N_STATICEXPORT_DEFAULTSUFFIXES = "defaultsuffixes";
/** The node name of the static export rule description nodes. */
protected static final String N_STATICEXPORT_DESCRIPTION = "description";
/** The node name of the static export export-rule export node. */
protected static final String N_STATICEXPORT_EXPORT = "export-resources";
/** The node name of the static export exportheaders node. */
protected static final String N_STATICEXPORT_EXPORTHEADERS = "exportheaders";
/** The node name of the static export exportpath node. */
protected static final String N_STATICEXPORT_EXPORTPATH = "exportpath";
/** The node name of the static export export-rule node. */
protected static final String N_STATICEXPORT_EXPORTRULE = "export-rule";
/** The node name of the static export export-rules node. */
protected static final String N_STATICEXPORT_EXPORTRULES = "export-rules";
/** The node name of the static export exporturl node. */
protected static final String N_STATICEXPORT_EXPORTURL = "exporturl";
/** The node name of the static export handler node. */
protected static final String N_STATICEXPORT_HANDLER = "staticexporthandler";
/** The node name of the static export header node. */
protected static final String N_STATICEXPORT_HEADER = "header";
/** The node name of the static export export-rule modified node. */
protected static final String N_STATICEXPORT_MODIFIED = "modified-resources";
/** The node name of the static export rule name nodes. */
protected static final String N_STATICEXPORT_NAME = "name";
/** The node name of the static export plainoptimization node. */
protected static final String N_STATICEXPORT_PLAINOPTIMIZATION = "plainoptimization";
/** The node name of the static export regex node. */
protected static final String N_STATICEXPORT_REGEX = "regex";
/** The node name of the static export related-system-res node. */
protected static final String N_STATICEXPORT_RELATED_SYSTEM_RES = "related-system-res";
/** The node name of the static export relativelinks node. */
protected static final String N_STATICEXPORT_RELATIVELINKS = "userelativelinks";
/** The node name of the static export remoteaddr node. */
protected static final String N_STATICEXPORT_REMOTEADDR = "remoteaddr";
/** The node name of the static export rendersettings node. */
protected static final String N_STATICEXPORT_RENDERSETTINGS = "rendersettings";
/** The node name of the static export requestheaders node. */
protected static final String N_STATICEXPORT_REQUESTHEADERS = "requestheaders";
/** The node name of the static export resourcestorender node. */
protected static final String N_STATICEXPORT_RESOURCESTORENDER = "resourcestorender";
/** The node name of the static export rfx-prefix node. */
protected static final String N_STATICEXPORT_RFS_PREFIX = "rfs-prefix";
/** The node name of the static export rfx-rule node. */
protected static final String N_STATICEXPORT_RFS_RULE = "rfs-rule";
/** The node name of the static export rfx-rules node. */
protected static final String N_STATICEXPORT_RFS_RULES = "rfs-rules";
/** The node name of the static export rfx-rule source node. */
protected static final String N_STATICEXPORT_SOURCE = "source";
/** The node name of the static export suffix node. */
protected static final String N_STATICEXPORT_SUFFIX = "suffix";
/** The node name of the static export testresource node. */
protected static final String N_STATICEXPORT_TESTRESOURCE = "testresource";
/** The node name of the static export export-rule export uri node. */
protected static final String N_STATICEXPORT_URI = "uri";
/** The node name of the static export vfx-prefix node. */
protected static final String N_STATICEXPORT_VFS_PREFIX = "vfs-prefix";
/** The configured import/export manager. */
private CmsImportExportManager m_importExportManager;
/** The configured static export manager. */
private CmsStaticExportManager m_staticExportManager;
/**
* Public constructor, will be called by configuration manager.<p>
*/
public CmsImportExportConfiguration() {
setXmlFileName(DEFAULT_XML_FILE_NAME);
if (CmsLog.INIT.isInfoEnabled()) {
CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_IMPORT_CONFIG_INIT_0));
}
}
/**
* @see org.opencms.configuration.I_CmsXmlConfiguration#addXmlDigesterRules(org.apache.commons.digester.Digester)
*/
public void addXmlDigesterRules(Digester digester) {
// add finish rule
digester.addCallMethod("*/" + N_IMPORTEXPORT, "initializeFinished");
// creation of the import/export manager
digester.addObjectCreate("*/" + N_IMPORTEXPORT, CmsImportExportManager.class);
// import/export manager finished
digester.addSetNext("*/" + N_IMPORTEXPORT, "setImportExportManager");
// add rules for import/export handlers
digester.addObjectCreate(
"*/" + N_IMPORTEXPORT + "/" + N_IMPORTEXPORTHANDLERS + "/" + N_IMPORTEXPORTHANDLER,
A_CLASS,
CmsConfigurationException.class);
digester.addSetNext(
"*/" + N_IMPORTEXPORT + "/" + N_IMPORTEXPORTHANDLERS + "/" + N_IMPORTEXPORTHANDLER,
"addImportExportHandler");
// overwrite rule
digester.addCallMethod(
"*/" + N_IMPORTEXPORT + "/" + N_IMPORT + "/" + N_OVERWRITE,
"setOverwriteCollidingResources",
0);
// convert rule
digester.addCallMethod("*/" + N_IMPORTEXPORT + "/" + N_IMPORT + "/" + N_CONVERT, "setConvertToXmlPage", 0);
// old webapp rule
digester.addCallMethod("*/" + N_IMPORTEXPORT + "/" + N_IMPORT + "/" + N_OLDWEBAPPURL, "setOldWebAppUrl", 0);
// add rules for the import versions
digester.addObjectCreate("*/"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -