Commit b719fc2c authored by prumde's avatar prumde

Updated for passing ECM_TYPE and SITE_CODE to "app/index.html"

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@175129 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 41b6420a
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<head> <head>
<script type="text/javascript"> <script type="text/javascript">
var SYS_REST_ENTRY = '/ibase/ecm/service/sys'; var SYS_REST_ENTRY = '/ibase/ecm/service/sys';
var siteCode = 'L2D01';
function postSite(path, callback) function postSite(path, callback)
{ {
var url = SYS_REST_ENTRY + path; var url = SYS_REST_ENTRY + path;
...@@ -25,12 +26,12 @@ ...@@ -25,12 +26,12 @@
function loadApp() function loadApp()
{ {
window.location.href = '../app/index.html?ECM_TYPE=1'; window.location.href = '../app/index.html?ECM_TYPE=1&SITE_CODE=' + siteCode;
} }
</script> </script>
</head> </head>
<!-- Temporary Site Code paased hardcoded : L2D01 --> <!-- Temporary Site Code paased hardcoded : L2D01 -->
<body onload=" postSite('/site/L2D01', loadApp)"> <body onload=" postSite('/site/' + siteCode, loadApp)">
Loading Local2do Catalog... Loading Local2do Catalog...
</body> </body>
</html> </html>
...@@ -6,11 +6,12 @@ ...@@ -6,11 +6,12 @@
function postSite(path, callback) function postSite(path, callback)
{ {
var url = SYS_REST_ENTRY + path + siteCode; var url = SYS_REST_ENTRY + path;
var xhttp = new XMLHttpRequest(); var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() { xhttp.onreadystatechange = function() {
if (this.readyState == 4 && (this.status == 200 || this.status == 204)) if (this.readyState == 4 && (this.status == 200 || this.status == 204))
{ {
console.log('onreadystatechange', this, callback);
if (callback) if (callback)
{ {
callback.call(); callback.call();
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
function loadApp() function loadApp()
{ {
window.location.href = '../app/index.html?ECM_TYPE=3'; window.location.href = '../app/index.html?ECM_TYPE=3&SITE_CODE=' + siteCode;
} }
function get(name) function get(name)
...@@ -37,7 +38,7 @@ ...@@ -37,7 +38,7 @@
} }
</script> </script>
</head> </head>
<body onload=" postSite('/site/', loadApp)"> <body onload=" postSite('/site/' + siteCode, loadApp)">
Loading Purchase Catalog... Loading Purchase Catalog...
</body> </body>
</html> </html>
...@@ -6,11 +6,12 @@ ...@@ -6,11 +6,12 @@
function postSite(path, callback) function postSite(path, callback)
{ {
var url = SYS_REST_ENTRY + path + siteCode; var url = SYS_REST_ENTRY + path;
var xhttp = new XMLHttpRequest(); var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() { xhttp.onreadystatechange = function() {
if (this.readyState == 4 && (this.status == 200 || this.status == 204)) if (this.readyState == 4 && (this.status == 200 || this.status == 204))
{ {
console.log('onreadystatechange', this, callback);
if (callback) if (callback)
{ {
callback.call(); callback.call();
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
function loadApp() function loadApp()
{ {
window.location.href = '../app/index.html?ECM_TYPE=2'; window.location.href = '../app/index.html?ECM_TYPE=2&SITE_CODE=' + siteCode;
} }
function get(name) function get(name)
...@@ -37,7 +38,7 @@ ...@@ -37,7 +38,7 @@
} }
</script> </script>
</head> </head>
<body onload=" postSite('/site/', loadApp)"> <body onload=" postSite('/site/' + siteCode, loadApp)">
Loading Sales Catalog... Loading Sales Catalog...
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment