Topic
2 replies Latest Post - ‏2013-03-26T02:45:48Z by SystemAdmin
SystemAdmin
SystemAdmin
217 Posts
ACCEPTED ANSWER

Pinned topic Use Cognos Mashup to control Search prompt

‏2013-03-25T10:43:59Z |
When I am using REST language of Cognos Mashup to control Cognos Select & Search Prompt, I meet one problem here:
In Cognos, when we enter a word in search box, Cognos will return all the value related to this word back.
I don't know how to realize the same functionality by using REST of Cognos Mashup.
Does anybody know it? Pls kindly guide me, appreciate your help!
Attached is the screenshot of the problem, FYI.
Updated on 2013-03-26T02:45:48Z at 2013-03-26T02:45:48Z by SystemAdmin
  • arturr
    arturr
    9 Posts
    ACCEPTED ANSWER

    Re: Use Cognos Mashup to control Search prompt

    ‏2013-03-25T14:10:58Z  in response to SystemAdmin
    1. run the reportPrompts command on the report, e.g.
    
    <gateway>/rds/reportprompts/report/[reportID]
    


    2. the body of the response will contain important information, e.g.
    
    <body> <style>S6</style> <item> <p_srch> <id>_P288725932</id> <ref>R5</ref> <style>S5</style> <pname>product</pname> <rows>5000</rows> <mtchany>false</mtchany> <!-- 
    
    default value --> <mtchall>false</mtchall> <!-- 
    
    default value --> <showopt>false</showopt> <cname>Product</cname> </p_srch> </item> </body>
    

    you need to collect the values of id and pname.
    3. run the reprompt - a secondary command using the conversationID and other parameters gathered above adding the srchval (search string) parameter, e.g.
    
    <gateway>/rds/sessionOutput/conversationID/[conversationID]/reprompt?srchval=edge&swsID=_P288725932&pname=product&nocase=true&mtchAny=
    
    true
    


    4. the response will contain prompts and search results:
    
    <body> <style>S7</style> <item> <p_srch> <id>_P288725932</id> <ref>R6</ref> <style>S6</style> <pname>product</pname> <rows>5000</rows> <mtchany>true</mtchany> <mtchall>false</mtchall> <showopt>false</showopt> <srchval>edge</srchval> <cname>Product</cname> <selOptions> <sval> <use>Bear Edge</use> <disp>Bear Edge</disp> </sval> <sval> <use>Bear Survival Edge</use> <disp>Bear Survival Edge</disp> </sval> </selOptions> </p_srch> </item> </body>
    


    You can reprompt again with a different search string (srchval) to collect different prompts or use one of returned values and run the report.

    There is a CMS Java sample which shows how to use searchPrompt control with reportPrompt command. It uses the SOAP interface, but the general idea is this same.
    The sample can be found in <c10>/sdk/cms_samples/java/SearchPromptValue and it is installed as part of SDK installation.
    • SystemAdmin
      SystemAdmin
      217 Posts
      ACCEPTED ANSWER

      Re: Use Cognos Mashup to control Search prompt

      ‏2013-03-26T02:45:48Z  in response to arturr
      Hello arturr,

      It solved my problem! Thank you so much! I really appreciate it!!!