⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmsimportexportmanager.java

📁 找了很久才找到到源代码
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
/*
 * File   : $Source: /usr/local/cvs/opencms/src/org/opencms/importexport/CmsImportExportManager.java,v $
 * Date   : $Date: 2007-09-12 07:29:34 $
 * Version: $Revision: 1.33 $
 *
 * This library is part of OpenCms -
 * the Open Source Content Management System
 *
 * Copyright (c) 2002 - 2007 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.importexport;

import org.opencms.configuration.CmsConfigurationException;
import org.opencms.db.CmsUserExportSettings;
import org.opencms.file.CmsObject;
import org.opencms.i18n.CmsMessageContainer;
import org.opencms.main.CmsEvent;
import org.opencms.main.CmsException;
import org.opencms.main.CmsLog;
import org.opencms.main.I_CmsEventListener;
import org.opencms.main.OpenCms;
import org.opencms.report.I_CmsReport;
import org.opencms.security.CmsRole;
import org.opencms.security.CmsRoleViolationException;
import org.opencms.security.I_CmsPrincipal;
import org.opencms.xml.CmsXmlException;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStream;
import java.io.Reader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

import org.apache.commons.logging.Log;

import org.dom4j.Document;
import org.dom4j.io.SAXReader;

/**
 * Provides information about how to handle imported resources.<p>
 * 
 * @author Thomas Weckert  
 * 
 * @version $Revision: 1.33 $ 
 * 
 * @since 6.0.0 
 * 
 * @see OpenCms#getImportExportManager()
 */
public class CmsImportExportManager {

    /** Tag in the {@link #EXPORT_MANIFEST} for the "userinfo/entry@name" attribute, contains the additional user info entry name. */
    public static final String A_NAME = "name";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "userinfo/entry@type" attribute, contains the additional user info entry data type name. */
    public static final String A_TYPE = "type";

    /** The name of the XML manifest file used for the description of exported OpenCms VFS properties and atributes. */
    public static final String EXPORT_MANIFEST = "manifest.xml";

    /** The current version of the OpenCms export (appears in the {@link #EXPORT_MANIFEST} header). */
    public static final String EXPORT_VERSION = "" + CmsImportVersion6.IMPORT_VERSION6;

    /** 
     * The name of the XML manifest file used for the description of exported OpenCms VFS properties and atributes.<p>
     * 
     * @deprecated use {@link #EXPORT_MANIFEST} instead
     */
    public static final String EXPORT_XMLFILENAME = EXPORT_MANIFEST;

    /** Tag in the {@link #EXPORT_MANIFEST} for the "access" node. */
    public static final String N_ACCESS = "access";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "allowed" node, to identify allowed user permissions. */
    public static final String N_ACCESSCONTROL_ALLOWEDPERMISSIONS = "allowed";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "denied" node, to identify denied user permissions. */
    public static final String N_ACCESSCONTROL_DENIEDPERMISSIONS = "denied";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "accesscontrol" node, to identify access control entries. */
    public static final String N_ACCESSCONTROL_ENTRIES = "accesscontrol";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "accessentry" node, to identify a single access control entry. */
    public static final String N_ACCESSCONTROL_ENTRY = "accessentry";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "permissionset" node, to identify a permission set. */
    public static final String N_ACCESSCONTROL_PERMISSIONSET = "permissionset";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "uuidprincipal" node, to identify a principal UUID. */
    public static final String N_ACCESSCONTROL_PRINCIPAL = "uuidprincipal";

    /** Tag for the "creator" node (appears in the {@link #EXPORT_MANIFEST} header). */
    public static final String N_CREATOR = "creator";

    /** Tag for the "createdate" node (appears in the {@link #EXPORT_MANIFEST} header). */
    public static final String N_DATE = "createdate";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "datecreated" node, contains the date created VFS file attribute. */
    public static final String N_DATECREATED = "datecreated";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "dateexpired" node, contains the expiration date VFS file attribute. */
    public static final String N_DATEEXPIRED = "dateexpired";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "datelastmodified" node, contains the date last modified VFS file attribute. */
    public static final String N_DATELASTMODIFIED = "datelastmodified";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "datereleased" node, contains the release date VFS file attribute. */
    public static final String N_DATERELEASED = "datereleased";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "defaultgroup" node, for backward compatibility with OpenCms 5.x. */
    public static final String N_DEFAULTGROUP = "defaultgroup";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "description" node, contains a users description test. */
    public static final String N_DESCRIPTION = "description";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "destination" node, contains target VFS file name. */
    public static final String N_DESTINATION = "destination";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "email" node, contains a users email. */
    public static final String N_EMAIL = "email";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "export" node. */
    public static final String N_EXPORT = "export";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "file" node, container node for all VFS resources. */
    public static final String N_FILE = "file";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "firstname" node, contains a users first name. */
    public static final String N_FIRSTNAME = "firstname";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "flags" node, contains the flags of a VFS resource. */
    public static final String N_FLAGS = "flags";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "groupdata" node, contains a users group data. */
    public static final String N_GROUPDATA = "groupdata";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "groupname" node, contains a groups name. */
    public static final String N_GROUPNAME = "groupname";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "id" node, only required for backward compatibility with import version 2. */
    public static final String N_ID = "id";

    /** Tag in the {@link #EXPORT_MANIFEST}, starts the manifest info header. */
    public static final String N_INFO = "info";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "lastmodified" node, only required for backward compatibility with import version 2. */
    public static final String N_LASTMODIFIED = "lastmodified";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "lastname" node, contains a users last name. */
    public static final String N_LASTNAME = "lastname";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "name" node, contains a users login name. */
    public static final String N_NAME = "name";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "opencms_version" node, appears in the manifest info header. */
    public static final String N_OC_VERSION = "opencms_version";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "parentgroup" node, contains a groups parent group name. */
    public static final String N_PARENTGROUP = "parentgroup";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "password" node, contains a users encrypted password. */
    public static final String N_PASSWORD = "password";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "project" node, appears in the manifest info header. */
    public static final String N_PROJECT = "project";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "properties" node, starts the list of properties of a VFS resource. */
    public static final String N_PROPERTIES = "properties";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "property" node, starts a property for a VFS resource. */
    public static final String N_PROPERTY = "property";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "type" property attribute, contains a property type. */
    public static final String N_PROPERTY_ATTRIB_TYPE = "type";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "shared" property type attribute value. */
    public static final String N_PROPERTY_ATTRIB_TYPE_SHARED = "shared";

    /** Tag in the [@link #EXPORT_MANIFEST} for the "relation" node, starts a relation for a VFS resource. */
    public static final String N_RELATION = "relation";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "id" relation attribute, contains the structure id of the target resource of the relation. */
    public static final String N_RELATION_ATTRIBUTE_ID = "id";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "path" relation attribute, contains the path to the target resource of the relation. */
    public static final String N_RELATION_ATTRIBUTE_PATH = "path";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "type" relation attribute, contains the type of relation. */
    public static final String N_RELATION_ATTRIBUTE_TYPE = "type";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "relations" node, starts the list of relations of a VFS resources. */
    public static final String N_RELATIONS = "relations";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "source" node, contains the source path of a VFS resource in the import zip (or folder). */
    public static final String N_SOURCE = "source";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "address" node, contains a users address. */
    public static final String N_TAG_ADDRESS = "address";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "type" node, the resource type name of a VFS resource. */
    public static final String N_TYPE = "type";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "user" node, starts the user data. */
    public static final String N_USER = "user";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "usercreated" node, contains the name of the user who created the VFS resource. */
    public static final String N_USERCREATED = "usercreated";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "userdata" node, starts the list of users. */
    public static final String N_USERDATA = "userdata";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "usergroupdatas" node, starts the users group data. */
    public static final String N_USERGROUPDATA = "usergroupdata";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "usergroups" node, starts the users group data. */
    public static final String N_USERGROUPS = "usergroups";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "userinfo" node, contains the additional user info. */
    public static final String N_USERINFO = "userinfo";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "userinfo/entry" node, contains the additional user info entry value. */
    public static final String N_USERINFO_ENTRY = "entry";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "userlastmodified" node, contains the name of the user who last modified the VFS resource. */
    public static final String N_USERLASTMODIFIED = "userlastmodified";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "uuidresource" node, contains a the resource UUID of a VFS resource. */
    public static final String N_UUIDRESOURCE = "uuidresource";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "uuidstructure" node, only required for backward compatibility with import version 2. */
    public static final String N_UUIDSTRUCTURE = "uuidstructure";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "value" node, contains the value of a property. */
    public static final String N_VALUE = "value";

    /** Tag in the {@link #EXPORT_MANIFEST} for the "export_version" node, appears in the manifest info header. */
    public static final String N_VERSION = "export_version";

    /** The log object for this class. */
    private static final Log LOG = CmsLog.getLog(CmsImportExportManager.class);

    /** Boolean flag whether imported pages should be converted into XML pages. */
    private boolean m_convertToXmlPage;

    /** List of property keys that should be removed from imported resources. */
    private List m_ignoredProperties;

    /** List of immutable resources that should remain unchanged when resources are imported. */
    private List m_immutableResources;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -