rexpert.js 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  1. // version information
  2. var rex_gsVersion = "2.5.1.20090213";
  3. // setting information
  4. var rex_goTotalParam = null;
  5. var rex_goTotalSubParam = null;
  6. var rex_goRptMainParam = null;
  7. var rex_goRptSubParams = null;
  8. var rex_goRptMultiParam = null;
  9. var rex_goRptMainParamList = new Array(); // blueeye
  10. var rex_goRptMainParamListIndex = 0; // blueeye
  11. var rex_goRptMainParamInfoList = new Array();
  12. var rex_goUserWindow;
  13. var rex_goRexCtl;
  14. var rex_goMainReport;
  15. var rex_goMainDataSet;
  16. // print status
  17. var rex_gsPrintStatus = "false";
  18. // print status
  19. //var rex_gsEndLoadReportStatus = "false";
  20. // Method for Gethering SubReport-Data
  21. var rex_gsGetSubReportData = "once"; // once or each
  22. // Method for Sharing Parameter
  23. var rex_gsRptParamShare = "share"; // share or each
  24. // Method for Matching Parameter
  25. var rex_gsRptParamMatch = "name"; // index or name
  26. // DataSet CSV Separator Information
  27. var rex_gsCsvSeparatorDataset = "|@|";
  28. var rex_gsCsvSeparatorColumn = "|*|";
  29. var rex_gsCsvSeparatorRow = "";
  30. // Rexpert Web Viewer Windows Size
  31. var rex_gsPreViewType = "popup"; // newpopup, popup, popupmodal, save, print
  32. var rex_gsPreViewFeatures = "center=yes,scrollbars=no,status=no,toolbar=no,resizable=0,location=no,menu=no,width=825,height=600";
  33. var rex_gsPreViewFeaturesModal = "center:yes;resizable:no;scroll:no;status:no;dialogWidth:825px;dialogHeight:600px";
  34. // Rexpert Server Context Root
  35. var rex_gsRexServiceRootURL = rex_gfGetLocationHost() + "/RexServer_0/";
  36. // Rexpert Web Viewer
  37. var rex_gsPreViewURL = rex_gsRexServiceRootURL + "RexPreView.jsp";
  38. // rex-files(Rexpert Design Files) Location
  39. var rex_gsReportURL = rex_gsRexServiceRootURL + "rexfiles/";
  40. // Rexpert Server Broker
  41. var rex_gsRptServiceURL = rex_gsRexServiceRootURL + "RexService.jsp";
  42. // DB Conntection Information
  43. var rex_gsUserService = "";
  44. // Crypto, Crytpo algorithm and parameter
  45. //방화벽때 rex_crypto_check = true
  46. var rex_crypto_check = false;
  47. var rex_crypto_plugin = ""
  48. //var rex_crypto_plugin = "inisafeweb60.krx"
  49. //var rex_crypto_plugin = "rex_inisafeweb.js"
  50. //var rex_crypto_plugin = "rex_xecureweb.js"
  51. //var rex_crypto_plugin_param = "certificationpath=http://localhost:8080/inisafe/certification.jsp;algorithm=SEED"
  52. var rex_crypto_plugin_param = "certificationpath=" + rex_gfGetLocationHost() + "/RexServer/inisafe_certification.jsp;algorithm=SEED"
  53. var rex_crypto_encode = true;
  54. var rex_crypto_decode = true;
  55. var rex_crypto_encode_flush_count = 0; // if 0 then none else per count
  56. var rex_crypto_encode_flush_separator = "|!|";
  57. // CSV encoding=euc-kr
  58. var rex_csv_encoding = "encoding=euc-kr";
  59. // Viewer information
  60. var rex_viewer_type = "ANSI"; // ANSI or UNICODE, default=ANSI
  61. var rex_viewer_version = "2,5,1,130"; // version , comma separator
  62. var rex_viewer_install = "EACH"; // EACH or ONCE or NONE, default=EACH
  63. // Language information
  64. var rex_gsLanguage = "ko";
  65. //var rex_gsLanguage = "en";
  66. // constants
  67. // do not edit !!
  68. function rex_gfGetVersion() {
  69. return rex_gsVersion;
  70. }
  71. function rex_gfGetLocationHost()
  72. {
  73. var str = "" + document.location;
  74. var header = "http://";
  75. var header_length = header.length;
  76. var pos = str.indexOf( "/" , header_length );
  77. var str_server = str.substring( 0, pos );
  78. return str_server;
  79. }
  80. function rex_Open(sType) {
  81. // ***************************************************************
  82. // simple open
  83. // ***************************************************************
  84. //rex_Open("popup", [["rex_rptname","test"],["rptparam1", "hello"]]);
  85. //rex_Open("iframe", ifrmRexPreview, [["rex_rptname","test"],["rptparam1", "hello"]]);
  86. //rex_Open("print", [["rex_rptname","test"],["rptparam1", "hello"]]);
  87. //rex_Open("save", [["rex_rptname","test"],["rptparam1", "hello"]]);
  88. // ***************************************************************
  89. var oRptMainParamList = new Array();
  90. var sParam = "";
  91. for (var i = 1; i < arguments.length; i++) {
  92. if (sType == "iframe" && i == 1) {
  93. sParam += ", arguments[" + i + "]";
  94. continue;
  95. }
  96. var oRptMainParam;
  97. oRptMainParam = rex_GetgoDictionay();
  98. oRptMainParam.put("rex_datatype", "CSV"); // XML, CSV, XMLSTR, CSVSTR, XMLFILE, CSVFILE
  99. for (var j = 0; j < arguments[i].length; j++) {
  100. oRptMainParam.put(arguments[i][j][0], arguments[i][j][1]);
  101. }
  102. oRptMainParamList.push(oRptMainParam);
  103. }
  104. for (var i = 0; i < oRptMainParamList.length; i++) {
  105. sParam += ", oRptMainParamList[" + i + "]";
  106. }
  107. eval("rex_gfRexRptOpen(sType" + sParam + ")");
  108. }
  109. function rex_gfRexRptOpen(sType) {
  110. /* 작업중...
  111. if (typeof(arguments[arguments.length - 1]) == "string") {
  112. if (rex_goTotalParam == null) {
  113. rex_goTotalParam = new rex_goDictionary();
  114. }
  115. rex_goTotalSubParam = new rex_goDictionary();
  116. }
  117. */
  118. /* */
  119. //if (rex_gsEndLoadReportStatus != "false") {
  120. //alert("레포트를 여는 중입니다..");
  121. // return;
  122. //}
  123. //if (goPopWin != null) {
  124. // if (goPopWin.document.readyState != "complete") return;
  125. //}
  126. //rex_gsEndLoadReportStatus = "true";
  127. /* */
  128. rex_goRptMainParam = null;
  129. rex_goRptSubParams = null;
  130. rex_goRptMultiParam = null;
  131. var sParam = "";
  132. for (i = 1; i < arguments.length; i++) {
  133. sParam += "arguments[" + i + "]";
  134. if (i < arguments.length -1) {
  135. sParam += ",";
  136. }
  137. }
  138. rex_gsPreViewType = sType;
  139. if (sType == "popup") {
  140. eval("rex_gfRexRptOpenPopup(" + sParam + ")");
  141. } else if (sType == "newpopup") {
  142. eval("rex_gfRexRptOpenPopup(" + sParam + ")");
  143. } else if (sType == "popupmodal") {
  144. eval("rex_gfRexRptOpenPopupModal(" + sParam + ")");
  145. } else if (sType == "iframe") {
  146. eval("rex_gfRexRptOpenIframe(" + sParam + ")");
  147. } else if (sType == "print") {
  148. eval("rex_gfRexRptPrint(" + sParam + ")");
  149. } else if (sType == "printpush") { // blueeye
  150. eval("rex_gfRexRptPrintPush(" + sParam + ")");
  151. } else if (sType == "printall") { // blueeye
  152. eval("rex_gfRexRptPrintAll(" + sParam + ")");
  153. } else if (sType == "save") {
  154. eval("rex_gfRexRptSave(" + sParam + ")");
  155. } else if (sType == "savepush") {
  156. eval("rex_gfRexRptSavePush(" + sParam + ")");
  157. } else if (sType == "saveall") {
  158. eval("rex_gfRexRptSaveAll(" + sParam + ")");
  159. } else if (sType == "iframepush") {
  160. eval("rex_gfRexRptIframePush(" + sParam + ")");
  161. } else if (sType == "iframeall") {
  162. eval("rex_gfRexRptIframeAll(" + sParam + ")");
  163. }
  164. }
  165. var goPopWin = null;
  166. // open preview
  167. function rex_gfRexRptOpenPopup(oRptMainParam) {
  168. rex_goRptMainParam = oRptMainParam;
  169. if (rex_goRptMainParam.get("rex_init_end") != null) {
  170. rex_goRptMainParam.InitEnd = rex_gfRptInitEnd;
  171. }
  172. if (rex_goRptMainParam.get("rex_openreport_end") != null) {
  173. rex_goRptMainParam.OpenReportEnd = rex_gfRptOpenReportEnd;
  174. }
  175. if (rex_goRptMainParam.get("rex_send_end") != null) {
  176. rex_goRptMainParam.SendEnd = rex_gfRptSendEnd;
  177. }
  178. if (rex_goRptMainParam.get("rex_endload_end") != null) {
  179. rex_goRptMainParam.EndLoadEnd = rex_gfRptEndLoadEnd;
  180. }
  181. if (rex_goRptMainParam.get("rex_hyperlink_end") != null) {
  182. rex_goRptMainParam.HyperLinkEnd = rex_gfRptHyperLinkEnd;
  183. }
  184. if (rex_goRptMainParam.get("rex_print_end") != null) {
  185. rex_goRptMainParam.PrintEnd = rex_gfRptPrintEnd;
  186. }
  187. rex_goRptSubParams = new rex_goDictionary();
  188. for (i = 1; i < arguments.length; i++) {
  189. rex_goRptSubParams.put("" + i, arguments[i]);
  190. }
  191. var param = "?";
  192. if (rex_CheckCrypto().Crypto == true) {
  193. param += "rex_crypto=true&rex_crypto_plugin=" + rex_CheckCrypto().Plugin;
  194. } else {
  195. param += "rex_crypto=false";
  196. }
  197. var sWindowName = "rex_preview";
  198. if (rex_gsPreViewType == "newpopup") sWindowName = "";
  199. if (rex_goRptMainParam.get("rex_open_window") != null) {
  200. goPopWin = window.open(rex_gsPreViewURL + param, sWindowName, rex_goRptMainParam.get("rex_open_window"));
  201. } else {
  202. goPopWin = window.open(rex_gsPreViewURL + param, sWindowName, rex_gsPreViewFeatures);
  203. }
  204. }
  205. function rex_gfRexRptOpenPopupModal(oRptMainParam) {
  206. rex_goRptMainParam = oRptMainParam;
  207. if (rex_goRptMainParam.get("rex_init_end") != null) {
  208. rex_goRptMainParam.InitEnd = rex_gfRptInitEnd;
  209. }
  210. if (rex_goRptMainParam.get("rex_openreport_end") != null) {
  211. rex_goRptMainParam.OpenReportEnd = rex_gfRptOpenReportEnd;
  212. }
  213. if (rex_goRptMainParam.get("rex_send_end") != null) {
  214. rex_goRptMainParam.SendEnd = rex_gfRptSendEnd;
  215. }
  216. if (rex_goRptMainParam.get("rex_endload_end") != null) {
  217. rex_goRptMainParam.EndLoadEnd = rex_gfRptEndLoadEnd;
  218. }
  219. if (rex_goRptMainParam.get("rex_hyperlink_end") != null) {
  220. rex_goRptMainParam.HyperLinkEnd = rex_gfRptHyperLinkEnd;
  221. }
  222. if (rex_goRptMainParam.get("rex_print_end") != null) {
  223. rex_goRptMainParam.PrintEnd = rex_gfRptPrintEnd;
  224. }
  225. rex_goRptSubParams = new rex_goDictionary();
  226. for (i = 1; i < arguments.length; i++) {
  227. rex_goRptSubParams.put("" + i, arguments[i]);
  228. }
  229. var param = "?";
  230. if (rex_CheckCrypto().Crypto == true) {
  231. param += "rex_crypto=true&rex_crypto_plugin=" + rex_CheckCrypto().Plugin;
  232. } else {
  233. param += "rex_crypto=false";
  234. }
  235. if (rex_goRptMainParam.get("rex_open_window") != null) {
  236. window.showModalDialog(rex_gsPreViewURL + param, window, rex_goRptMainParam.get("rex_open_window"));
  237. } else {
  238. window.showModalDialog(rex_gsPreViewURL + param, window, rex_gsPreViewFeaturesModal);
  239. }
  240. }
  241. function rex_gfRexRptOpenIframe(oIframe, oRptMainParam) {
  242. rex_goRptMainParam = oRptMainParam;
  243. if (rex_goRptMainParam.get("rex_init_end") != null) {
  244. rex_goRptMainParam.InitEnd = rex_gfRptInitEnd;
  245. }
  246. if (rex_goRptMainParam.get("rex_openreport_end") != null) {
  247. rex_goRptMainParam.OpenReportEnd = rex_gfRptOpenReportEnd;
  248. }
  249. if (rex_goRptMainParam.get("rex_send_end") != null) {
  250. rex_goRptMainParam.SendEnd = rex_gfRptSendEnd;
  251. }
  252. if (rex_goRptMainParam.get("rex_endload_end") != null) {
  253. rex_goRptMainParam.EndLoadEnd = rex_gfRptEndLoadEnd;
  254. }
  255. if (rex_goRptMainParam.get("rex_hyperlink_end") != null) {
  256. rex_goRptMainParam.HyperLinkEnd = rex_gfRptHyperLinkEnd;
  257. }
  258. if (rex_goRptMainParam.get("rex_print_end") != null) {
  259. rex_goRptMainParam.PrintEnd = rex_gfRptPrintEnd;
  260. }
  261. rex_goRptSubParams = new rex_goDictionary();
  262. for (i = 2; i < arguments.length; i++) {
  263. rex_goRptSubParams.put("" + (i - 1), arguments[i]);
  264. }
  265. var param = "?";
  266. if (rex_CheckCrypto().Crypto == true) {
  267. param += "rex_crypto=true&rex_crypto_plugin=" + rex_CheckCrypto().Plugin;
  268. } else {
  269. param += "rex_crypto=false";
  270. }
  271. oIframe.location.href = rex_gsPreViewURL + param;
  272. }
  273. function rex_gfRexRptPrint(oRptMainParam) {
  274. rex_goRptMainParam = oRptMainParam;
  275. if (rex_goRptMainParam.get("rex_init_end") != null) {
  276. rex_goRptMainParam.InitEnd = rex_gfRptInitEnd;
  277. }
  278. if (rex_goRptMainParam.get("rex_openreport_end") != null) {
  279. rex_goRptMainParam.OpenReportEnd = rex_gfRptOpenReportEnd;
  280. }
  281. if (rex_goRptMainParam.get("rex_send_end") != null) {
  282. rex_goRptMainParam.SendEnd = rex_gfRptSendEnd;
  283. }
  284. rex_goRptSubParams = new rex_goDictionary();
  285. for (i = 1; i < arguments.length; i++) {
  286. rex_goRptSubParams.put("" + i, arguments[i]);
  287. }
  288. if (rex_goRptMainParam.get("rex_print") != null) {
  289. rex_gfRexRptPrintSetParam();
  290. } else {
  291. rex_goRptMainParam.put("rex_print", "true");
  292. }
  293. //rex_goRptMainParam.put("rex_printdirect", "false");
  294. if (rex_goRptMainParam.get("rex_print_end") != null) {
  295. rex_goRptMainParam.PrintEnd = rex_gfRptPrintEnd;
  296. }
  297. var param = "?";
  298. if (rex_CheckCrypto().Crypto == true) {
  299. param += "rex_crypto=true&rex_crypto_plugin=" + rex_CheckCrypto().Plugin;
  300. } else {
  301. param += "rex_crypto=false";
  302. }
  303. if (document.all.item("rex_ifrmRexPreview") == null) {
  304. var sHTML = "<iframe id='rex_ifrmRexPreview' src='" + rex_gsPreViewURL + param + "' width='0' height='0'></iframe>";
  305. document.body.insertAdjacentHTML("beforeEnd", sHTML);
  306. } else {
  307. rex_ifrmRexPreview.location.href = rex_gsPreViewURL + param;
  308. }
  309. }
  310. // {-- blueeye
  311. function rex_gfRexRptPrintPush(oRptMainParam) {
  312. rex_goRptMainParamList.push(oRptMainParam);
  313. }
  314. function rex_gfRexRptPrintAll() {
  315. rex_gfRexRptPrintAllEnd("","","","");
  316. }
  317. function rex_gfRexRptPrintAllEnd(oReport, oDataSet, RowCount, sFuncName) {
  318. if(rex_goRptMainParamList.length > 0 && rex_goRptMainParamList.length > rex_goRptMainParamListIndex)
  319. {
  320. var goRptMainParam = rex_goRptMainParamList[rex_goRptMainParamListIndex];
  321. if(goRptMainParam != null)
  322. {
  323. goRptMainParam.put("rex_print_end", "rex_gfRexRptPrintAllEnd");
  324. rex_gfRexRptPrint(goRptMainParam);
  325. }
  326. rex_goRptMainParamListIndex++;
  327. }
  328. else
  329. {
  330. rex_goRptMainParamListIndex = 0;
  331. rex_goRptMainParamList.length = 0
  332. }
  333. }
  334. // blueeye --}
  335. function rex_gfRexRptIframePush(oIframe, oRptMainParam) {
  336. rex_goRptMainParamList.push(oRptMainParam);
  337. rex_goRptMainParamInfoList.push(oIframe);
  338. }
  339. function rex_gfRexRptIframeAll() {
  340. rex_gfRexRptIframeAllEnd("","","");
  341. }
  342. function rex_gfRexRptIframeAllEnd(oReport, oDataSet, sFuncName) {
  343. if(rex_goRptMainParamList.length > 0 && rex_goRptMainParamList.length > rex_goRptMainParamListIndex)
  344. {
  345. var goRptMainParam = rex_goRptMainParamList[rex_goRptMainParamListIndex];
  346. var oIframe = rex_goRptMainParamInfoList[rex_goRptMainParamListIndex];
  347. if(goRptMainParam != null)
  348. {
  349. goRptMainParam.put("rex_endload_end", "rex_gfRexRptIframeAllEnd");
  350. rex_gfRexRptOpenIframe(oIframe, goRptMainParam);
  351. }
  352. rex_goRptMainParamListIndex++;
  353. }
  354. else
  355. {
  356. rex_goRptMainParamListIndex = 0;
  357. rex_goRptMainParamList.length = 0;
  358. rex_goRptMainParamInfoList.length = 0;
  359. }
  360. }
  361. function rex_gfRexRptSavePush(oRptMainParam) {
  362. rex_goRptMainParamList.push(oRptMainParam);
  363. }
  364. function rex_gfRexRptSaveAll() {
  365. rex_gfRexRptSaveAllEnd("","");
  366. }
  367. function rex_gfRexRptSaveAllEnd(sFileType, sFileName) {
  368. if(rex_goRptMainParamList.length > 0 && rex_goRptMainParamList.length > rex_goRptMainParamListIndex)
  369. {
  370. var goRptMainParam = rex_goRptMainParamList[rex_goRptMainParamListIndex];
  371. if(goRptMainParam != null)
  372. {
  373. goRptMainParam.put("rex_save_end", "rex_gfRexRptSaveAllEnd");
  374. rex_gfRexRptSave(goRptMainParam);
  375. }
  376. rex_goRptMainParamListIndex++;
  377. }
  378. else
  379. {
  380. rex_goRptMainParamListIndex = 0;
  381. rex_goRptMainParamList.length = 0;
  382. }
  383. }
  384. function rex_gfRexRptSave(oRptMainParam) {
  385. rex_goRptMainParam = oRptMainParam;
  386. if (rex_goRptMainParam.get("rex_init_end") != null) {
  387. rex_goRptMainParam.InitEnd = rex_gfRptInitEnd;
  388. }
  389. if (rex_goRptMainParam.get("rex_openreport_end") != null) {
  390. rex_goRptMainParam.OpenReportEnd = rex_gfRptOpenReportEnd;
  391. }
  392. if (rex_goRptMainParam.get("rex_send_end") != null) {
  393. rex_goRptMainParam.SendEnd = rex_gfRptSendEnd;
  394. }
  395. rex_goRptSubParams = new rex_goDictionary();
  396. for (i = 1; i < arguments.length; i++) {
  397. rex_goRptSubParams.put("" + i, arguments[i]);
  398. }
  399. rex_goRptMainParam.put("rex_save", "true");
  400. if (rex_goRptMainParam.get("rex_save_end") != null) {
  401. rex_goRptMainParam.SaveEnd = rex_gfRptSaveEnd;
  402. }
  403. var param = "?";
  404. if (rex_goRptMainParam.get("rex_crypto") != null) {
  405. param += "rex_crypto=" + rex_goRptMainParam.get("rex_crypto");
  406. } else {
  407. param += "rex_crypto=false";
  408. }
  409. if (document.all.item("rex_ifrmRexPreview") == null) {
  410. var sHTML = "<iframe id='ifrmRexPreview' src='" + rex_gsPreViewURL + param + "' width='0' height='0'></iframe>";
  411. document.body.insertAdjacentHTML("beforeEnd", sHTML);
  412. } else {
  413. rex_ifrmRexPreview.location.href = rex_gsPreViewURL + param;
  414. }
  415. }
  416. function rex_GetgoDictionay() {
  417. return new rex_goDictionary();
  418. }
  419. // javascript hashmap
  420. function rex_goDictionary() {
  421. this.nodeObject = new Object();
  422. this.put = rex_goDictionary_put;
  423. this.get = rex_goDictionary_get;
  424. this.keys = rex_goDictionary_keys;
  425. this.del = rex_goDictionary_del;
  426. this.Init = null;
  427. this.CallBack = null;
  428. this.InitEnd = null;
  429. this.OpenReportEnd = null;
  430. this.SendEnd = null;
  431. this.EndLoadEnd = null;
  432. this.HyperLinkEnd = null;
  433. this.SaveEnd = null;
  434. this.PrintEnd = null;
  435. this.length = 0;
  436. }
  437. function rex_goDictionary_put(key, value)
  438. {
  439. obj = this.nodeObject;
  440. searchFlag = 0;
  441. for(var n in obj) {
  442. if(n == key) {
  443. obj[key] = value;
  444. searchFlag = 1;
  445. }
  446. }
  447. if(searchFlag == 0) {
  448. this.length++;
  449. obj[key] = value;
  450. }
  451. }
  452. function rex_goDictionary_get(key) {
  453. obj = this.nodeObject;
  454. return obj[key];
  455. }
  456. function rex_goDictionary_keys(){
  457. return this.nodeObject;
  458. }
  459. function rex_goDictionary_del(key) {
  460. this.put(key, null);
  461. }
  462. function rex_gfRexInit(oRexCtl) {
  463. //rex_goRexCtl = oRexCtl;
  464. var sSetting = "open=1;save=0;print=1;stop=1;zoomin=1;zoomout=1;moveprev=1;movenext=1;combo=1;movefirst=1;movelast=1;help=1";
  465. rex_gfShowToolBarButton(oRexCtl, sSetting);
  466. }
  467. // ShowToolBarButton
  468. function rex_gfShowToolBarButton(oRexCtl, sSetting) {
  469. //"movelast=1;save=0"
  470. var aSetting = sSetting.split(";");
  471. for (var i = 0; i < aSetting.length; i++) {
  472. if (aSetting[i].trim() == "") continue;
  473. var aSetInfo = aSetting[i].split("=");
  474. if (aSetInfo[0].trim() == "open") {
  475. if (aSetInfo[1].trim() == "0")
  476. oRexCtl.ShowToolBarButton(0, false);
  477. else
  478. oRexCtl.ShowToolBarButton(0, true);
  479. } else if (aSetInfo[0].trim() == "save") {
  480. if (aSetInfo[1].trim() == "0")
  481. oRexCtl.ShowToolBarButton(1, false);
  482. else
  483. oRexCtl.ShowToolBarButton(1, true);
  484. } else if (aSetInfo[0].trim() == "print") {
  485. if (aSetInfo[1].trim() == "0")
  486. oRexCtl.ShowToolBarButton(2, false);
  487. else
  488. oRexCtl.ShowToolBarButton(2, true);
  489. } else if (aSetInfo[0].trim() == "stop") {
  490. if (aSetInfo[1].trim() == "0")
  491. oRexCtl.ShowToolBarButton(4, false);
  492. else
  493. oRexCtl.ShowToolBarButton(4, true);
  494. } else if (aSetInfo[0].trim() == "zoomin") {
  495. if (aSetInfo[1].trim() == "0")
  496. oRexCtl.ShowToolBarButton(7, false);
  497. else
  498. oRexCtl.ShowToolBarButton(7, true);
  499. } else if (aSetInfo[0].trim() == "zoomout") {
  500. if (aSetInfo[1].trim() == "0")
  501. oRexCtl.ShowToolBarButton(8, false);
  502. else
  503. oRexCtl.ShowToolBarButton(8, true);
  504. } else if (aSetInfo[0].trim() == "moveprev") {
  505. if (aSetInfo[1].trim() == "0")
  506. oRexCtl.ShowToolBarButton(9, false);
  507. else
  508. oRexCtl.ShowToolBarButton(9, true);
  509. } else if (aSetInfo[0].trim() == "movenext") {
  510. if (aSetInfo[1].trim() == "0")
  511. oRexCtl.ShowToolBarButton(10, false);
  512. else
  513. oRexCtl.ShowToolBarButton(10, true);
  514. } else if (aSetInfo[0].trim() == "combo") {
  515. if (aSetInfo[1].trim() == "0")
  516. oRexCtl.ShowToolBarButton(11, false);
  517. else
  518. oRexCtl.ShowToolBarButton(11, true);
  519. } else if (aSetInfo[0].trim() == "movefirst") {
  520. if (aSetInfo[1].trim() == "0")
  521. oRexCtl.ShowToolBarButton(12, false);
  522. else
  523. oRexCtl.ShowToolBarButton(12, true);
  524. } else if (aSetInfo[0].trim() == "movelast") {
  525. if (aSetInfo[1].trim() == "0")
  526. oRexCtl.ShowToolBarButton(13, false);
  527. else
  528. oRexCtl.ShowToolBarButton(13, true);
  529. } else if (aSetInfo[0].trim() == "help") {
  530. if (aSetInfo[1].trim() == "0")
  531. oRexCtl.ShowToolBarButton(14, false);
  532. else
  533. oRexCtl.ShowToolBarButton(14, true);
  534. } else if (aSetInfo[0].trim() == "tree") {
  535. if (aSetInfo[1].trim() == "0")
  536. oRexCtl.ShowToolBarButton(15, false);
  537. else
  538. oRexCtl.ShowToolBarButton(15, true);
  539. } else if (aSetInfo[0].trim() == "ToolBarVisible") {
  540. if (aSetInfo[1].trim() == "1")
  541. oRexCtl.ToolBarVisible = true;
  542. else
  543. oRexCtl.ToolBarVisible = false;
  544. } else if (aSetInfo[0].trim() == "ShowProcessDialog") {
  545. if (aSetInfo[1].trim() == "1")
  546. oRexCtl.ShowProcessDialog = true;
  547. else
  548. oRexCtl.ShowProcessDialog = false;
  549. } else if (aSetInfo[0].trim() == "ShowParameterDialog") {
  550. if (aSetInfo[1].trim() == "1")
  551. eval("oRexCtl." + aSetInfo[0].trim() + " = true");
  552. else
  553. eval("oRexCtl." + aSetInfo[0].trim() + " = false");
  554. } else {
  555. eval("oRexCtl." + aSetInfo[0].trim() + " = \"" + aSetInfo[1].trim() + "\" ");
  556. }
  557. }
  558. }
  559. // call from rex_gfRexRptPrint
  560. function rex_gfRexRptPrintSetParam() {
  561. var sSetting = rex_goRptMainParam.get("rex_print");
  562. var aSetting = sSetting.split(";");
  563. for (var i = 0; i < aSetting.length; i++) {
  564. if (aSetting[i].trim() == "") continue;
  565. var aSetInfo = aSetting[i].split("=");
  566. if (aSetInfo[0].trim() == "direct") {
  567. rex_goRptMainParam.put("rex_printdirect", aSetInfo[1].trim());
  568. } else if (aSetInfo[0].trim() == "startpage") {
  569. rex_goRptMainParam.put("rex_print_startpage", aSetInfo[1].trim());
  570. } else if (aSetInfo[0].trim() == "endpage") {
  571. rex_goRptMainParam.put("rex_print_endpage", aSetInfo[1].trim());
  572. } else if (aSetInfo[0].trim() == "count") {
  573. rex_goRptMainParam.put("rex_print_count", aSetInfo[1].trim());
  574. } else if (aSetInfo[0].trim() == "skipzero") {
  575. rex_goRptMainParam.put("rex_print_skipzero", aSetInfo[1].trim());
  576. }
  577. }
  578. rex_goRptMainParam.put("rex_print", "true");
  579. }
  580. String.prototype.trim = function() {
  581. return this.replace(/(^ *)|( *$)/g, "");
  582. }
  583. String.prototype.ltrim = function() {
  584. return this.replace(/(^ *)/g, "");
  585. }
  586. String.prototype.rtrim = function() {
  587. return this.replace(/( *$)/g, "");
  588. }
  589. function rex_gfRptInitEnd(oRexCtl, sFuncName) {
  590. eval(sFuncName + "(oRexCtl)") ;
  591. }
  592. /*
  593. function rex_gfRptOpenReportEnd(oRexCtl, oReport, sFuncName) {
  594. eval(sFuncName + "(oRexCtl, oReport)") ;
  595. }
  596. */
  597. function rex_gfRptOpenReportEnd(oReport, sFuncName) {
  598. eval(sFuncName + "(oReport)") ;
  599. }
  600. function rex_gfRptSendEnd(sReportName, oConnection, sFuncName) {
  601. eval(sFuncName + "(sReportName, oConnection)") ;
  602. }
  603. /*
  604. function rex_gfRptEndLoadEnd(oRexCtl, oReport, oDataSet, sFuncName) {
  605. eval(sFuncName + "(oRexCtl, oReport, oDataSet)") ;
  606. }
  607. */
  608. function rex_gfRptEndLoadEnd(oReport, oDataSet, sFuncName) {
  609. eval(sFuncName + "(oReport, oDataSet)") ;
  610. }
  611. /*
  612. function rex_gfRptHyperLinkEnd(oRexCtl, oReport, sLink, sToolTip, sFuncName) {
  613. eval(sFuncName + "(oRexCtl, oReport, sLink, sToolTip)") ;
  614. }
  615. */
  616. function rex_gfRptHyperLinkEnd(oReport, sLink, sToolTip, sFuncName) {
  617. eval(sFuncName + "(oReport, sLink, sToolTip)") ;
  618. }
  619. function rex_gfRptSaveEnd(sFileType, sFileName, sFuncName) {
  620. eval(sFuncName + "(sFileType, sFileName)") ;
  621. }
  622. function rex_gfRptPrintEnd(oReport, oDataSet, RowCount, sFuncName) {
  623. eval(sFuncName + "(oReport, oDataSet, RowCount)") ;
  624. }
  625. function rex_gfRexRptOpenMulti(sType, sOption) {
  626. rex_goRptMainParam = null;
  627. rex_goRptSubParams = null;
  628. rex_goRptMultiParam = null;
  629. var sParam = "";
  630. for (var i = 2; i < arguments.length; i++) {
  631. sParam += "arguments[" + i + "]";
  632. if (i < arguments.length -1) {
  633. sParam += ",";
  634. }
  635. }
  636. if (sType == "iframe") {
  637. rex_goRptMultiParam = arguments[3];
  638. }
  639. else {
  640. rex_goRptMultiParam = arguments[2];
  641. }
  642. if (sOption.trim() == "") {
  643. var i = 0;
  644. var obj = rex_goRptMultiParam.keys();
  645. for(var key in obj) {
  646. i++;
  647. if (i > 1) {
  648. rex_goRptMainParam = obj[key];
  649. break;
  650. }
  651. }
  652. } else {
  653. rex_goRptMainParam = rex_goRptMultiParam.get(sOption);
  654. }
  655. /*
  656. if (sType == "popup") {
  657. eval("rex_gfRexRptOpenPopup(" + sParam + ")");
  658. } else if (sType == "popupmodal") {
  659. eval("rex_gfRexRptOpenPopupModal(" + sParam + ")");
  660. } else if (sType == "iframe") {
  661. eval("rex_gfRexRptOpenIframe(" + sParam + ")");
  662. } else if (sType == "print") {
  663. eval("rex_gfRexRptPrint(" + sParam + ")");
  664. } else if (sType == "save") {
  665. eval("rex_gfRexRptSave(" + sParam + ")");
  666. }
  667. */
  668. if (sType == "popup") {
  669. eval("rex_gfRexRptOpenPopup(rex_goRptMainParam)");
  670. } else if (sType == "popupmodal") {
  671. eval("rex_gfRexRptOpenPopupModal(rex_goRptMainParam)");
  672. } else if (sType == "iframe") {
  673. eval("rex_gfRexRptOpenIframe(arguments[2], rex_goRptMainParam)");
  674. } else if (sType == "print") {
  675. eval("rex_gfRexRptPrint(rex_goRptMainParam)");
  676. } else if (sType == "save") {
  677. eval("rex_gfRexRptSave(rex_goRptMainParam)");
  678. }
  679. }
  680. function rex_CheckCrypto() {
  681. var bCrypto = false;
  682. var sCryptoPlugin = "";
  683. var sCryptoPluginParam = "";
  684. var bCryptoEncode = false;
  685. var bCryptoDecode = false;
  686. if (rex_goRptMainParam.get("rex_crypto") != null) {
  687. if (rex_goRptMainParam.get("rex_crypto") == "true") {
  688. bCrypto = true;
  689. }
  690. } else if (rex_crypto_check == true) {
  691. bCrypto = true;
  692. }
  693. if (rex_goRptMainParam.get("rex_crypto_plugin") != null) {
  694. sCryptoPlugin = rex_goRptMainParam.get("rex_crypto_plugin");
  695. } else if (rex_crypto_plugin != "") {
  696. sCryptoPlugin = rex_crypto_plugin;
  697. }
  698. if (rex_goRptMainParam.get("rex_crypto_plugin_param") != null) {
  699. sCryptoPluginParam = rex_goRptMainParam.get("rex_crypto_plugin_param");
  700. } else if (rex_crypto_plugin_param != "") {
  701. sCryptoPluginParam = rex_crypto_plugin_param;
  702. }
  703. if (rex_goRptMainParam.get("rex_crypto_encode") != null) {
  704. if (rex_goRptMainParam.get("rex_crypto_encode") == "true") {
  705. bCryptoEncode = true;
  706. } else {
  707. bCryptoEncode = false;
  708. }
  709. } else {
  710. bCryptoEncode = rex_crypto_encode;
  711. }
  712. if (rex_goRptMainParam.get("rex_crypto_decode") != null) {
  713. if (rex_goRptMainParam.get("rex_crypto_decode") == "true") {
  714. bCryptoDecode = true;
  715. } else {
  716. bCryptoDecode = false;
  717. }
  718. } else {
  719. bCryptoDecode = rex_crypto_decode;
  720. }
  721. return {"Crypto": bCrypto, "Plugin": sCryptoPlugin, "Param": sCryptoPluginParam, "Encode": bCryptoEncode, "Decode": bCryptoDecode, "FlushCount": rex_crypto_encode_flush_count, "Separator": rex_crypto_encode_flush_separator};
  722. }
  723. //--------------- ajax ----------------------
  724. function rex_gfGetAjaxRequest() {
  725. //if (window.XMLHttpRequest) {
  726. // IE가 아닐경우
  727. // return new XMLHttpRequest();
  728. //} else if (Window.ActiveXObject) {
  729. // IE일 경우
  730. // return new ActiveXObject("Microsoft.XMLHTTP");
  731. //return new ActiveXObject("Msxml2.XMLHTTP");
  732. //}
  733. try {
  734. obj = new XMLHttpRequest();
  735. } catch (trymicrosoft) {
  736. try {
  737. obj = new ActiveXObject("Msxml2.XMLHTTP");
  738. } catch (othermicrosoft) {
  739. try {
  740. obj = new ActiveXObject("Microsoft.XMLHTTP");
  741. } catch (failed) {
  742. obj = null;
  743. }
  744. }
  745. }
  746. return obj;
  747. }
  748. function rex_GetgoAjax() {
  749. return new rex_goAjax();
  750. }
  751. function rex_goAjax() {
  752. this.Ajax = rex_gfGetAjaxRequest();
  753. this.SetRequestHeader = rex_goAjax_SetRequestHeader;
  754. this.AddParameter = rex_goAjax_AddParameter;
  755. this.Open = rex_goAjax_Open;
  756. this.Send = rex_goAjax_Send;
  757. //this.Response = rex_goAjax_Response;
  758. this.Ajax.onreadystatechange = rex_goAjax_onreadystatechange;
  759. this.Path = "";
  760. this.Parameter = "";
  761. this.Response = rex_goAjax_Response;
  762. //this.ReturnData = "";
  763. this.Method = "POST";
  764. this.isASync = false;
  765. this.DataType = "XML";
  766. this.isShowWait = false;
  767. //this.RequestHeader = new Object();
  768. // event
  769. }
  770. function rex_goAjax_Open() {
  771. this.Ajax.open(this.Method, this.Path, this.isASync);
  772. }
  773. function rex_goAjax_SetRequestHeader(sKey, sValue) {
  774. this.Ajax.setRequestHeader(sKey, sValue);
  775. //this.Ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  776. //this.Ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
  777. //this.Ajax.setRequestHeader("Content-Type", "text/xml");
  778. }
  779. function rex_goAjax_AddParameter(sKey, sValue) {
  780. if (this.Parameter != "") this.Parameter += "&";
  781. //this.Parameter += sKey + "=" + encodeURI(sValue);
  782. sValue = sValue.replace(/%/g, "%25");
  783. sValue = sValue.replace(/\+/g, "%2B");
  784. sValue = sValue.replace(/=/g, "%3D");
  785. sValue = sValue.replace(/&/g, "%26");
  786. this.Parameter += sKey + "=" + sValue;
  787. }
  788. function rex_goAjax_Send(sParam) {
  789. //this.Ajax.send('async=true&org_id='+org_id+'&tbl_id='+tbl_id+'&lvl='+lvl+'&lang='+lang+'&curobjsn='+idx+'&obj_itm_sn='+obj_itm_sn+'&obj_var_id='+obj_var_id[idx]+'&idx='+idx+'&user=NSI&basicitem=&obj_item=13999001');
  790. if (arguments.length != 0) {
  791. this.Parameter = arguments[0];
  792. }
  793. if (this.isASync == false) {
  794. if (this.Method == "POST") {
  795. this.Ajax.send(this.Parameter);
  796. } else {
  797. this.Ajax.send("");
  798. }
  799. return;
  800. } else {
  801. window.showModalDialog("RexProgress.jsp", this, "center:yes;resizable:no;scroll:no;status:no;dialogWidth:400px;dialogHeight:300px");
  802. } // end if
  803. }
  804. function rex_goAjax_onreadystatechange() {
  805. /*
  806. if ( this.Ajax.readyState==4 )
  807. {
  808. if (this.Ajax.status == 200)
  809. {
  810. if (this.DataType == "XML") {
  811. //rex_gsAjax_ReturnData = "<?xml " + rex_goAjax.responseXML.firstChild.nodeValue + "?>" + rex_goAjax.responseXML.lastChild.xml;
  812. //rex_gsAjax_ReturnData = rex_goAjax.responseText;
  813. //this.ReturnData = rex_goAjax.responseXML.xml;
  814. } else if (this.DataType == "CSV") {
  815. //this.ReturnData = rex_goAjax.responseText;
  816. } else {
  817. //this.ReturnData = rex_goAjax.responseText;
  818. }
  819. } else { // 오류
  820. // rex_goAjax.getAllResponseHeaders()
  821. // rex_goAjax.getResponseHeader ("header name")
  822. // rex_goAjax.responseText;
  823. // rex_goAjax.responseXML
  824. // rex_goAjax.responseBody
  825. // rex_goAjax.responseStream
  826. // rex_goAjax.responseXML
  827. // rex_goAjax.status // 코드
  828. // rex_goAjax.statusText // 내용
  829. } // end if
  830. } // end if
  831. */
  832. }
  833. function rex_goAjax_Response() {
  834. if ( this.Ajax.readyState==4 )
  835. {
  836. if (this.Ajax.status == 200)
  837. {
  838. if (this.DataType == "XML") {
  839. //rex_gsAjax_ReturnData = "<?xml " + rex_goAjax.responseXML.firstChild.nodeValue + "?>" + rex_goAjax.responseXML.lastChild.xml;
  840. //rex_gsAjax_ReturnData = rex_goAjax.responseText;
  841. return this.Ajax.responseText;
  842. //return this.Ajax.responseXML.xml;
  843. } else if (this.DataType == "CSV") {
  844. return this.Ajax.responseText;
  845. } else {
  846. return this.Ajax.responseText;
  847. }
  848. } else { // 오류
  849. // rex_goAjax.getAllResponseHeaders()
  850. // rex_goAjax.getResponseHeader ("header name")
  851. // rex_goAjax.responseText;
  852. // rex_goAjax.responseXML
  853. // rex_goAjax.responseBody
  854. // rex_goAjax.responseStream
  855. // rex_goAjax.responseXML
  856. // rex_goAjax.status // 코드
  857. // rex_goAjax.statusText // 내용
  858. //return this.Ajax.rex_goAjax.statusText
  859. return "";
  860. } // end if
  861. } // end if
  862. }
  863. function rex_gfAjaxExcute(sMethod, isASync, sPath, sParam, sDataType, sRequestHeader) {
  864. var oConnection = rex_GetgoAjax();
  865. oConnection.Method = sMethod;
  866. oConnection.isASync = isASync;
  867. oConnection.Path = sPath;
  868. oConnection.DataType = sDataType;
  869. oConnection.Open();
  870. if (sRequestHeader != "") {
  871. oConnection.SetRequestHeader("Content-Type", sRequestHeader);
  872. } else {
  873. oConnection.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=EUC-KR");
  874. //oConnection.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
  875. }
  876. if (sMethod == "POST") {
  877. if (sParam != "") {
  878. oConnection.Send(sParam);
  879. } else {
  880. oConnection.Send();
  881. }
  882. } else {
  883. oConnection.Send();
  884. }
  885. return oConnection;
  886. }
  887. // ----------- ajax end --------------------