API and other questions | Leo Dashevskiy | 2014-07-23 16:59 |
Status: Closed | ||
Good day! Is there a way to programmatically: 1) in a folder of type Study add a new tab with a particular name to the tab panel: I see the link being javascript:LABKEY.Portal.addTab() but no associated public API for it Ok, upon examining the function, I see that seems like I need the following call: LABKEY.Ajax.request({ url: LABKEY.ActionURL.buildURL('admin', 'addTab'), method: 'POST', jsonData: {tabName: name}, success: function(response) { var jsonResp = LABKEY.Utils.decode(response.responseText); if (jsonResp && jsonResp.success) { ... } } 2) set the newly created tab's visibility I see the link being: http://...<encoded subfolder path>/hidePortalPage.view?pageId=<encoded page ID>&returnURL=<encoded path to go to afterwards> so this needs to be called? 3) add one of the activated modules' WebParts to this newly created, but hidden tab I see the action being: http://...<encoded subfolder path>/addWebPart.view?pageId=<encoded page ID>&location=%21content&returnUrl=<encoded path to go to afterwards>&name=<encoded WebPart name to add> This needs to be called? How? May be there are other ways of achieving what we need. We have a handful of Study folders (with more and more coming), each of which has a set of custom modules enabled, this set varies from folder to folder. Initially, in each of the folders we manually created a tab for each of the active modules and then added the corresponding web part to each of those tabs. We do not like this approach anymore, since we have lots of modules (new ones being added as we go) and the tab bar gets long and then overflows. Our idea was to create a tab 'Modules', which would have a wiki, which would dynamically generate a list of active modules as links, each link taking the user to a hidden tab with the WebPart for that particular module (hence my 3 questions above). Thanks. -Leo |
||