index.jsp.181031 11 KB

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