?? cmsimportexportmanager.java
字號:
/*
* File : $Source: /usr/local/cvs/opencms/src/org/opencms/importexport/CmsImportExportManager.java,v $
* Date : $Date: 2006/03/27 14:52:54 $
* Version: $Revision: 1.30 $
*
* 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.importexport;
import org.opencms.configuration.CmsConfigurationException;
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.30 $
*
* @since 6.0.0
*
* @see OpenCms#getImportExportManager()
*/
public class CmsImportExportManager {
/** 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 = "4";
/**
* 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 "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 "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;
/** The initialized import/export handlers. */
private List m_importExportHandlers;
/** Import princial group translations. */
private Map m_importGroupTranslations;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -