Cognos Analytics with Watson

 View Only
Expand all | Collapse all

RE: Dynamic Folder Opening from the customized Home Page

  • 1.  RE: Dynamic Folder Opening from the customized Home Page

    Posted Tue July 05, 2022 07:56 AM
    Edited by Anitha Royal Tue July 05, 2022 10:42 AM
    Hello all, 

    We have our customized Home Page where it lists all the User's preferred Reports, Dashboards and Folder paths . So, here can we open a folder path(shortcut link) in a single click within a switcher in 11.2 content Tabs from home landing page ? Using Folder opening extension code , folder path is mentioned statically in spec.json file  and only one folder can be done . But in our landing page we have multiple links for multiple folders which are user specific and listed in Customized landing page .
    If anybody has implemented opening a folder content from customized landing web page please share the details.

    ------------------------------
    Anitha Royal
    ------------------------------


  • 2.  RE: Dynamic Folder Opening from the customized Home Page

    Posted Wed July 06, 2022 10:32 AM

    Hi,

    you can try this javascript with corresponding  html items

    Example JS

    function openFolder(path){
    window.parent.__glassAppController.showSlideOut(
    {id: '123',
    position: 'left',
    resizable: true,
    width: '400px',
    content: {
    id: '123',
    skipAncestors: false,
    trackBreadcrumbs: true,
    showBreadcrumbs: true,
    module: 'bi/content_apps/GenericFolderWideView',
    folder: path
    }
    });

    if(debugMode != 0){
    console.log("Debug mode function openFolder");
    console.log("******************************************");
    console.log("Open folder path: " + path);
    console.log("******************************************");
    }
    }



    ------------------------------
    Zdenek Hanzal
    ------------------------------



  • 3.  RE: Dynamic Folder Opening from the customized Home Page

    Posted Fri July 08, 2022 03:01 AM
    Hello Zdenek , 

    Thank you so much for your reply , the js code provided is working fine but it renders the folder's content in left pane Slidingout ,whereas in cognos 11.2v folder content is rendering with perspective=content appended with folderID in the browser url. The rendered folder content is displayed within the switcher menu.
    Iam attaching the screenshots for reference and if any code snippet available supporting opening folder content dynamically from customized landing web page
    within the switcher  please share the details.

    Folder content in SlidingPane with the provided js code . This is for 11.1.7 v Cognos



    Folder Content rending in 11.2v Cognos analytics




    ------------------------------
    Anitha Royal
    ------------------------------



  • 4.  RE: Dynamic Folder Opening from the customized Home Page

    Posted Mon July 11, 2022 09:48 AM
    Hi Anitha,

    You can open the content perspective (positioned to a specific folder) within the switcher of the current Cognos session, with the following:

    __glassAppController.openAppView("content",{content:{tab: 'teamContent' ,folder: 'i5283286BC55B4A4FA90A44814E1A4FDF'}})

    (where the folder parameter is set to the storeId of the specific folder you want to open.)

    Similarly, you can use the openAppView method to open other perspective types in the switch as well., e.g.



    Cheers,
       Jim

    ------------------------------
    Jim Boland
    ------------------------------



  • 5.  RE: Dynamic Folder Opening from the customized Home Page

    Posted Wed July 13, 2022 02:44 AM
    Hello Jim , 

    Thank you so much for your reply, its working as expected..

    ------------------------------
    Anitha Royal
    ------------------------------



  • 6.  RE: Dynamic Folder Opening from the customized Home Page

    Posted 23 days ago
    Many thanks for this information.

    Any chance to open the runas dialog for a specific report with a similar approach? Is there any reference?

    Kind regards,
    Gerhard

    ------------------------------
    Gerhard Lang
    ------------------------------



  • 7.  RE: Dynamic Folder Opening from the customized Home Page

    IBM Champion
    Posted 22 days ago
    The Run As dialog doesn't use the slideout mechanism at all. it uses react to create the element. You'd have to replicate the functionality that's found in this file: /bi/js/admin/job/RunAsAction.js

    ------------------------------
    Paul Mendelson
    ------------------------------



  • 8.  RE: Dynamic Folder Opening from the customized Home Page

    Posted 22 days ago
    Yes, Paul is bang on - as the "Run As" dialog isn't a perspective (or a slideout)  - a different approach is required, along the lines of what he suggested. Alternatively, if there are specific reasons you want to use the "Run As"  dialog, you could also consider some alternatives:
    • If you want to run the report in the background and just save the results into content when completed, you could use a call to CMS
    • If you want to select a specific report output format (e.g. PDF vs. HTML) , you can specify this (and other parameters such as prompt values) in the call to openAppView (specifically in the value of the "content" element of the JSON in the second parameter of the openAppView call)


    ------------------------------
    Jim Boland
    ------------------------------



  • 9.  RE: Dynamic Folder Opening from the customized Home Page

    Posted 15 days ago

    Thanks Paul & Jim for your input. I thought it would be easier to do.

    Best regards,
    Gerhard



    ------------------------------
    Gerhard Lang
    ------------------------------



  • 10.  RE: Dynamic Folder Opening from the customized Home Page

    Posted 13 days ago
    Hi Jim (and group), is there a simple way for me to set the Team Content folder as a default view when a user launches Cognos?  If it makes it easier to do for a specific user group, that's fine.  I think you point out a method in your post (__glassAppController.openAppView("content",{content:{tab: 'teamContent' ,folder: 'i5283286BC55B4A4FA90A44814E1A4FDF'}}) -- but I don't understand where or how that would be applied.  I've been poking around with the SampleWelcome extension but I'm not a programmer by background.  Any pointers would be appreciated.  

    ------------------------------
    Mike Comiskey
    ------------------------------



  • 11.  RE: Dynamic Folder Opening from the customized Home Page

    IBM Champion
    Posted 13 days ago
    Hey Mike,

    Have you seen this thread? https://community.ibm.com/community/user/businessanalytics/communities/community-home/digestviewer/viewthread?GroupId=3061&MessageKey=5af6a4cb-5a8f-466c-93cd-7b99a3a11e6a&CommunityKey=6b10df83-0b3c-4f92-8b1f-1fd80d0e7e58 Try downloading the extension there, and modify the code the way Eric suggested.

    ------------------------------
    Paul Mendelson
    ------------------------------



  • 12.  RE: Dynamic Folder Opening from the customized Home Page

    Posted 13 days ago
    Hi Paul, thank you for pointing out that thread -- raising the question if I should be adding comments there instead of here?  I'm an infrequent post-er of messages [apologies] and welcome suggestions.
    I did try downloading the zip file you linked on that thread, and uploaded that to give it a try. Your version works (of course) but when I try modifying the RedirectToContent.js file as Eric described, and uploading/using that version, I'm getting a looping behavior where the screen flashes, in the right hand corner I see a 'unable to load requested view. Attempting to load home page instead.'  in-between the flashing screen...so I'm clearly fudging something.  Not a programmer by background but thought even I could handle the modification in that thread.  Didn't see any notes about how to set the view to List vs Tile, but that's less important at this point. 
    Cognos11 seems to remember my prior login view/settings so I don't know if the extension approach takes precedent over that?  In any case, thanks for your reply and time.

    ------------------------------
    Mike Comiskey
    ------------------------------