index.jsp_190221 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. <%@ page language="java" contentType="text/html; charset=euc-kr"%>
  2. <%
  3. String domainName = request.getScheme()+"://"+ request.getServerName() + ":" + request.getServerPort();
  4. String systemName = request.getScheme()+"_"+ request.getServerName() + "_" + request.getServerPort();
  5. // JSESSIONID 값을 가져와서 Launcher 띄울 때 넘겨준다.(서버와 컨테이너 고정용)
  6. String sessionVal = session.getId();
  7. // CDW에서 넘겨주는 값
  8. String sParam = request.getParameter("param");
  9. String titleText = "";
  10. boolean isCDW = false;
  11. // Knuh Portal 에서 넘겨주는 값 (widget=1)
  12. String sWidget = request.getParameter("widget");
  13. boolean isWidget = false;
  14. // mode에 값을 지정하여 전용 모드를 설정 (mode=hichart)
  15. String sMode = request.getParameter("mode");
  16. boolean isHiChart = false;
  17. if(sParam != null && sParam != "") {
  18. isCDW = true;
  19. } else if(sWidget != null && Integer.parseInt(sWidget) == 1) {
  20. isWidget = true;
  21. } else if("hichart".equals(sMode)) { // mode가 hichart 일때는 HiChart 전용 모드
  22. isHiChart = true;
  23. } else {
  24. titleText = "XPLauncher 를 시작합니다.";
  25. }
  26. // 서버이름 가져오기
  27. String serverName = request.getServerName();
  28. // 서버이름 별로 아이콘이름 지정하기
  29. String iconName = "로컬";
  30. // 아이콘 표시여부
  31. boolean iconShow = true;
  32. // 기관코드
  33. String sInstcd = "031";
  34. // 본원운영서버
  35. if ("hisx031.knuh.kr".equals(serverName)) // 운영
  36. {
  37. iconName = "본원";
  38. iconShow = true;
  39. sInstcd = "031";
  40. }
  41. // 본원교육서버
  42. else if("hisx031edu.knuh.kr".equals(serverName)) //교육
  43. {
  44. iconName = "본원교육";
  45. iconShow = true;
  46. sInstcd = "031";
  47. }
  48. // 칠곡운영서버
  49. else if("hisx032.knuh.kr".equals(serverName)) //운영
  50. {
  51. iconName = "칠곡";
  52. iconShow = true;
  53. sInstcd = "032";
  54. }
  55. // 칠곡교육서버
  56. else if ("hisx032edu.knuh.kr".equals(serverName)) // 교육
  57. {
  58. iconName = "칠곡교육";
  59. iconShow = true;
  60. sInstcd = "032";
  61. }
  62. // MIS운영서버
  63. else if ("misx030.knuh.kr".equals(serverName)) // 운영
  64. {
  65. iconName = "MIS";
  66. iconShow = true;
  67. sInstcd = "031";
  68. }
  69. // MIS교육서버
  70. else if ("misx030edu.knuh.kr".equals(serverName)) // 교육
  71. {
  72. iconName = "MIS교육";
  73. iconShow = true;
  74. sInstcd = "031";
  75. }
  76. // 치과운영서버
  77. else if("hisx033.knudh.kr".equals(serverName)) //운영
  78. {
  79. iconName = "치과";
  80. iconShow = true;
  81. sInstcd = "033";
  82. }
  83. // 치과교육서버
  84. else if ("hisx033edu.knudh.kr".equals(serverName)) // 교육
  85. {
  86. iconName = "치과교육";
  87. iconShow = true;
  88. sInstcd = "033";
  89. }
  90. // MIS치과운영서버
  91. else if ("misx033.knudh.kr".equals(serverName)) // 운영
  92. {
  93. iconName = "MIS";
  94. iconShow = true;
  95. sInstcd = "033";
  96. }
  97. // MIS치과교육서버
  98. else if ("misx033edu.knudh.kr".equals(serverName)) // 교육
  99. {
  100. iconName = "MIS교육";
  101. iconShow = true;
  102. sInstcd = "033";
  103. }
  104. %>
  105. <!DOCTYPE html>
  106. <HTML>
  107. <HEAD>
  108. <meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
  109. <meta http-equiv="X-UA-Compatible" content="requiresActiveX=true">
  110. <TITLE>HIMED2 Install Page</TITLE>
  111. <SCRIPT LANGUAGE="javascript">
  112. var sKey = "<%=systemName%>";
  113. var Server_Path = "<%=domainName%>";
  114. var isWebRun = false;
  115. var bOnError = false;
  116. var XPLATFORM_CAB_VER = "2017,8,29,1";
  117. var XPLATFORM_FOLDER_VER = "922180";
  118. function window::onLoad() {
  119. TFSmartUpdater.protectSystemMenu(1);
  120. }
  121. function fn_load() {
  122. if(bOnError == false) {
  123. if(setComponentsInstall()) {
  124. fn_launch();
  125. fn_close();
  126. }
  127. }
  128. }
  129. function fn_close() {
  130. if(navigator.appVersion.indexOf("MSIE 7.") >= 0 || navigator.appVersion.indexOf("MSIE 8.") >= 0 ||
  131. navigator.appVersion.indexOf("MSIE 9.") >= 0 || navigator.appVersion.indexOf("MSIE 10.") >=0 ||
  132. navigator.appVersion.indexOf("Trident") >= 0 ) {
  133. window.open('about:blank','_self').close();
  134. } else {
  135. window.opener = self;
  136. self.close();
  137. }
  138. }
  139. function checkOS()
  140. {
  141. var strOS = "";
  142. if( navigator.appVersion.indexOf("Windows NT 6.2") != -1)
  143. strOS = "WIN8";
  144. else if( navigator.appVersion.indexOf("Windows NT 6.1") != -1)
  145. strOS = "WIN7";
  146. else if( navigator.appVersion.indexOf("Windows NT 6.0") != -1)
  147. strOS = "VISTA";
  148. else if( navigator.appVersion.indexOf("Windows 98") != -1)
  149. strOS = "98";
  150. else if( navigator.appVersion.indexOf("Windows NT 5.0") != -1)
  151. strOS = "2000";
  152. else if( navigator.appVersion.indexOf("Windows NT 5.2") != -1)
  153. strOS = "XP";
  154. else if( navigator.appVersion.indexOf("Windows NT 5.1") != -1)
  155. strOS = "XP";
  156. return strOS;
  157. }
  158. function fn_objectOnError() {
  159. bOnError = true;
  160. if("<%=isCDW%>" == "true") {
  161. alert("Ku2.0이 설치되어 있지 않습니다.\nKu2.0을 먼저 설치하여 주십시오");
  162. }
  163. }
  164. function fn_launch() {
  165. XPLauncher.version = "9.2.2"; //XPLauncher 설정 상단에 위치해야 함.
  166. if(checkOS() == "WIN8")
  167. {
  168. XPLauncher.componentpath = "%USERAPPLOCAL%";
  169. } else {
  170. XPLauncher.componentpath = "%USERAPP%\\TOBESOFT\\XPLATFORM\\9.2.2\\Component";
  171. }
  172. if("<%=sessionVal%>" != "") // XPlatform 에 JSESSIONID 세션변수 전달(서버와 컨테이너 고정용)
  173. XPLauncher.globalvalue = "JSESSIONID:g=" + "<%=sessionVal%>";
  174. // CDW 에서 호출 할 때
  175. if("<%=isCDW%>" == "true") {
  176. var param = "<%=sParam%>".replace(/softcenuri.\d{2}.\d{3}:\/\//i, "");
  177. XPLauncher.globalvalue = XPLauncher.globalvalue + ",gv_CDW_PARAM:g=" + param;
  178. XPLauncher.xadl = Server_Path + "/himed/xpapps/himedrec.xadl";
  179. XPLauncher.onlyone = true;
  180. XPLauncher.loadingimage = Server_Path + "/himed/install/loading.gif";
  181. XPLauncher.splashimage = Server_Path + "/himed/install/logo" + "<%=sInstcd%>" + ".png";
  182. }
  183. // Knuh Portal 에서 호출 할 때
  184. else if("<%=isWidget%>" == "true") {
  185. XPLauncher.xadl = Server_Path + "/himed/xpapps/knuhwidget.xadl";
  186. XPLauncher.onlyone = true;
  187. XPLauncher.loadingimage = Server_Path + "/himed/install/loading_widget.gif";
  188. XPLauncher.splashimage = Server_Path + "/himed/install/logo" + "<%=sInstcd%>" + ".png";
  189. XPLauncher.makeshortcut("Knuh Portal", Server_Path + "/himed/install/widget.ico","desktop");
  190. }
  191. // Hichart 로 호출 할 때는
  192. else if("<%=isHiChart%>" == "true") {
  193. XPLauncher.key = "HC";
  194. XPLauncher.globalvalue = XPLauncher.globalvalue + ",gv_SINGLE:hichart";
  195. XPLauncher.xadl = Server_Path + "/himed/xpapps/himed_single.xadl";
  196. XPLauncher.onlyone = true;
  197. XPLauncher.loadingimage = Server_Path + "/himed/install/loading.gif";
  198. XPLauncher.splashimage = Server_Path + "/himed/install/logo" + "<%=sInstcd%>" + "_hichart.png";
  199. }
  200. // Ku2.0 에서 호출 할 때
  201. else {
  202. XPLauncher.xadl = Server_Path + "/himed/xpapps/himed2.xadl";
  203. XPLauncher.onlyone = false;
  204. XPLauncher.loadingimage = Server_Path + "/himed/install/loading.gif";
  205. XPLauncher.splashimage = Server_Path + "/himed/install/logo" + "<%=sInstcd%>" + ".png";
  206. }
  207. //alert("<%=sMode%>" + ", " + "<%=isHiChart%>");
  208. /*
  209. <% if(iconShow == true) { %>
  210. XPLauncher.makeshortcut("<%=iconName%>",Server_Path + "/himed/install/EMR.ico","desktop");
  211. <% } %>
  212. */
  213. XPLauncher.launch();
  214. }
  215. function fn_download()
  216. {
  217. location.href = "./install/TobeSoft/XPlatform_" + XPLATFORM_FOLDER_VER + "/XPLATFORM9.2.2_SetupEngine.exe";
  218. }
  219. function setComponentsInstall(){
  220. // CDW와 Knuh Portal 에서 호출 할 때는 TF 설치 안함
  221. if("<%=isCDW%>" == "true" || "<%=isWidget%>" == "true") return true;
  222. var result = false;
  223. try {
  224. //환경 변수 설정
  225. TFSmartUpdater.setCustomDir("{server}", Server_Path + "/himed/install" );
  226. TFSmartUpdater.setCustomDir("{client}", "C:\\\himed\\components" );
  227. TFSmartUpdater.setCustomDir("{systemdir}", "C:\\WINDOWS\\system32" );
  228. TFSmartUpdater.setCustomDir("{systemurl}", Server_Path + "/himed" );
  229. TFSmartUpdater.setCustomDir("{syswow64}", "C:\\WINDOWS\\SysWOW64" );
  230. var link_path = (isWebRun) ? "Link" : "Link_exe";
  231. var os_path;
  232. if(checkOS() == "XP") {
  233. os_path = "/xp";
  234. } else {
  235. if (window.navigator.userAgent.indexOf("WOW64") >= 0){
  236. os_path = "/x64";
  237. } else {
  238. os_path = "/x86";
  239. }
  240. }
  241. var path = Server_Path + "/himed/install/" + link_path + os_path;
  242. if(isWebRun) {
  243. if(navigator.appVersion.indexOf("MSIE 7.") >= 0 || navigator.appVersion.indexOf("MSIE 6.") >= 0) {
  244. TFSmartUpdater.setCustomDir("{ieoption}", "");
  245. } else {
  246. path += "/nomerge";
  247. TFSmartUpdater.setCustomDir("{ieoption}", "-nomerge ");
  248. }
  249. }
  250. TFSmartUpdater.setCustomDir("{lnkFilePath}", path);
  251. //다운받을 파일의 목록인 jsp 파일의 경로를 넣어줌...
  252. var ret = TFSmartUpdater.getConfig(Server_Path+"/himed/install/config/configXP.jsp");
  253. if (ret == true)
  254. {
  255. TFSmartUpdater.ChangeWindowState(8);
  256. result = true;
  257. }else{
  258. deleteCookie();
  259. alert( "구성요소 설치 중 오류가 발생했습니다.\n\n사용중인 브라우저를 모두 닫고 다시 시도하시기 바랍니다." );
  260. }
  261. } catch(e) {
  262. deleteCookie();
  263. alert( "TFSmartUpdater가 설치되지 않았습니다. 설치후 진행하십시오." );
  264. } finally {
  265. return result;
  266. }
  267. }
  268. // 쿠키삭제
  269. function deleteCookie()
  270. {
  271. var cookieName = "HIS";// 쿠키명은 설정 정보에서 가져도록 고치자.
  272. //쿠키 소멸 날짜를 어제 날짜로 설정한다.
  273. var expireDate = new Date();
  274. expireDate.setDate( expireDate.getDate() - 1 );
  275. setCookie(cookieName,"",expireDate,"/",".knu.ac.kr");
  276. //alert(document.cookie);
  277. }
  278. function setCookie(name, value, expires, path, domain, secure) {
  279. var curCookie = name + "=" + escape(value) +
  280. ((expires) ? "; expires=" + expires.toGMTString() : "") +
  281. ((path) ? "; path=" + path : "") +
  282. ((domain) ? "; domain=" + domain : "") +
  283. ((secure) ? "; secure" : "");
  284. document.cookie = curCookie;
  285. }
  286. function TrustFormSmartUpdater(id, codebase, width, height)
  287. {
  288. // CDW와 Knuh Portal 에서 호출 할 때는 TF 설치 안함
  289. if("<%=isCDW%>" == "true" || "<%=isWidget%>" == "true") return true;
  290. var obj="";
  291. obj=obj+ "<OBJECT id='"+id+"' CLASSID='CLSID:ED5D862B-6A06-46DE-A929-F2C588742CBD' codebase='"+codebase+"' width='"+width+"' height='"+height+"'>";
  292. obj=obj+ "<PARAM name='deleteZipFile' value='true'/>"; // zip 파일을 지운다
  293. obj=obj+ "<PARAM name='registry' value='false'/>"; // registry를 이용하지 않는다.
  294. obj=obj+ "<PARAM name='configDir' value='C:\\\himed'/>"; // config 파일이 저장될 local 경로를 설정
  295. obj=obj+ "<PARAM name='enableLog' value ='true' />"; // log를 남긴다.
  296. obj=obj+ "<PARAM name='selfUi' value ='true' />"; // 자체 UI를 이용한다.
  297. obj=obj+ "<PARAM name='dlgNotClose' value='true' />"; // UI를 하나의 dialog로 사용한다.
  298. obj=obj+ "<PARAM name='fileinuse_hidden' value='skip'/>"; // FileInUse Dialog에서 button을 hidden 할 지 여부
  299. obj=obj+ "<PARAM name='deleteLogLevel' value='1'/>"; // 로그를 value달 전까지 보관 (1은 한달동안의 로그만 보관) added by CBJ 2012.03.23
  300. obj=obj+ "</OBJECT>";
  301. document.write(obj);
  302. }
  303. function XPlatformUpdater() {
  304. var engine_install_Info = "";
  305. var launcher_install_Info = "";
  306. if("<%=isCDW%>" == "true") {
  307. engine_install_Info = "";
  308. launcher_install_Info = "";
  309. } else {
  310. var engineFilePath = "./install/TobeSoft/XPlatform_" + XPLATFORM_FOLDER_VER + "/XPLATFORM9.2.2_SetupEngine.cab#VERSION=" + XPLATFORM_CAB_VER;
  311. var launcherFilePath = "./install/TobeSoft/XPlatform_" + XPLATFORM_FOLDER_VER + "/XPLATFORM9.2.2_XPLauncher.cab#VERSION=" + XPLATFORM_CAB_VER;
  312. engine_install_Info = 'CodeBase="' + engineFilePath + '"';
  313. launcher_install_Info = 'Codebase="' + launcherFilePath + '"';
  314. }
  315. //XPLATFORM Engine
  316. document.write('<OBJECT ID="XPlatformAXCtrl" CLASSID="CLSID:FF4E5C35-06C0-4912-9046-B7A6A8B92BEB" width="0" height="0" '
  317. + engine_install_Info
  318. + '" onError="fn_objectOnError()">'
  319. + '</OBJECT>');
  320. //XPLATFORM Launcher
  321. document.write('<OBJECT ID="XPLauncher" CLASSID="CLSID:A30D5481-7381-4dd9-B0F4-0D1D37449E97" width="0" height="0" '
  322. + launcher_install_Info
  323. + '" onError="fn_objectOnError()">'
  324. + '<PARAM NAME="key" VALUE="' + sKey + '">'
  325. + '</OBJECT>');
  326. }
  327. </SCRIPT>
  328. </HEAD>
  329. <BODY onload="fn_load()">
  330. <SCRIPT LANGUAGE="JavaScript">
  331. // XPlatformUpdater
  332. <!--
  333. XPlatformUpdater();
  334. //-->
  335. // TFSmartUpdater
  336. <!--
  337. TrustFormSmartUpdater("TFSmartUpdater", Server_Path + "/himed/install/TrustForm/TFSmartUpdater_m.cab#version=2,6,4,7", "0", "0");
  338. //-->
  339. </SCRIPT>
  340. <div><%=titleText%></div>
  341. </BODY>
  342. </HTML>