Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
SessionReloginTimeout
superbeda
<p>Hello,</p>
<p>I want prevent session timeout from a jsapi page. I have iHub3.</p>
<p>I found this in the documentation (<a data-ipb='nomediaparse' href='
http://developer.actuate.com/be/documentation/JAVADOCS/JSAPI-iHub3/symbols/actuate.viewer.EventConstants.html#.ON_SESSION_TIMEOUT'>http://developer.actuate.com/be/documentation/JAVADOCS/JSAPI-iHub3/symbols/actuate.viewer.EventConstants.html#.ON_SESSION_TIMEOUT</a>)
, but I don't understand in which file I must set the property " <i>SessionReloginTimeout</i>".</p>
<p>Can anyone help me?</p>
Find more posts tagged with
Comments
JFreeman
<p>Preventing timeout is not something that is typically recommended since there is a login and auth id associated with the viewing of a report.</p>
<p> </p>
<p>The call you are referencing in the documentation will not prevent timeout but will instead execute an event which you can then add code to to re-login the user to establish a new session.</p>
<p> </p>
<p>I believe the session timeout for JSAPI is the same timeout used for all of iPortal. In order to modify the session timeout, you will need to adjust the value of LOGIN_TIMEOUT in the iPortal's web.xml located in the directory: ./BIRTiHub/iHub/web/iportal/WEB-INF</p>
<p> </p>
<p>By default, the value of LOGIN_TIMEOUT is 1200 seconds. After making changes, you will need to restart the iHub for the changes to take effect.</p>
superbeda
<blockquote class="ipsBlockquote" data-author="JFreeman" data-cid="138522" data-time="1439907593">
<div>
<p> </p>
<p>The call you are referencing in the documentation will not prevent timeout but will instead execute an event which you can then add code to to re-login the user to establish a new session.</p>
</div>
</blockquote>
<p>Yes, this is what I need to do.</p>
<p>In my jsapi page user/pwd are passed to the iPortal via code.</p>
<p>When the session expires, the iPortal displays the pop up dialog asking for credentials in order to re-authenticate. My end-user doesn't have any credentials to put in it.</p>
JFreeman
<p>Gotcha, it looks like the documentation needs to be updated.</p>
<p> </p>
<p>It is my understanding that the 'SessionReloginTimeout' flag is no longer used and thus does not need to be set to use the on_session_timeout call.</p>
<p> </p>
<p>You should be able to create the event with a call similar to this:</p>
<pre class="_prettyXprint _lang-js">
viewer.registerEventHandler(actuate.viewer.EventConstants.ON_SESSION_TIMEOUT, function(viewerObj){
//code to re-login/submit here.
});
</pre>
superbeda
<p>Hello Jesse Freeman,</p>
<p>I tried and It works.</p>
<p> </p>
<p>I have a custom export function:</p>
<p> </p>
<p>function customExport(format) {<br>
var renderOptions = new actuate.viewer.RenderOptions();<br>
var pageRange = "1-" + viewer.getTotalPageCount();<br><br>
if(format == "xls") {<br>
renderOptions.setOption(actuate.viewer.RenderOptions.IS_MULTISHEET, false);<br>
}<br>
viewer.downloadReport(format, pageRange, renderOptions);<br>
}</p>
<p> </p>
<p>when session is expired the jsapi page gives me the following message: <strong><em>Authentication failed; session may be expired, please close this browser.</em></strong></p>
<p>How can I prevent it? I tried also whit function actuate.isConnected(), but it returns true.</p>
JFreeman
<p>If you open your browsers debugging console, do you get a more detailed error message or stack trace?</p>
superbeda
<p>No, I haven't more details.</p>
<p>I forgot to tell you that the function customExport is call from a html button. The jsapi page contains the button and the function. They aren't in the report.</p>
JFreeman
<p>Can you attach your JSAPI page or a sample of the page that shows you create and implement the viewer as well as the HTML button setup you are using with that function?</p>
superbeda
<p><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"<br>
"<a data-ipb='nomediaparse' href='
http://www.w3.org/TR/html4/strict.dtd'>http://www.w3.org/TR/html4/strict.dtd"></a><br>
;
<html><br>
<head><br>
<META http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /><br>
<meta http-equiv="content-type" content="text/html;charset=utf-8" /><br>
<title>Viewer With Parameters Page</title><br>
<script type="text/javascript" language="JavaScript" src="<a data-ipb='nomediaparse' href='
http://myserver:8700/iportal/jsapi'>http://myserver:8700/iportal/jsapi"></script></a><br>
;
</head><br>
<body onload="init();"><br>
<table><br>
<tr><td><a href="#" id="exportExcel" onclick="customExport('xls')">Excel</a></td></tr><br>
<tr><td><div id="viewerpane" /></td></tr><br>
</table><br>
<script type="text/javascript" language="JavaScript"><br>
var viewer;<br>
var reportName = "/test.rptdocument";<br>
function init() {<br>
actuate.load("viewer");<br>
actuate.initialize("<a data-ipb='nomediaparse' href='
http://myserver:8700/iportal/'>http://myserver:8700/iportal/",</a>null,"Administrator"
, "", runReport); <br>
}<br>
function runReport() {<br>
viewer = new actuate.Viewer("viewerpane");<br>
viewer.setReportName(reportName);<br>
var myParams = {};<br>
myParams["date"] = "20150820";<br>
viewer.setParameters(myParams);<br>
<br>
viewer.setWidth(1200);<br>
viewer.setHeight(800);<br>
viewer.registerEventHandler(actuate.viewer.EventConstants.ON_SESSION_TIMEOUT, function(viewerObj){<br>
alert('my timeout');<br>
});<br>
viewer.submit();<br>
}<br>
<br>
function customExport(format) {<br>
var renderOptions = new actuate.viewer.RenderOptions();<br>
var pageRange = "1-" + viewer.getTotalPageCount();<br>
<br>
if(format == "xls") {<br>
renderOptions.setOption(actuate.viewer.RenderOptions.IS_MULTISHEET, false);<br>
}<br>
viewer.downloadReport(format, pageRange, renderOptions);<br>
}<br>
</script><br>
</body><br>
</html></p>
JFreeman
<p>Does the alert you have in the on_session_timeout trigger when you click the button and get the error?</p>
superbeda
<p>If I click on report when session is expired, the alert runs; If I click on button when session is expired, the alert doesn't run, but I have only the error: <strong><em>Authentication failed; session may be expired, please close this browser.</em></strong></p>