Cognos Analytics

 View Only
Expand all | Collapse all

Can we hide search path and object is in properties perspective cognos v12

  • 1.  Can we hide search path and object is in properties perspective cognos v12

    Posted Fri April 19, 2024 04:35 PM

    We have a special requirement of hiding search path and report object id from properties perspective in cognos v12

    @Paul Mendelson I hope here I can get some assistance from you. please.
    Example 

    we have a folder or report called Test in Team content. Once user clicks on properties of that object Test he will be redirected to properties perspective in V12 cognos and here I want to hide search path and object ID from normal consumer users

    please help!!!!
    #CognosAnalytics



    ------------------------------
    Pourush gupta
    ------------------------------


  • 2.  RE: Can we hide search path and object is in properties perspective cognos v12

    IBM Champion
    Posted Wed April 24, 2024 03:51 PM
      |   view attached

    Hi Pourush!

    Your best bet here is to create a CSS file that will simply load and hide the objects in question.

    Unfortunately the HTML for those elements don't provide specific selectors so we'll have to be a bit crafty with the css.

    .ca-propertiesGeneralView-label:has(#ca-propertiesGeneralView-searchPath), .ca-propertiesGeneralView-label:has(#ca-propertiesGeneralView-searchPath) + div {display:none}
    

    That should find the divs containing the searchpath, and it's immediate sibling containing the id. The problem is the URL still contains the ID, there is no easy way around that. 

    The spec.json of the extension is extremely simple:

    {
      "name": "hideSearchPathInProperties",
      "extensions": [
        {
          "perspective": "properties",
          "features": [
            {
              "id": "hideSearchPath",
              "cssStyles":["v1/ext/hideSearchPathInProperties/style.css"]
            }
          ]
        }
      ]
    }

    You can add "environment": {"groupsAndRoles": [":MyUsers"]}, " where :MyUsers is the CAMID of the group/role of users you want to hide the searchpath from. 

    {
      "name": "hideSearchPathInProperties",
      "extensions": [
        {
          "perspective": "common",
          "features": [
            {
              "id": "hideSearchPath",
              "environment": {"groupsAndRoles": [":Everyone"]},
              "cssStyles":["style.css"]
            }
          ]
        }
      ]
    }


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

    Attachment(s)



  • 3.  RE: Can we hide search path and object is in properties perspective cognos v12

    Posted Fri April 26, 2024 05:12 AM

    Hi @Paul Mendelson,

    Thank you so much for your help!!!!

    Your suggestion works as expected, but when I am trying to apply it only for Consumers or any other role then its failing(means it is applying to all the roles/groups not for mentioned role)

    spec.json

    {
      "name": "hideSearchPathInProperties",
      "extensions": [
        {
          "perspective": "common",
          "features": [
            {
              "id": "hideSearchPath",
              "cssStyles":["v1/ext/hideSearchPathInProperties/style.css"],"environment": {
                "groupsAndRoles": [
                 ":Consumers"
                ]}
            }]
        }
      ]
    }
    style.css
    .ca-propertiesGeneralView-label:has(#ca-propertiesGeneralView-searchPath), .ca-propertiesGeneralView-label:has(#ca-propertiesGeneralView-searchPath) + div {display:none}
    .ca-propertiesGeneralView-label:has(div):has(.ca-propertiesGeneralView-tooltip-icon),.ca-propertiesGeneralView-label:has(div):has(.ca-propertiesGeneralView-tooltip-icon) + div {display:none}
    .ca-propertiesGeneralView-entryOptions {display: none}
    .ca-propertiesGeneralView-modalElement:has(.ca-propertiesGeneralView-externalButton){display:none}
    .ca-propertiesGeneralView-modalElement:has(.ca-propertiesGeneralView-externalButton) + div {display:none}
    .ca-propertiesGeneralView-name:has(#ca-propertiesGeneralView-nameId) + div + div {display:none}
    Am I doing something wrong?


    ------------------------------
    Pourush gupta
    ------------------------------