MigrationResourceFile.jsp 14.3 KB
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="java.io.File" %>
<%@ page import="weaver.general.GCONST" %>
<%@ page import="weaver.upgradetool.dbupgrade.upgrade.PropUtil" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.upgradetool.dbupgrade.upgrade.ToolUtil" %>
<%@ page import="java.util.LinkedHashMap" %>
<%@ page import="weaver.upgradetool.dbupgrade.upgrade.DBUpgradeProcess" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ include file="/system/upgradetoe9/DBUpgradeInit.jsp"%>
<html>
<%
    String sqlconfigpath = GCONST.getRootPath() + "system" + File.separatorChar + "upgradetoe9" + File.separatorChar + "resource" + File.separatorChar + "migration.properties";
    PropUtil propUtil = PropUtil.getInstance(sqlconfigpath);
    String filelist1="";
    String filelist2="";
    String filelist3="";
    filelist1= new String(Util.null2String(propUtil.getValues("filelist1")).getBytes(),"utf-8");
    filelist2=Util.null2String(propUtil.getValues("filelist2"));
    filelist3=Util.null2String(propUtil.getValues("filelist3"));
    String e9migrationcheckstataus=Util.null2String(propUtil.getValues("e9_migrationcheckstataus"),"0");
    String commonfile1="filesystem/layout";
    RecordSet rs=new RecordSet();
    rs.executeQuery("select filesystem from systemset");
    if(rs.next()){
        String zfilepath=Util.null2String(rs.getString("filesystem"));
        if(!"".equalsIgnoreCase(zfilepath)&&zfilepath!=null){
            commonfile1=zfilepath.replace("\\","\\\\");
        }
    }

%>
<script type="text/javascript" src="/system/upgradetoe9/js/jquery-1.8.3.min_wev8.js"></script>
<link rel="stylesheet" href="/system/upgradetoe9/css/seachBody_wev8.css" type="text/css"/>
<link type="text/css" rel="stylesheet" href="/system/upgradetoe9/css/dialog.css" />
<script type="text/javascript" src="/system/upgradetoe9/js/dialog.js"></script>
<script type="text/javascript">
    $("document").ready(function () {
    	$.ajax({
    		url:'/system/upgradetoe9/MigrationResourceFileOperation.jsp',
    		type:'post',
    		dataType: "json",
    		success:function(data){
    			$("#fileinfo").html(data.fileinfo);
    			$("#filesystem").html(data.filesystem);
    		}
    		
    	});
    });
</script>
<head>
    <title> E-cology迁移程序</title>
    <style>
        TABLE {
            FONT-SIZE: 9pt;
            FONT-FAMILY: Verdana;
        }
        BODY {
            FONT-SIZE: 9pt;
            MARGIN: 0px;
            FONT-FAMILY: Verdana;
            LIST-STYLE-TYPE: circle;
        }
        input, select, textarea {
            /*border:#e7e7e7 1px solid;*/
            vertical-align: middle;
        }

        input, select {
            line-height: 24px;
            height: 24px;
        }

        table input {
            border: 1px solid #ccc !important;
            border-radius: 3px; /* !*css3属性IE不支持*!*/
            padding: 6px 0px 5px 10px;
        }

        .progressbar {
            width: 98%;
            /* margin-left: 10%;*/
            border-radius: 7px;
            border: 1px solid #008000;
            float: left;
            -webkit-box-shadow: 3px 3px 3px #ADADAD;
            -moz-box-shadow: 3px 3px 3px #ADADAD;
            box-shadow: 3px 3px 3px #ADADAD;
        }

        .btn-primary {
            height: 25%;
            text-decoration: none;
            background: #337AB7;
            color: #f2f2f2;
            padding: 0 20px 0 20px;
            font-size: 14px;
            font-family: 微软雅黑, 宋体, Arial, Helvetica, Verdana, sans-serif;
            /*font-weight:bold;*/
            border-radius: 5px;

            -webkit-transition: all linear 0.10s;
            -moz-transition: all linear 0.10s;
            transition: all linear 0.10s;
        }

        .btn-primary:hover {
            background: #286090;
        }

        .btn-success {
            height: 25%;
            text-decoration: none;
            background: #5CB85C;
            color: #f2f2f2;
            padding: 0 20px 0 20px;
            font-size: 14px;
            font-family: 微软雅黑, 宋体, Arial, Helvetica, Verdana, sans-serif;
            /*font-weight:bold;*/
            border-radius: 5px;
        }

        .btn-success:hover {
            background: #b8b1b6;
        }

        .btn-success-disabled:hover {
            background: #5CB85C;
        }

        .btn-success-disabled {
            height: 25%;
            text-decoration: none;
            background: #b8b1b6;
            color: #f2f2f2;
            padding: 0 20px 0 20px;
            font-size: 14px;
            font-family: 微软雅黑, 宋体, Arial, Helvetica, Verdana, sans-serif;
            /*font-weight:bold;*/
            border-radius: 5px;

        }

        .e8_btn_disabled {
            border: 0px;
            cursor: pointer;
            padding-left: 0;
            padding-left: 10px;
            padding-right: 10px;
            height: 30px;
            line-height: 30px;

            background-color: #959595;
            color: white;
            width: auto;
        }

        .e8_btn_submit {
            border: 0px;
            cursor: pointer;
            padding-left: 0;
            padding-left: 10px;
            padding-right: 10px;
            height: 30px;
            line-height: 30px;

            background-color: #558ED5;
            color: white;
            width: auto;
        }

        .e8_btn_submit_hover {
            background-color: #0170C1 !important;
            color: white;
        }

        .redtextstep4{
            color: #D35026;
            font-size: 20px;

        }

        .ulliststep41{
            list-style: decimal;
            background-color: #fff3dc;
            padding-bottom: 20px;
        }
        .ulliststep41{
            list-style: none;
            line-height: 13px;
            color: red;
            font-size: 15px;
        }
        .listyle1{
            line-height: 30px;
            color: #6c6c6c;
            font-size: 15px;
        }
        .headerstep4{
            padding-top:0px;
            height: 40px;
            background-color: #f1f1f1;
        }
        .headerstep4 td{
            /*font-weight: bold;*/
            color: black;
            font-size: 16px;
        }
        .ulliststep4{
            padding-top: 10px;
            list-style: none;
            padding-bottom: 20px;
        }
        .ulliststep4{
            list-style: none;
            line-height: 30px;
            color: black;
            font-size: 15px;
        }
        a{
            text-decoration: none;
        }
    </style>

</head>
<%
%>
<jsp:include page="/system/upgradetoe9/CommonTabHead.jsp">
    <jsp:param name="mouldID" value="upgrade"/>
    <jsp:param name="step" value="<%=currentStep%>"/>
    <jsp:param name="navName" value="数据库迁移工具"/>
</jsp:include>
<table id="topTitle" cellpadding="0" cellspacing="0">
    <tr>
        <td></td>
        <td class="rightSearchSpan" style="text-align:right; width:500px!important">
            <button style="margin-right:10px;" id="scanfile" type="button" name="scanfile"  onclick="next()" class="e8_btn_submit">文件扫描</button>
            <button style="margin-right:10px;" id="next" type="button" name="next"  onclick="next1()" class="e8_btn_disabled">下一步</button>
            </button>
        </td>
    </tr>
</table>
<body style="height:100%;width:100%;">
<iframe name="downiframe" id="downiframe" src="" style="display:none" ></iframe>
<div style="width:20%;height:100%;float:left;background:#fcfcfc;">
    <jsp:include page="MigrationStep.jsp"></jsp:include>
</div>
<div style="width:80%;height:100%;float:right">
            <%--<table style="width: 98%;padding-left:1%;padding-top:1%; height: auto;" cellspacing="0" cellpadding="0" class="showtable" >--%>
            <%--<tr>--%>
                <%--<td >--%>
                    <%--<p class="redtextstep4">请手动执行下列步骤</p>--%>
                <%--</td>--%>
            <%--</tr>--%>
            <%--<tr>--%>
                <%--<td>--%>
                    <%--<ul class="ulliststep4">--%>
                        <%--<li class="listyle1">任务一:&nbsp;需要拿到源环境的HTML模板文件,放到目标对应的文件的目录下,一般文件路径为<%=commonfile1%></li>--%>
                        <%--<li class="listyle1">任务二:&nbsp;请根据HTML实际目录修改WORKFLOW_NODEHTMLLAYOUT表的syspath</li>--%>
                        <%--<li class="listyle1">任务三:&nbsp;请手动拿到E7/E8一下列表中的文件覆盖到E9文件系统中去</li>--%>
                    <%--</ul>--%>
                <%--</td>--%>
            <%--</tr>--%>
        <%--</table>--%>
            <table style="width: 98%;padding-left:1%;padding-top:1%; height:auto;" cellspacing="0" cellpadding="0" class="showtable" >
                <tr class="headerstep4" style="width:100%;height:40px;">
                    <td style="line-height:40px;float:left;">
                        <div><img src="images/sysadmin_doc_wev8.png" style="height:40px;line-height:40px;float:left"><span style="height:40px;line-height:40px;float:left">&nbsp;&nbsp;迁移文件说明</span></div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <ul class="ulliststep41" id="consoleshow1">
                            <li class="listyle1">任务一:&nbsp;需要获取到源环境的HTML模板文件,放到目标环境对应的文件目录下,详细操作请参考:
                                <a href="javascript:void(0)" onclick="downDoc('MigrationRecourceFile.doc','文件迁移操作文档.doc')">文件迁移操作文档.doc</a>
                            </li>
                            <li class="listyle1">任务二:&nbsp;请手动获取E7/E8以下列表中的文件覆盖到E9文件系统中</li>
                            <li class="listyle1" id="scanfile11"></li>
                            <li style="padding-left: 15px"><p>1.E7/E8的WEN-INF/service/里的所有xml</p></li>
                            <li style="padding-left: 15px"><p>2.目录:<%=filelist2%>下所有的文件</p></li>
                            <li style="padding-left: 15px"><p>3./WEB-INF/文件夹下的<%=filelist3%></p></li>
                        </ul>
                    </td>
                </tr>
            </table>
</div>
</body>
</html>
<script type="text/javascript">

    jQuery(document).ready(function(){
       <% if(e9migrationcheckstataus.equalsIgnoreCase("1")){%>
        $("#next").removeClass("e8_btn_disabled");
        $("#next").addClass("e8_btn_submit");
        $("#next").attr('disabled',false);
        <%}%>
    });

    function next() {
        $.ajax({
            sync:false,
            dataType:'json',
            type:'post',
            url:'MigrationResourceFileOperation.jsp',
            data:{
                'method': "ScanXMlFile"
            },
            success:function(data){
               if(data.status==1){
                   $("#scanfile").attr('disabled',true);
                   $("#scanfile").removeClass("e8_btn_submit");
                   $("#scanfile").addClass("e8_btn_disabled");
                   $("#next").removeClass("e8_btn_disabled");
                   $("#next").addClass("e8_btn_submit");
                   $("#next").attr('disabled',false);
                   $.DialogByZ.Confirm({Title: "提示", Content: "文件扫描完成",BtnL:"确定"});
               }else{
                   $("#next").removeClass("e8_btn_disabled");
                   $("#next").addClass("e8_btn_submit");
                   $("#next").attr('disabled',false);
                   $.DialogByZ.Alert({Title: "提示", Content: "用户自定义开发的文件还未迁移,请下载Ecolog文件迁移工具包进行迁移操作",BtnL:"确定"});
                   $("#scanfile11").html("任务三:&nbsp;请下载资源迁移工具包进行迁移<a href=\"javascript:void(0)\" onclick=\"downDoc2()\">Ecolog文件迁移工具包</a>");
               }
            },
            error:function () {
                $.DialogByZ.Alert({Title: "提示", Content: "用户自定义文件扫描失败",BtnL:"确定"});
                $("#checkdbdate").removeClass("e8_btn_disabled");
                $("#checkdbdate").addClass("e8_btn_submit");
                $("#checkdbdate").attr('disabled',false);
            }
        });
    }

    function next1(){
        $.ajax({
            sync:false,
            dataType:'json',
            type:'post',
            url:'MigrationResourceFileOperation.jsp',
            data:{
                'method': "initXMLToDB"
            },
            success:function(data){
                $.DialogByZ.Confirm({Title: "提示", Content: "初始化XML配置文件成功",BtnL:"确定",FunL:next2,BtnR:"取消"})
            },
            error:function () {
                $.DialogByZ.Alert({Title: "提示", Content: "初始化XML配置文件失败",BtnL:"确定"});
            }
        });
    }
    function next2(){
        $.DialogByZ.Confirm({Title: "提示", Content: "确定已手动将需要迁移的文件迁移到E9环境?",BtnL:"确定",FunL:successfun,BtnR:"取消"})
    }
    //文件下载的方法
    function downDoc() {//执行文件下载,文件实际的路径的名字,文件下载的名字
        document.getElementById("downiframe").src = "/system/upgradetoe9/resource/MigrationRecourceFile.doc";
    }
    function successfun(){
        $.ajax({
            sync:false,
            dataType:'json',
            type:'post',
            url:'MigrationMainOperation.jsp?method=updateMainStatus',
            data:{
                'currentStep': "<%=currentStep%>",
                'status': "<%=ToolUtil.EXECUTE_STATUS_FIN%>",
            },
            success:function(data){
                window.parent.location.href = "MigrationMain.jsp";
            },
            error:function () {
                $.DialogByZ.Alert({Title: "提示", Content: "无法进入下一步操作",BtnL:"确定"});
            }
        });
    }

    function downDoc2() {//执行文件下载,文件实际的路径的名字,文件下载的名字
        var url = "ScanFileDownLoadZip.jsp";
        $.ajax({
            url: url,
            async: true,
            success: function(){
                document.getElementById("downiframe").src = "/system/upgradetoe9/resource/FileMigration.zip";
            }
        });
    }
</script>