亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? a_cmsimport.java

?? cms是開源的框架
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * File   : $Source: /usr/local/cvs/opencms/src/org/opencms/importexport/A_CmsImport.java,v $
 * Date   : $Date: 2006/03/27 14:52:54 $
 * Version: $Revision: 1.84 $
 *
 * 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.db.CmsUserSettings;
import org.opencms.file.CmsGroup;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsProperty;
import org.opencms.file.CmsPropertyDefinition;
import org.opencms.file.CmsResource;
import org.opencms.file.types.CmsResourceTypePointer;
import org.opencms.i18n.CmsMessageContainer;
import org.opencms.i18n.I_CmsMessageBundle;
import org.opencms.main.CmsException;
import org.opencms.main.CmsLog;
import org.opencms.main.OpenCms;
import org.opencms.report.I_CmsReport;
import org.opencms.security.CmsAccessControlEntry;
import org.opencms.util.CmsFileUtil;
import org.opencms.util.CmsStringUtil;
import org.opencms.util.CmsUUID;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Stack;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.logging.Log;

import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.Element;

/**
 * Collection of common used methods for implementing OpenCms Import classes.<p>
 * 
 * This class does not implement a real OpenCms import, real import implmentation should be 
 * inherited form this class.<p>
 *
 * @author Michael Emmerich 
 * @author Thomas Weckert  
 * 
 * @version $Revision: 1.84 $ 
 * 
 * @since 6.0.0 
 * 
 * @see org.opencms.importexport.I_CmsImport
 */

public abstract class A_CmsImport implements I_CmsImport {

    /** The name of the legacy resource type "page". */
    public static final String RESOURCE_TYPE_LEGACY_PAGE_NAME = "page";

    /** Debug flag to show debug output. */
    protected static final int DEBUG = 0;

    /** The id of the legacy resource type "link". */
    protected static final int RESOURCE_TYPE_LINK_ID = 1024;

    /** The name of the legacy resource type "link". */
    protected static final String RESOURCE_TYPE_LINK_NAME = "link";

    /** The id of the legacy resource type "newpage". */
    protected static final int RESOURCE_TYPE_NEWPAGE_ID = 9;

    /** The name of the legacy resource type "newpage". */
    protected static final String RESOURCE_TYPE_NEWPAGE_NAME = "newpage";

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

    /** The cms context to do the import operations with. */
    protected CmsObject m_cms;

    /** Flag for conversion to xml pages. */
    protected boolean m_convertToXmlPage;

    /** The xml manifest-file. */
    protected Document m_docXml;

    /** Groups to create during import are stored here. */
    protected Stack m_groupsToCreate;

    /** Indicates if module data is being imported. */
    protected boolean m_importingChannelData;

    /** The import-path to write resources into the cms. */
    protected String m_importPath;

    /** The import-resource (folder) to load resources from. */
    protected File m_importResource;

    /** The import-resource (zip) to load resources from. */
    protected ZipFile m_importZip;

    /** Storage for all pointer properties which must be converted into links. */
    protected Map m_linkPropertyStorage;

    /** Storage for all pointers which must be converted into links. */
    protected Map m_linkStorage;

    /** The object to report the log messages. */
    protected I_CmsReport m_report;

    /** Messages object with the locale of the current user. */
    protected I_CmsMessageBundle m_userMessages;

    /**
     * Converts a given digest to base64 encoding.<p>
     * 
     * @param value the digest value in the legacy encoding
     * @return the digest in the new encoding
     */
    public String convertDigestEncoding(String value) {

        byte[] data = new byte[value.length() / 2];

        for (int i = 0; i < data.length; i++) {
            data[i] = (byte)(Integer.parseInt(value.substring(i * 2, i * 2 + 2), 16) - 128);
        }

        return new String(Base64.encodeBase64(data));
    }

    /**
     * Checks if the resources is in the list of immutalbe resources. <p>
     * 
     * @param translatedName the name of the resource
     * @param immutableResources the list of the immutable resources
     * @return true or false
     */
    protected boolean checkImmutable(String translatedName, List immutableResources) {

        boolean resourceNotImmutable = true;
        if (immutableResources.contains(translatedName)) {
            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(
                    Messages.LOG_IMPORTEXPORT_RESOURCENAME_IMMUTABLE_1,
                    translatedName));
            }
            // this resource must not be modified by an import if it already exists
            m_cms.getRequestContext().saveSiteRoot();
            try {
                m_cms.getRequestContext().setSiteRoot("/");
                m_cms.readResource(translatedName);
                resourceNotImmutable = false;
                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(
                        Messages.LOG_IMPORTEXPORT_IMMUTABLE_FLAG_SET_1,
                        translatedName));
                }
            } catch (CmsException e) {
                // resourceNotImmutable will be true 
                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(
                        Messages.LOG_IMPORTEXPORT_ERROR_ON_TEST_IMMUTABLE_1,
                        translatedName), e);
                }
            } finally {
                m_cms.getRequestContext().restoreSiteRoot();
            }
        }
        return resourceNotImmutable;
    }

    /**
     * Cleans up member variables after the import is finished.<p>
     * 
     * This is required since there is only one instance for
     * each import version that is kept in memory and reused.<p>
     */
    protected void cleanUp() {

        m_importResource = null;
        m_importZip = null;
        m_report = null;
        m_linkStorage = null;
        m_linkPropertyStorage = null;
        m_groupsToCreate = null;
        m_cms = null;
    }

    /**
     * Converts old style pointers to siblings if possible.<p>
     */
    protected void convertPointerToSiblings() {

        Iterator keys = m_linkStorage.keySet().iterator();
        int linksSize = m_linkStorage.size();
        int i = 0;
        CmsResource resource = null;
        String link = null;
        String key = null;

        try {
            // loop through all links to convert
            while (keys.hasNext()) {

                try {
                    key = (String)keys.next();
                    link = (String)m_linkStorage.get(key);
                    List properties = (List)m_linkPropertyStorage.get(key);
                    CmsProperty.setAutoCreatePropertyDefinitions(properties, true);

                    m_report.print(org.opencms.report.Messages.get().container(
                        org.opencms.report.Messages.RPT_SUCCESSION_2,
                        String.valueOf(++i),
                        String.valueOf(linksSize)), I_CmsReport.FORMAT_NOTE);
                    m_report.print(Messages.get().container(Messages.RPT_CONVERT_LINK_0), I_CmsReport.FORMAT_NOTE);
                    m_report.print(org.opencms.report.Messages.get().container(
                        org.opencms.report.Messages.RPT_ARGUMENT_1,
                        key + " "));
                    m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));

                    // check if this is an internal pointer
                    if (link.startsWith("/")) {
                        // check if the pointer target is existing
                        CmsResource target = m_cms.readResource(link);

                        // create a new sibling as CmsResource                         
                        resource = new CmsResource(
                            new CmsUUID(), // structure ID is always a new UUID
                            target.getResourceId(),
                            key,
                            target.getTypeId(),
                            target.isFolder(),
                            0,
                            m_cms.getRequestContext().currentProject().getId(), // TODO: pass flags from import 
                            CmsResource.STATE_NEW,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人免费网站| 久久综合九色综合欧美亚洲| 国产精品系列在线观看| 免费观看在线色综合| 亚洲一区二区三区不卡国产欧美| 中文字幕中文在线不卡住| 久久精品亚洲精品国产欧美| 久久夜色精品国产噜噜av| wwwwxxxxx欧美| 久久午夜国产精品| 久久久久国色av免费看影院| 国产女人18毛片水真多成人如厕| 国产午夜久久久久| 亚洲图片激情小说| 一区二区三区四区在线播放| 亚洲一区二三区| 日韩av在线播放中文字幕| 免费人成在线不卡| 国产成人av影院| eeuss国产一区二区三区| 成人av在线看| 在线观看国产一区二区| 69久久夜色精品国产69蝌蚪网| 欧美蜜桃一区二区三区| 精品国产一区二区在线观看| 久久精品综合网| 国产精品久久久一本精品 | 日本成人中文字幕在线视频 | 精品一区二区久久| 成人高清视频在线观看| 欧美亚洲愉拍一区二区| 精品国产乱码久久久久久久久 | 99国产精品99久久久久久| 欧洲精品一区二区| 日韩天堂在线观看| 亚洲丝袜精品丝袜在线| 免费美女久久99| 99久久精品国产一区二区三区| 精品视频一区二区不卡| 国产亚洲va综合人人澡精品| 亚洲一区二区三区四区在线 | 在线这里只有精品| 精品成人a区在线观看| 国产精品精品国产色婷婷| 日韩中文字幕1| 99精品黄色片免费大全| 欧美一区二区在线播放| 亚洲欧美日韩久久精品| 国精品**一区二区三区在线蜜桃| 在线视频欧美区| 国产精品免费视频观看| 精品综合免费视频观看| 欧美日韩国产在线观看| 中文字幕亚洲电影| 国产一区二区三区在线观看免费视频 | 色婷婷综合五月| 久久久久久久久蜜桃| 免费成人在线观看视频| 色婷婷av一区二区三区软件| 精品国产制服丝袜高跟| 石原莉奈在线亚洲三区| 91精彩视频在线| 国产精品久线在线观看| 国产91精品一区二区| 欧美一区二区三区白人| 亚洲第一av色| 色狠狠综合天天综合综合| 中文字幕av一区 二区| 国产精品一区二区在线播放| 日韩三级视频在线观看| 亚洲成人福利片| 欧洲一区二区av| 亚洲乱码国产乱码精品精的特点| 高潮精品一区videoshd| 国产色产综合色产在线视频| 精品一区二区在线视频| 日韩欧美国产一二三区| 免费的成人av| 精品国产免费视频| 国产精品伊人色| 久久久www免费人成精品| 国产精品一区二区久久不卡| 久久久av毛片精品| 风流少妇一区二区| 综合久久一区二区三区| 色呦呦网站一区| 亚洲国产cao| 欧美一区二区高清| 久久99久久久久| 久久久久久久久久美女| 99久久综合国产精品| 亚洲精品国产第一综合99久久| 在线观看网站黄不卡| 午夜一区二区三区在线观看| 日韩精品一区二区三区中文精品| 狠狠色丁香久久婷婷综合_中| 久久久久久久综合狠狠综合| 99re在线精品| 亚洲 欧美综合在线网络| 日韩美女一区二区三区四区| 国产一区二区三区| 亚洲欧美一区二区三区久本道91| 欧美伊人久久大香线蕉综合69 | 久久久国际精品| 色偷偷久久一区二区三区| 午夜电影久久久| 日本一区二区不卡视频| 在线免费不卡视频| 激情综合色综合久久综合| 中文字幕在线不卡国产视频| 在线播放国产精品二区一二区四区| 黄页网站大全一区二区| 亚洲三级在线免费| 欧美一区二区三区白人| 91丨九色丨黑人外教| 婷婷激情综合网| 国产精品午夜春色av| 91.com在线观看| 99国产精品久久久| 国内精品久久久久影院色| 亚洲精品免费一二三区| 欧美不卡一区二区三区四区| 欧美最猛性xxxxx直播| 国产一区二区三区四区在线观看 | 天天色 色综合| 欧美激情一区二区三区四区| 欧美日韩国产综合久久| 波多野结衣在线一区| 九九久久精品视频| 亚洲www啪成人一区二区麻豆| 国产清纯在线一区二区www| 91精品国产综合久久婷婷香蕉| 99精品黄色片免费大全| 国产一区二区成人久久免费影院| 亚洲第一在线综合网站| 成人免费一区二区三区在线观看| 日韩精品一区二区三区中文不卡| 色av综合在线| 99久久综合狠狠综合久久| 国产精品主播直播| 精久久久久久久久久久| 肉丝袜脚交视频一区二区| 亚洲综合视频在线观看| 国产精品剧情在线亚洲| 欧美激情一区二区三区四区| 精品国产人成亚洲区| 日韩精品资源二区在线| 欧美一区二区免费视频| 在线综合+亚洲+欧美中文字幕| 91成人看片片| 欧美少妇xxx| 欧美视频日韩视频在线观看| 欧美午夜电影在线播放| 欧美亚一区二区| 精品视频1区2区| 欧美日韩日本视频| 在线不卡一区二区| 日韩三级中文字幕| 精品99久久久久久| 国产亚洲综合在线| 久久久91精品国产一区二区精品| 久久精品人人做人人爽人人| 欧美激情资源网| 国产精品传媒在线| 亚洲乱码中文字幕| 亚洲国产精品人人做人人爽| 午夜精品久久久| 日本免费新一区视频| 黑人巨大精品欧美一区| 成人午夜视频在线观看| 91老师片黄在线观看| 在线精品国精品国产尤物884a| 欧美日韩精品福利| 精品久久久久久久人人人人传媒| 久久在线观看免费| 国产精品久久久久久久久免费樱桃| 国产精品国产精品国产专区不蜜 | 国产精品一区二区黑丝| eeuss鲁片一区二区三区在线观看| 色综合一个色综合| 91麻豆精品国产自产在线 | 亚洲激情校园春色| 亚洲成在线观看| 国产一区二区美女诱惑| 99久久久国产精品| 91.com在线观看| 国产欧美久久久精品影院| 一区二区三区四区av| 免费人成在线不卡| 97久久超碰精品国产| 欧美精品国产精品| 国产精品蜜臀在线观看| 丝袜诱惑亚洲看片| 成人精品视频一区二区三区| 欧美日韩在线一区二区| 亚洲国产精品v| 免费成人av在线| 99久久99久久免费精品蜜臀| 欧美男同性恋视频网站| 自拍偷拍欧美精品|