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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? importjive.java

?? java servlet著名論壇源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/admin/importexport/jive/ImportJive.java,v 1.4 2004/06/27 01:20:40 skoehler Exp $
 * $Author: skoehler $
 * $Revision: 1.4 $
 * $Date: 2004/06/27 01:20:40 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2004 by MyVietnam.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info@MyVietnam.net
 *
 * @author: Igor Manic   imanic@users.sourceforge.net
 */
package com.mvnforum.admin.importexport.jive;

import java.io.File;
import java.io.IOException;
import java.util.Calendar;
import java.util.Vector;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.digester.Digester;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xml.sax.SAXException;
import com.mvnforum.MVNForumConfig;
import com.mvnforum.admin.CategoryXML;
import com.mvnforum.admin.ImportWebHelper;
import com.mvnforum.admin.importexport.SetParentRule;
import net.myvietnam.mvncore.exception.*;

/**
 * @author <a href="mailto:imanic@users.sourceforge.net">Igor Manic</a>
 * @version $Revision: 1.4 $, $Date: 2004/06/27 01:20:40 $
 * <br/>
 * <code>ImportJive</code> class encapsulates processing
 * of Jive's XMLs, and imports all the data into MVN Forum database.
 * For details see {@link #importXml(File, HttpServletRequest, HttpServletResponse, int, String, Calendar, String, boolean, Vector, int)}
 * <br/>
 * This class cannot be instantiated.
 */
public class ImportJive extends ImportWebHelper {

    /** Message log. */
    private static Log log = LogFactory.getLog(ImportJive.class);

    /** Cannot instantiate. */
    private ImportJive() {
    }


// =================================================================
// ===================== MAIN PUBLIC METHODS =======================
// =================================================================
    /**
     * This method performs processing of Jive's XML backup file <code>importFile</code>
     * and imports the data into the MVN Forum system. It clears the database
     * and files, does neccessary setup (including startup of message output),
     * and calls {@link #processXml(File, Calendar)} to do actual processing.<br/>
     *
     * @param importFile Jive XML file to be imported.
     * @param request Current session's <code>HttpServletRequest</code> object.
     * @param response Current session's <code>HttpServletResponse</code> object.
     * @param logonMemberID MemberID of user who is logged in, and who initiated import process.
     * @param logonMemberName MemberName of user who is logged in, and who initiated import process.
     * @param importTime The moment when import process was started.
     * @param importIP From this IP address admin requested import.
     * @param clearIfError Should it clear/reset the database in case of error.
     * @param otherFieldValues Vector of name/value pairs of other form fields (like
     *                         <code>RootCategory</code>, <code>ForumPasswords</code>)
     * @param messageLevel What messages should be written to output during the process.
     *                     For details see {@link com.mvnforum.MVNForumConstant#MESSAGE_LEVEL_ALL_MESSAGES},
     *                     {@link com.mvnforum.MVNForumConfig#MESSAGE_LEVEL_IMPORTANT_MESSAGES} and
     *                     {@link com.mvnforum.MVNForumConfig#MESSAGE_LEVEL_ONLY_ERRORS}.
     *
     * @exception ImportException If there is an error during the process. See {@link net.myvietnam.mvncore.exception.ImportException}.
     *
     */
    public static void importXml(File importFile,
          HttpServletRequest request, HttpServletResponse response,
          int logonMemberID, String logonMemberName,
          Calendar importTime, String importIP, boolean clearIfError,
          Vector otherFieldValues, int messageLevel)
    throws ImportException {
        for (int i=0; i<otherFieldValues.size()-1; i+=2) {
            String name=(String)otherFieldValues.get(i);
            String value=(String)otherFieldValues.get(i+1);
            if (name!=null) {
                if (name.equals("ForumPasswords")) JiveXML.allForumsPassword=value;
                else if (name.equals("RootCategory")) JiveXML.rootCategoryName=value;
                else if (name.equals("RootCategoryDesc")) JiveXML.rootCategoryDesc=value;
                else if (name.equals("JiveGuest")) JiveXML.guestName=value;
                else if (name.equals("JiveAdmin")) JiveXML.adminName=value;
                //else ignore
            }
        }

        try {
            response.setContentType("text/html; charset=utf-8");
            setOutputHtmlWriter(response.getWriter());
            setMessageOutputLevel(messageLevel);
            startHtml(request);
            clearDatabase();
            clearFiles(request.getSession().getServletContext());
        } catch (DatabaseException e) {
            handleFatalError("Database error while clearing previous contents.",
                             e, clearIfError, request);
        } catch (IOException e) {
            handleFatalError("I/O error while clearing previous contents.",
                             e, clearIfError, request);
        }

        try {
            processXml(importFile, importTime);
            handleSuccess(request);
        } catch (ImportException e) {
            handleFatalError(e.getMessage(), e.getException(),
                             clearIfError, request);
        } catch (IOException e) {
            handleFatalError("I/O error while reading XML file.",
                             e, clearIfError, request);
        } catch (SAXException e) {
            if (e.getException()==null) {
                handleFatalError("Error while parsing uploaded XML file.",
                                 e, clearIfError, request);
            } else {
                handleFatalError("Error while parsing uploaded XML file.",
                                 e.getException(), clearIfError, request);
            }
        } finally {
           /* Don't delete this XML since this method was maybe started from the
            * command-line, which means this file is not temporary (uploaded)
            * //if ((importFile!=null) && (importFile.exists())) importFile.delete();
            * Anyway, if neccessary, this XML will be deleted in the caller (WebHandler)
            */
        }
    }


// =================================================================
// ================== MAIN PROCESSING XML METHOD ===================
// =================================================================
    /**
     * This method performs actual processing of Jive's XML file <code>inputFile</code>
     * and imports the data into the MVN Forum system.<br/>
     * Don't use this method directly. Instead, you should use
     * {@link #importXml(File, HttpServletRequest, HttpServletResponse, int, String, Calendar, String, boolean, Vector, int)}.
     *
     * @param inputFile Jive XML file to be imported.
     * @param importTime The moment when import process was started.
     *
     * @exception IOException If there is an I/O error while processing XML file.
     * @exception SAXException If there is an error while parsing XML file.
     * @exception ImportException If there is an error while adding some default values to database.
     *
     */
    protected static void processXml(File inputFile, Calendar importTime)
    throws IOException, SAXException, ImportException {
        addImportantMessage("Starting migration of data...");

        //SAXParserFactory factory=SAXParserFactory.newInstance();
        Digester digester=new Digester();
        //should try new Digester(SAXParser), or Digester(XMLReader)
        digester.setValidating(true);
        digester.setNamespaceAware(true);


        /* =================================================================
         * This is the main part of file - XML processing rules for Digester
         * =================================================================
         *
         * note: since SetTopRule is firing the desired method at the end of
         * the XML element matching the pattern, I had to implement my own
         * SetParentRule which does exactly the same thing (calls desired
         * child's method with a parent object as an argument). The difference
         * is that it is firing the "setParent" method at the beginning of the
         * corresponding XML element, thus leaving me the chance to, for example,
         * create messages as they arrive from the XML parser, not waiting the
         * end of the whole document (!!!), because I can't add a message, unless
         * I already added it's parent messages, thread, forum and category.
         */

        /* First, I'll create root object of class JiveXML.
         * It's constructor will create default contents of the database, including
         * admin member (with MemberID=1, MemberName=JiveXML.adminName, MemberPassword="admin").
         * Later, if I find Jive's admin, I'll just rewrite this default's admin data.
         * JiveXML constructor will also create a root category,
         * to which I am going to put all forums from Jive.
         */
        digester.addObjectCreate("Jive", JiveXML.class);
        digester.addSetProperties("Jive", "xmlversion", "jiveXmlVersion");
        digester.addSetProperties("Jive", "exportDate", "jiveExportDate");


        /* For each Jive user, create MVN Forum member. */
        digester.addObjectCreate("Jive/UserList/User", JiveUserXML.class);
        //todo Igor: check what this is about: digester.addSetProperties("Jive/UserList/User", "id", "userId");
        digester.addCallMethod("Jive/UserList/User", "addJiveUser", 9);
        digester.addCallParam("Jive/UserList/User/Username", 0);
        digester.addCallParam("Jive/UserList/User/Password", 1);
        digester.addCallParam("Jive/UserList/User/Email", 2);
        digester.addCallParam("Jive/UserList/User/Email", 3, "visible");
        digester.addCallParam("Jive/UserList/User/Name", 4);
        digester.addCallParam("Jive/UserList/User/Name", 5, "visible");
        digester.addCallParam("Jive/UserList/User/CreationDate", 6);
        digester.addCallParam("Jive/UserList/User/ModifiedDate", 7);
        digester.addCallParam("Jive/UserList/User/RewardPoints", 8);
        ImportJive.addMessage("All Jive/UserList/User/PropertyList/Property will be ignored.");


        /* For each Jive group, create MVN Forum group.
         * -> Jive/GroupList/Group/PropertyList/Property is not imported
         * -> Jive/GroupList/Group/AdministratorList/Username - only the
         *    first one will be imported (as GroupOwner)
         */
        digester.addObjectCreate("Jive/GroupList/Group", JiveGroupXML.class);
        /* addJiveGroup will be fired at the end of the <Group> XML element. */
        digester.addCallMethod("Jive/GroupList/Group", "addJiveGroup");
        //todo Igor: check what this is about: digester.addSetProperties("Jive/GroupList/Group", "id", "groupId");
        digester.addCallMethod("Jive/GroupList/Group/Name", "setGroupName", 0);
        digester.addCallMethod("Jive/GroupList/Group/Description", "setGroupDescription", 0);
        digester.addCallMethod("Jive/GroupList/Group/CreationDate", "setGroupCreationDate", 0);
        digester.addCallMethod("Jive/GroupList/Group/ModifiedDate", "setGroupModifiedDate", 0);
        digester.addCallMethod("Jive/GroupList/Group/AdministratorList/Username", "setGroupOwnerName", 0);
        ImportJive.addMessage("All Jive/GroupList/Group/PropertyList/Property will be ignored.");
        ImportJive.addMessage("All Jive/GroupList/Group/AdministratorList/Username will be ignored, except for the first one (to become GroupOwner).");

        /* addJiveGroupMember must first call addJiveGroup to create this group,
         * since it's not yet created (didn't get to the end of the <Group> XML element).
         */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩欧美在线一区| 国产精品激情偷乱一区二区∴| 日韩欧美亚洲一区二区| 精品国产凹凸成av人网站| 国产亚洲综合av| 亚洲综合色噜噜狠狠| 蜜臀av性久久久久蜜臀aⅴ| 国产精品99久久久久久宅男| 99精品久久免费看蜜臀剧情介绍| 欧美日韩一区小说| 久久久精品国产免大香伊| 一区二区久久久久久| 精品一区二区三区的国产在线播放| 东方aⅴ免费观看久久av| 欧美日韩一级黄| 国产情人综合久久777777| 亚洲自拍与偷拍| 国产二区国产一区在线观看| 欧美日本一道本| 中文幕一区二区三区久久蜜桃| 香蕉成人啪国产精品视频综合网| 国产丶欧美丶日本不卡视频| 欧美日韩国产成人在线91| 国产亚洲精品aa| 日韩精品电影在线| 91丨九色丨蝌蚪富婆spa| 精品剧情v国产在线观看在线| 亚洲男人的天堂在线观看| 免费观看成人av| 在线亚洲一区二区| 国产日韩视频一区二区三区| 婷婷国产v国产偷v亚洲高清| www.欧美色图| 精品卡一卡二卡三卡四在线| 亚洲成人一区二区在线观看| av亚洲精华国产精华精华| 日韩精品中文字幕一区二区三区| 亚洲精选一二三| www.亚洲激情.com| 久久久精品综合| 日韩av一区二区三区四区| 色婷婷综合激情| 国产女同互慰高潮91漫画| 免费看欧美女人艹b| 欧美日韩色一区| 亚洲欧洲日韩女同| 国产成人午夜精品影院观看视频 | 亚洲欧美中日韩| 国产综合久久久久久鬼色| 欧美精品视频www在线观看| 日韩一区有码在线| 成人综合在线网站| 精品国产露脸精彩对白 | 8x福利精品第一导航| 亚洲欧美另类小说| 99视频超级精品| 国产精品乱人伦| 国产成人8x视频一区二区| 国产亚洲精品久| 国产激情视频一区二区在线观看| 日韩精品一区国产麻豆| 男女视频一区二区| 日韩午夜在线播放| 美女在线一区二区| 日韩欧美激情一区| 免费不卡在线视频| 日韩一级二级三级精品视频| 石原莉奈在线亚洲二区| 制服丝袜亚洲色图| 日本欧美肥老太交大片| 欧美一区二区三区色| 日日摸夜夜添夜夜添国产精品 | 五月综合激情网| 欧美三片在线视频观看| 无吗不卡中文字幕| 制服视频三区第一页精品| 天天亚洲美女在线视频| 91精品麻豆日日躁夜夜躁| 天堂va蜜桃一区二区三区| 日韩欧美一区电影| 激情综合色综合久久| 久久久国产精品午夜一区ai换脸| 国产成人午夜电影网| 国产精品色婷婷久久58| 一本色道久久综合狠狠躁的推荐| 一区二区三区在线观看网站| 欧美三级中文字幕在线观看| 日本成人在线看| 337p粉嫩大胆噜噜噜噜噜91av| 国产一区二区三区久久悠悠色av | 国产91精品一区二区麻豆网站| 国产日本欧洲亚洲| 色丁香久综合在线久综合在线观看| 亚洲一区日韩精品中文字幕| 欧美群妇大交群的观看方式| 蜜臂av日日欢夜夜爽一区| 国产亚洲1区2区3区| aaa国产一区| 亚洲大片精品永久免费| 精品日韩一区二区三区免费视频| 国产一区二区伦理片| 亚洲视频一区二区免费在线观看| 亚洲欧洲另类国产综合| 久久久美女艺术照精彩视频福利播放| 欧美三区在线视频| 成人小视频在线观看| 亚洲一区二区三区四区在线观看 | 欧美极品少妇xxxxⅹ高跟鞋| 91福利国产精品| 色综合 综合色| 欧美性猛交xxxx乱大交退制版| 99精品国产99久久久久久白柏| 成人av电影在线| 成人黄色在线网站| 久久99久久精品欧美| 日韩中文字幕麻豆| 国产在线乱码一区二区三区| 日韩av电影一区| 毛片不卡一区二区| 国产精品白丝jk黑袜喷水| 麻豆精品视频在线观看视频| 福利电影一区二区| 麻豆国产欧美日韩综合精品二区| 看电影不卡的网站| 麻豆精品久久精品色综合| 久久99久久99| 国产在线播精品第三| 精品一区二区三区免费观看| 国产激情视频一区二区三区欧美| 麻豆精品一区二区| 秋霞电影网一区二区| 视频一区视频二区中文字幕| 国产成人免费视频一区| 4hu四虎永久在线影院成人| 日韩区在线观看| 久久久不卡网国产精品一区| 亚洲欧洲美洲综合色网| 国产黄色精品网站| 99久久久国产精品免费蜜臀| 欧美色综合网站| 日日欢夜夜爽一区| 欧美性猛交一区二区三区精品| 日韩一区二区三区免费看| 蜜桃视频在线观看一区二区| 精品视频一区三区九区| 欧美日韩精品一区二区天天拍小说 | 日韩精品电影在线观看| 国产精品视频yy9299一区| 日韩美女主播在线视频一区二区三区| 91热门视频在线观看| 国产精品一级黄| 久久丁香综合五月国产三级网站| 亚洲一区免费观看| 国产精品国产三级国产aⅴ原创 | 国产一区二区三区观看| 亚洲va在线va天堂| 亚洲欧美日韩中文播放| 国产区在线观看成人精品| 欧美电影精品一区二区| 欧美四级电影网| 色婷婷综合久久久中文一区二区| 成人不卡免费av| 国产成人精品免费| 激情综合色综合久久| 精品一区二区三区在线观看国产 | 91麻豆精品91久久久久久清纯| 日本韩国精品在线| 91网站视频在线观看| 成人永久看片免费视频天堂| 国产综合成人久久大片91| 美女看a上一区| 久久精品久久99精品久久| 日韩精品免费视频人成| 石原莉奈在线亚洲二区| 亚洲18影院在线观看| 亚洲成人综合网站| 亚洲成人动漫在线观看| 午夜精品久久一牛影视| 午夜免费久久看| 天天av天天翘天天综合网| 午夜精品国产更新| 日韩经典中文字幕一区| 日本亚洲天堂网| 蜜臀精品一区二区三区在线观看 | 日韩欧美激情在线| 欧美电影免费观看高清完整版在线| 日韩一区二区高清| 日韩免费一区二区| 久久色中文字幕| 国产欧美日韩亚州综合| 中文字幕av资源一区| 国产精品视频在线看| 中文字幕亚洲精品在线观看| 1区2区3区精品视频| 亚洲精品自拍动漫在线| 亚洲一区在线观看免费观看电影高清| 亚洲午夜精品17c| 日韩精品一级二级| 国产在线播精品第三| av在线一区二区三区|