Commit adc37b3d authored by pborate's avatar pborate

Updated in catalog.jsp

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@176794 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b0b401d5
......@@ -129,27 +129,54 @@ else
</style>
<script type="text/javascript">
function load()
var enterprise = 'local2do';
var siteCode = '<%=siteCode%>';
var SYS_REST_ENTRY = '/ibase/ecm/service/sys';
function loadEnterprise()
{
console.log('window loading');
var userDetailJsonStr = '<%=userDetailStr%>';
var userDetailJson = JSON.parse( userDetailJsonStr );
userDetailJson.jti = '<%=loginCode%>';
userDetailJson.profileImageLink = "/ibase/resource/images/users/" + '<%=loginCode%>' + ".png?temp=" + Math.random();;
localStorage.setItem('userInfo', JSON.stringify( userDetailJson ) );
var userDetailJsonStr = '<%=userDetailStr%>';
var userDetailJson = JSON.parse( userDetailJsonStr );
userDetailJson.jti = '<%=loginCode%>';
userDetailJson.profileImageLink = "/ibase/resource/images/users/" + '<%=loginCode%>' + ".png?temp=" + Math.random();;
localStorage.setItem('userInfo', JSON.stringify( userDetailJson ) );
var w = window.open('/ibase/ecm/<%=catalog%>/index.html?siteCode=<%=siteCode%>', '_blank');
var w = window.open('/ibase/ecm/' + enterprise + '/index.html?siteCode=<%=siteCode%>', '_blank');
if( w )
{
var hintMessage = document.getElementById('hint-message');
hintMessage.style.display = 'none';
}
var openCatalog = document.getElementById('catalog-link');
openCatalog.setAttribute('href','/ibase/ecm/<%=catalog%>/index.html?siteCode=<%=siteCode%>');
openCatalog.setAttribute('href','/ibase/ecm/' + enterprise + '/index.html?siteCode=<%=siteCode%>');
}
function postSite(path, callback)
{
var url = SYS_REST_ENTRY + path ;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && (this.status == 200 || this.status == 204))
{
console.log('onreadystatechange', this, callback);
enterprise = JSON.parse(this.response).enterPrise.trim();
console.log("the enterprise",enterprise,JSON.parse(this.response));
if (callback)
{
callback.call(this.enterprise);
}
}
};
xhttp.open("GET", url, true);
xhttp.setRequestHeader("Accept", "application/json");
xhttp.setRequestHeader('Content-Type', 'application/json')
xhttp.send();
}
</script>
</head>
<body onload='load();'>
<body onload="postSite('/site/' + siteCode, loadEnterprise);">
<div class='content'>
<a id="catalog-link" href="" target="_blank"> Open <%=catalog%> catalog </a>
<span id="hint-message" > It seems popup blocker is enabled. To access Catalog site click on above link.</span>
......
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