วันจันทร์ที่ 21 กันยายน พ.ศ. 2558

Gcoop Web App : ขั้นตอนการแก้ไขระบบเพื่อให้สามารถย้ายการติดตั้งระบบที่ Drive อื่นๆ ได้

ในที่นี่ยกตัวอย่างการแก้ไข Project Extends : PEXT

หมายเหตุ : 
1.การย้ายนั้นต้องย้ายทั้งในส่วนของ Project CORE และ Extend ด้วยไม่สามารถแยกอยู่ต่าง Drive กันได้
2.กรณีติดตั้ง IIS และ Deploy Project ไปแล้วต้องเปิด IIS และ Delete  Application และ Virtual Directory ให้หมดก่อนทำการ Edit และ Build


โดยในที่นี่ทำการติดตั้งที่ Drive D: ซึ่งโครงสร้างภายในยังคงเหมือนเดิมที่ติดตั้งที่ Drive C:

1.แก้ไข Project CORE


File :   D:\GCOOP_ALL\CORE\GCOOP\CoreSavingLibrary\WebUtil.cs

เพิ่มเติม GetGcoopRootDir()
     
        public static string GetGcoopRootDir()
        {
            return HttpContext.Current.Request.MapPath("~/").Substring(0, 1);
        }

แก้ไข GetGcoopPathCore() และ GcoopPathCore ให้เป็น
      
        public static string GetGcoopPathCore()
        {
            return  GetGcoopRootDir()+ ":\\GCOOP_ALL\\CORE\\GCOOP\\";
        }

        public static String GcoopPathCore
        {
            get
            {
                return GetGcoopPathCore();
            }
        }

File :   D:\GCOOP_ALL\CORE\GCOOP\CoreWebServiceLibrary\Security.cs


แก้ไข GetGcoopPathCore() และ GcoopPathCore ให้เป็น
       
        public String GcoopPathCore { get; set; }

ที่  private void ConstructorEnding(String wsPass, bool autoCheckPassword) ให้เพิ่ม

            this.GcoopPathCore = gcoop_path.Substring(0, 1) + ":\\GCOOP_ALL\\CORE\\GCOOP\\";
ต่อจาก
            this.GcoopPath = gcoop_path;


File :   D:\GCOOP_ALL\CORE\GCOOP\SingleSignOn\Default.aspx.cs

แก้ไขจากเดิม
           
             gcoopPath = "C:\\GCOOP_ALL\\" + vDir + "\\GCOOP\\";

เป็น

             Session["currentDir"] = HttpContext.Current.Request.MapPath("~/").Substring(0, 1);
             gcoopPath = Session["currentDir"] + ":\\GCOOP_ALL\\" + vDir + "\\GCOOP\\";

File :   D:\GCOOP_ALL\CORE\GCOOP\SingleSignOn\Login.aspx.cs

แก้ไขจากเดิม
           
             gcoopPath = "C:\\GCOOP_ALL\\" + vDir + "\\GCOOP\\";

เป็น

             Session["currentDir"] = HttpContext.Current.Request.MapPath("~/").Substring(0, 1);
             gcoopPath = Session["currentDir"] + ":\\GCOOP_ALL\\" + vDir + "\\GCOOP\\";

2.แก้ไข Project Extends : PEXT  


File :   D:\GCOOP_ALL\PEXT\GCOOP\run_ireport_builder.bat

แก้ไขจากเดิม
           
start javaw.exe -jar ..\..\CORE\GCOOP\iReport\ReportBuilderCORE\dist\ReportBuilderCORE.jar PEXT 30 C:\GCOOP_ALL CORE GCOOP

เป็น

set _SCRIPT_DRIVE=%~d0
start javaw.exe -jar ..\..\CORE\GCOOP\iReport\ReportBuilderCORE\dist\ReportBuilderCORE.jar PEXT 30 %_SCRIPT_DRIVE%\GCOOP_ALL CORE GCOOP

ไม่มีความคิดเห็น:

แสดงความคิดเห็น