Page 1 of 1
TM1Web URL API
Posted: Wed Jun 12, 2013 3:02 pm
by ardi
Hi,
I am building a TM1 Application (with Active forms and Websheets in TM1 10.1), and I have a main websheet, with an active form that shows aggregated data. One of the columns in my active form is a URL Link to another more detailed websheet, where users will enter adjustments. So basically I have one link for each row, and I pass all the Title Dimensions to the other sheet by using the title_Sn-Rn-Cn in the URL. TM1 opens the detailed websheet in a new browser, and then if I click on a different row on the main websheet, it still opens in the same browser, but it does not refresh the websheet, so the user has to click the Recalculate button on the TM1web toolbar.
I am trying to give the user a friendly way to recalculate, still with URL API, but I cannot find a way to make it work. Basically I'm trying to use the action=Recalc
in the URL but it is not doing anything. I checked the documentation, but it does not help. The only example I can see there is how to open the websheet, but not how to apply an action to a websheet that is already opened.
Has anyone of you done something like this?
Thanks a lot
Ardi
Re: TM1Web URL API
Posted: Wed Jun 12, 2013 3:22 pm
by kukuxumusu
Hi
Why don't you use action buttons to go from one sheet to another and send the context parameters?
Aude
Re: TM1Web URL API
Posted: Wed Jun 12, 2013 3:32 pm
by declanr
kukuxumusu wrote:Hi
Why don't you use action buttons to go from one sheet to another and send the context parameters?
Aude
It is much easier to present a nicely formatted solution by using hyperlinks instead of action buttons.
I do something similar to this but always close the "navigated to" websheet to take me back to the main one and then when I navigate elsewhere from it, it has to open a new screen altogether and therefore refreshes properly.
You could look at checking the recalc settings you have in your web.config file, I prefer to go with the setting that inherits each websheets "excel calc mode" as it gives a lot more control.
Re: TM1Web URL API
Posted: Wed Jun 12, 2013 3:34 pm
by ardi
Hi Aude,
The reason why I'm using URL API instead of Action Button is because I have to pass different parameters to the other sheet based on the Row (The row will have dimension elements that are different for each row and there dimension elements have to be passed dynamically to the other sheet).
Thanks
Ardi
Re: TM1Web URL API
Posted: Wed Jun 12, 2013 3:40 pm
by ardi
Hi Declan,
Actually that's what I'm trying to do also. SInce by closing the "Navigate to" sheet, the next time the user clicks on a different row, the "Navigate to" sheet will open with refreshed data. But I am trying to put the Action=Close parameter as part of a URL API Link, so the user will not have to close the browser in order to close the "Navigate to" websheet. Basically what I'm trying to do is find the way how to use the Action=Close or Action=Rebuild or any other Action and apply it to the current websheet.
Thanks
Ardi
Re: TM1Web URL API
Posted: Wed Jun 12, 2013 3:43 pm
by ardi
I am trying to find some clues in the TM1 Documentation but there is nothing in there that tells you how to apply any action (except Action=OpenObject)
http://pic.dhe.ibm.com/infocenter/ctm1/ ... amete.html
Re: TM1Web URL API
Posted: Thu Mar 12, 2015 8:44 pm
by ardi
Hi,
I was hoping IBM has made some improvement in the TM1Web URL API in the newer version, but it's worse. In 10.1, when you clicked on a URL, it opened the "Navigate To" sheet, in a new browser session, but then every other sheet opens on that same browser session. In 10.2.2, every time you click on a URL Link, the websheet openes in a new session. Is there any way to control that?
You probably have seen all my other complaints about TM1 10.2.2, I cant find anything that works better. Not to mention that if you plan to upgrade a model from prior versions to TM1 10.2, the URL API syntax has changed completely
Thanks
Re: TM1Web URL API
Posted: Thu Mar 12, 2015 11:05 pm
by lotsaram
Yes this is a frustration of mine too. Although the user isn't challenged for credentials a separate thread is created for each followed link. And when the tab is closed the session doesn't log out.
It is not good.
Re: TM1Web URL API
Posted: Fri Mar 13, 2015 6:00 am
by rmackenzie
lotsaram wrote:when the tab is closed the session doesn't log out.
I
posted a possible solution for this a couple of years ago.
I haven't gone back and tested on 10.2.x TM1 Web but I would expect it would still work. The IBM documentation/ code snippet below shows they advise it for an IFRAME - so it should be OK for a DOM event.
IBM wrote:Logging out from the Cognos TM1 Web URL API
Use the Action=Logout parameter to end the current user session with the URL API.
You apply the logout action to an iframe that is already displaying a TM1® Web object. The logout action ends the session that opened that specific TM1 Web object and also ends the session for any other URL API instances under the same session.
The Logout action uses the following format:
http://localhost:9510/tm1web/UrlApi.jsp#Action=Logout
Example
The following example ends the session that is associated with the iframe and the related TM1 Web object.
function logout() {
var baseUrl = "
http://localhost:9510/tm1web/UrlApi.jsp";
var webSheet = document.getElementById("websheetId");
webSheet.src = baseUrl + "#Action=Logout";
};
So you can just change the url variable in my example to work like the baseUrl variable in the IBM code.
I'm not clear, however, on how this acts when there's multiple windows open - if they share the same session then probably they'd all be logged out. But, you mention that you've seen separate threads created for each new link, so I'd expect that each window's onBeforeUnload event acts for that thread. It would be interesting to hear if it works for you.
Re: TM1Web URL API
Posted: Fri Mar 13, 2015 8:59 pm
by lotsaram
All well and good if the TM1 web object is embedded in a custom html page somewhere and the Action=Logout can be put in the header of that html document.
But what if it is just a pure TM1 web reference called from within a TM1 websheet with a hyperlink function to navigate to a cube view.
e.g. as per the new 10.2.2 web url syntax
Code: Select all
http://appsrv:9510/tm1web/TM1WebCubeViewerCAM.jsp?CubeName=myCube&CubeViewName=Default&ServerName=myTM1Server&HostName=appsrv&AccessType=PUBLIC
I don't see how to make the logout work for this purpose without getting a whole lot more fancy and calling a hyperlink to a custom page and passing the TM1 url api as a parameter within the main hyperlink. Then the custom webpage could have the logout function called when the browser tab is closed.
What I would like to have happen is that subsequent hyperlinks after the first one don't spawn off new threads but use the existing one.