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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? a_cmssetupxmlupdate.java

?? cms是開(kāi)源的框架
?? JAVA
字號(hào):
/*
 * File   : $Source: /usr/local/cvs/opencms/src/org/opencms/setup/xml/A_CmsSetupXmlUpdate.java,v $
 * Date   : $Date: 2006/03/27 14:52:44 $
 * Version: $Revision: 1.2 $
 *
 * 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.setup.xml;

import org.opencms.configuration.CmsConfigurationManager;
import org.opencms.i18n.CmsEncoder;
import org.opencms.setup.CmsSetupBean;
import org.opencms.util.CmsStringUtil;
import org.opencms.xml.CmsXmlUtils;

import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import org.dom4j.Branch;
import org.dom4j.Document;
import org.dom4j.DocumentFactory;
import org.dom4j.Node;

/**
 * Skeleton for xml update plugins.<p>
 * 
 * @author Michael Moossen
 * 
 * @version $Revision: 1.2 $ 
 * 
 * @since 6.1.8 
 */
public abstract class A_CmsSetupXmlUpdate implements I_CmsSetupXmlUpdate {

    /**
     * @see org.opencms.setup.xml.I_CmsSetupXmlUpdate#execute(org.opencms.setup.CmsSetupBean)
     */
    public void execute(CmsSetupBean setupBean) throws Exception {

        Document doc = setupBean.getXmlHelper().getDocument(getXmlFilename());
        Iterator itRemove = getXPathsToRemove().iterator();
        while (itRemove.hasNext()) {
            String xpath = (String)itRemove.next();
            CmsSetupXmlHelper.setValue(doc, xpath, null);
        }
        Iterator itUpdate = getXPathsToUpdate().iterator();
        while (itUpdate.hasNext()) {
            String xpath = (String)itUpdate.next();
            executeUpdate(doc, xpath);
        }
    }

    /**
     * @see org.opencms.setup.xml.I_CmsSetupXmlUpdate#getCodeToChange(org.opencms.setup.CmsSetupBean)
     */
    public String getCodeToChange(CmsSetupBean setupBean) throws Exception {

        String ret = "";
        Document doc = setupBean.getXmlHelper().getDocument(getXmlFilename());

        // get the nodes to be deleted
        Iterator itRemove = getXPathsToRemove().iterator();
        while (itRemove.hasNext()) {
            String xpath = (String)itRemove.next();
            Node node = doc.selectSingleNode(xpath);
            if (node != null) {
                ret += CmsXmlUtils.marshal(node, CmsEncoder.ENCODING_UTF_8);
            }
        }

        // create new temp doc to modify
        String parentPath = getCommonPath();
        // could be better done...
        Document newDoc = prepareDoc(doc);

        boolean modified = false;
        // update the temp doc
        Iterator itUpdate = getXPathsToUpdate().iterator();
        while (itUpdate.hasNext()) {
            String xpath = (String)itUpdate.next();
            updateDoc(doc, newDoc, xpath);
            boolean exe = executeUpdate(newDoc, xpath);
            modified = modified || exe;
            if (parentPath == null && exe) {
                Node node = newDoc.selectSingleNode(xpath);
                if (node != null) {
                    ret += CmsXmlUtils.marshal(node, CmsEncoder.ENCODING_UTF_8);
                }
            }
        }
        if (parentPath != null && modified) {
            Node node = newDoc.selectSingleNode(parentPath);
            if (node != null) {
                ret += CmsXmlUtils.marshal(node, CmsEncoder.ENCODING_UTF_8);
            }
        }
        return ret.trim();
    }
    
    /**
     * Updates the given doc inserting the given node corresponding to the given xpath.<p>
     * 
     * @param document the original document to update
     * @param newDoc the document to update
     * @param xpath the corresponding xpath
     */
    protected void updateDoc(Document document, Document newDoc, String xpath) {

        Node node = document.selectSingleNode(xpath);
        if (node != null) {
            CmsSetupXmlHelper.setValue(newDoc, CmsXmlUtils.removeLastComplexXpathElement(xpath), " ");
            node = (Node)node.clone();
            node.setParent(null);
            ((Branch)newDoc.selectSingleNode(CmsXmlUtils.removeLastComplexXpathElement(xpath))).add(node);
        }
    }

    /**
     * Returns a parent path that is common for all nodes to modify.<p> 
     * 
     * @return common parent path
     */
    protected String getCommonPath() {
        
        return null;
    }

    /**
     * @see org.opencms.setup.xml.I_CmsSetupXmlUpdate#validate(org.opencms.setup.CmsSetupBean)
     */
    public boolean validate(CmsSetupBean setupBean) throws Exception {

        return CmsStringUtil.isNotEmptyOrWhitespaceOnly(getCodeToChange(setupBean));
    }

    /**
     * Executes the adding/updating changes on the given document.<p>
     * 
     * Only needs to be overriden if {@link #getXPathsToUpdate()} is not empty.<p>
     * 
     * @param document the document to apply the changes to
     * @param xpath the xpath to execute the changes for
     * 
     * @return if something was modified
     */
    protected boolean executeUpdate(Document document, String xpath) {

        // do something to avoid warning
        return ((Object)document == (Object)xpath);
    }

    /**
     * Returns a list of xpaths for the nodes to remove.<p>
     * 
     * @return a list of strings
     */
    protected List getXPathsToRemove() {

        return Collections.EMPTY_LIST;
    }

    /**
     * Returns a list of xpaths for the nodes to add/update.<p>
     * 
     * @return a list of strings
     */
    protected List getXPathsToUpdate() {

        return Collections.EMPTY_LIST;
    }

    /**
     * Prepares a new document.<p>
     * 
     * @param doc the original document
     * 
     * @return a new document 
     */
    protected Document prepareDoc(Document doc) {

        Document newDoc = new DocumentFactory().createDocument();
        newDoc.addElement(CmsConfigurationManager.N_ROOT);
        newDoc.setName(doc.getName());
        return newDoc;
    }
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丁香桃色午夜亚洲一区二区三区| 91日韩在线专区| 亚洲激情图片qvod| 亚洲精品在线观看网站| 91首页免费视频| 丁香激情综合五月| 国模一区二区三区白浆| 亚洲成人免费视| 亚洲婷婷国产精品电影人久久| 欧美一区二区三区人| 91丝袜美腿高跟国产极品老师 | 在线精品视频免费播放| 国产精品1024| 麻豆精品视频在线观看| 午夜欧美一区二区三区在线播放| 欧美国产97人人爽人人喊| 日韩欧美精品三级| 欧美精品 国产精品| 欧美性一二三区| 色综合亚洲欧洲| 91在线你懂得| fc2成人免费人成在线观看播放| 国产专区综合网| 免费不卡在线视频| 日韩电影一二三区| 天天影视涩香欲综合网| 亚洲成人手机在线| 亚洲天堂免费看| 亚洲日本va午夜在线影院| 欧美韩国日本不卡| 欧美极品美女视频| 国产清纯白嫩初高生在线观看91| 久久亚洲欧美国产精品乐播| 精品少妇一区二区三区在线视频| 日韩亚洲欧美在线| 日韩欧美国产三级| 欧美精品一区二区三区四区| 欧美成人video| 久久伊人中文字幕| 久久这里只有精品6| 久久婷婷一区二区三区| 久久蜜桃一区二区| 国产精品污网站| 亚洲天堂av一区| 一区二区三区国产精华| 亚洲成人动漫av| 日韩不卡一区二区三区 | 丰满少妇久久久久久久| 成人福利在线看| 91丨porny丨中文| 日本二三区不卡| 欧美日韩午夜在线| 日韩一区二区三区观看| 亚洲精品一区二区三区99| 久久久久久久久久美女| 国产精品进线69影院| 亚洲精品一二三四区| 亚洲成人午夜影院| 经典三级在线一区| 成人aa视频在线观看| 在线亚洲一区二区| 欧美一区日韩一区| 国产午夜精品一区二区三区四区| 国产精品欧美一区喷水| 亚洲成a人v欧美综合天堂下载| 麻豆精品新av中文字幕| www.欧美日韩| 欧美日韩一区二区三区四区| 久久夜色精品国产欧美乱极品| 中文字幕高清一区| 天天av天天翘天天综合网| 久久精品国产精品亚洲精品| jizzjizzjizz欧美| 欧美老肥妇做.爰bbww| 国产午夜精品一区二区三区视频| 亚洲天堂免费看| 成人一级片网址| 欧美性感一区二区三区| 久久久亚洲精品一区二区三区 | 亚洲欧美色图小说| 天堂av在线一区| 粉嫩嫩av羞羞动漫久久久| 在线观看免费一区| 久久综合九色综合欧美就去吻| 亚洲精品免费电影| 国产乱码精品一区二区三区五月婷| 99国产精品国产精品久久| 欧美草草影院在线视频| 亚洲美女视频在线| 国产电影精品久久禁18| 欧美理论在线播放| 综合精品久久久| 精品亚洲免费视频| 欧美影片第一页| 久久久国产精华| 蜜桃视频在线观看一区二区| 91麻豆免费观看| 久久久综合网站| 免费精品视频最新在线| 欧美亚洲国产怡红院影院| 久久婷婷一区二区三区| 日韩高清中文字幕一区| 91激情五月电影| 国产精品久久久久影院| 久久99精品久久久久久| 欧美日韩午夜精品| 亚洲人午夜精品天堂一二香蕉| 乱一区二区av| 9191国产精品| 一区二区三区欧美激情| 99久久久无码国产精品| 欧美韩日一区二区三区四区| 精品一区二区三区不卡| 欧美一区二区三区视频免费播放 | 成人av网址在线观看| 久久精品在这里| 韩国av一区二区三区| 欧美一区二区三区四区在线观看| 亚洲成a人片在线观看中文| 91成人网在线| 亚洲免费观看高清完整版在线观看熊| 成人少妇影院yyyy| 国产网站一区二区三区| 国产一区二区三区香蕉| 日韩欧美一区在线| 美女网站在线免费欧美精品| 欧美区在线观看| 天天综合日日夜夜精品| 在线播放中文一区| 午夜精品视频在线观看| 欧美精品一二三| 午夜激情综合网| 9191久久久久久久久久久| 奇米四色…亚洲| 欧美一区二区播放| 美女视频黄久久| 久久奇米777| 国产91在线看| 亚洲色图在线播放| 在线观看亚洲专区| 五月婷婷色综合| 欧美一区二区久久| 极品少妇xxxx精品少妇偷拍| 久久久久国产免费免费| 国产91丝袜在线播放| √…a在线天堂一区| 91黄视频在线| 午夜精品久久久久久久 | 久久精品一二三| 大尺度一区二区| 亚洲视频狠狠干| 欧美影视一区在线| 麻豆91精品91久久久的内涵| 久久久亚洲精品一区二区三区| 成人精品鲁一区一区二区| 亚洲欧美日韩国产手机在线| 精品视频999| 久久激情五月激情| 中文字幕第一区第二区| 日本精品视频一区二区三区| 日韩精品一区第一页| 久久精品人人做人人爽人人| 99久久99精品久久久久久 | 亚洲第一二三四区| 欧美xxxxx裸体时装秀| 不卡欧美aaaaa| 亚洲一级不卡视频| 26uuu国产一区二区三区| 99v久久综合狠狠综合久久| 日本系列欧美系列| 日韩av一级电影| 欧美久久一二三四区| 热久久久久久久| 欧美韩国一区二区| 欧美日韩性生活| 国产一区二区三区精品视频| 亚洲美腿欧美偷拍| 精品欧美一区二区在线观看| www.日韩大片| 免费高清不卡av| 亚洲精品老司机| 日韩精品一区在线观看| 99精品国产一区二区三区不卡| 日韩黄色一级片| 中文一区一区三区高中清不卡| 欧美日韩国产精品成人| 处破女av一区二区| 日韩电影一区二区三区四区| 国产精品乱码一区二区三区软件 | 欧洲av一区二区嗯嗯嗯啊| 久久99精品国产麻豆婷婷洗澡| 最新国产の精品合集bt伙计| 欧美不卡激情三级在线观看| 欧洲精品中文字幕| 国产不卡在线播放| 日本亚洲免费观看| 欧美日韩一区三区四区| 麻豆精品久久久| 亚洲bt欧美bt精品777| 国产精品二区一区二区aⅴ污介绍|