Content Management and Capture

Content Management and Capture

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  opening document to browser using Content Navigator Plugin

    Posted Tue April 08, 2025 11:05 AM
    Edited by Kiran Aithagani Tue April 08, 2025 11:10 AM

    I have added a document context menu option in content navigator, using which I am invoking this java script from the Content Navigator search results. the objective is to call the /p8/getDocument and render the content in a new browser window, the function I am intending to make it work is only PDF. 

    using below code I am able to get the content and in the browser Dev Tools I can see a 200 code and binary pdf content in the response , however content navigator is giving me this pop-up instead of opening the new window and showing me the content, any idea what I am missing ?

    lang.setObject("openInBrowser", function (repository, items, callback, teamspace, resultSet, parameterMap) {
    console.log('new function to open the pdf in a new browser window');

    var requestParams = {
    template_name: "DC_IndClass",
    docid: "DC_IndClass,{FFC7F9F8-558C-45EE-9762-78D8A92A6A6D},{30A20196-0000-C216-9FEC-2BDDEB50F377}",
    repositoryId: repository.id,
    version: "released",
    objectStoreName: "OS001",
    vsId: "{30A20196-0000-C112-A939-A5870795D6DD}",
    desktop: "default"
    };

    Request.invokeService('getDocument', 'p8', requestParams,lang.hitch(this, function(response) {
          console.log(' content retrieval successful .');
    //send the response content to a new window
    window.open(response.url, "myNewWindow", "width=600,height=400");

    }));




    ------------------------------
    Kiran Aithagani
    ------------------------------



  • 2.  RE: opening document to browser using Content Navigator Plugin

    Posted Tue April 08, 2025 12:16 PM

    Is the response.url value valid?

    The /getDocument called via bookmark.jsp does not have a value for response.



    ------------------------------
    Nanda Pilaka
    IBM Content Navigator Support
    ------------------------------



  • 3.  RE: opening document to browser using Content Navigator Plugin

    Posted Tue April 08, 2025 01:04 PM
    Edited by Kiran Aithagani Tue April 08, 2025 01:05 PM

    Thought about that and commented the below line but still same pop-up, and my log statement in the requestCompleteCallback does not print to console either

    window.open(response.url,  "myNewWindow", "width=600,height=400");



    ------------------------------
    Kiran Aithagani
    ------------------------------



  • 4.  RE: opening document to browser using Content Navigator Plugin

    Posted Wed April 09, 2025 10:58 AM

    I think I found a solution, what I was doing in my example above was,  post a request and in response I was getting the binary content response, just the raw bytes and there is no avenue to render the content as it looks like the the content is directed back to the main CN window. so, what I have to do is open a child window first and post a request from that child window to /p8/getDocument endpoint. it is working as intended for a single document.



    ------------------------------
    Kiran Aithagani
    ------------------------------