Reltio Connect

 View Only
  • 1.  Add custom button in Reltio UI

    Posted 03-31-2023 04:31

    Hi team,
    We want to add a custom button in reltio mdm UI and want to execute a rest api call whenever the button is clicked.Could you please let us know with a sample how to configure the same ?



    ------------------------------
    Utsa Das
    Syneos
    ------------------------------


  • 2.  RE: Add custom button in Reltio UI

    Reltio Employee
    Posted 03-31-2023 08:12

    Hi Utsa, 

    Thank you for your question! You can use the following instruction: 

    1. You need to create a custom script and upload it somewhere (e.g. s3). 
    Here is an example of such custom script (MyScript.js):

    //define button
    var html =
    "<div id='test-button' ui-actions='click'>\n" +
    "   Execute\n" +
    "</div>";
    UI.setHeight(34);
    UI.setHtml(html);
    UI.onEvent((eventType, data) => {
        //listening for an event
        if(eventType === "uiAction" && data.type === "click") {
            if (data.id === "test-button"){ 
                //sending the request
                UI.api("https://some_resource.com").then(response=>console.log(response))
            }
        }
    });
    
    
    
    

    2. You need to add custom view component configuration:
       - You need to define the list of urls, which your script calls in the action.permissions section
       - You need to define a path to the custom script file in the action.files section
    Here is an example of configuration:

    {
      "point": "com.reltio.plugins.ui.view",
      "id": "com.reltio.plugins.MyCustomButton",
      "class": "com.reltio.plugins.ui.CustomActionView",
      "action": {
        "permissions": ["https://some_resource.reltio.com"],
        "files": ["https://s3.amazonaws.com/custom-scripts/MyCustomScript.js"]
      }
    }

    3. You need to add custom view to a perspective layout.
    4. Open UI and test.





    ------------------------------
    Alexander Kirsanov
    ------------------------------



  • 3.  RE: Add custom button in Reltio UI

    Posted 04-03-2023 06:02

    Hi ,

    So if we want to call a rest API so we have to give the URL in the below section:-

    "https://some_resource.reltio.com":- please confirm .

    And also if we need to pass the authorization parameters with the rest api ,then how to pass the same ?Please let us know .



    ------------------------------
    Utsa Das
    Syneos
    ------------------------------



  • 4.  RE: Add custom button in Reltio UI

    Reltio Employee
    Posted 04-05-2023 09:45

    Hi Utsa, 
    Yes, moreover, you can use js regexp to allow subdomains/paths (e.g.  https://[^.]*\\.reltio\\.com/test/path\\?tenant=[^&]*&parameter=.*).
    All requests will contain Authorization header, you shouldn't worry about it.



    ------------------------------
    Alexander Kirsanov
    ------------------------------



  • 5.  RE: Add custom button in Reltio UI

    Posted 04-06-2023 06:18

    Hi Alex,

    We are planning to expose a recipe as an API from RIH for which we need to provide  Auth Token  in the header section to call the same.
    So I believe this will have to be explicitly provided in the API end point .Could you please help us how to provide the header ?



    ------------------------------
    Utsa Das
    Syneos
    ------------------------------



  • 6.  RE: Add custom button in Reltio UI

    Posted 04-28-2023 09:24

    Hi Alex,

    As going by the steps mentioned by you ,I have created the script and uploaded in a path .Then I have created the Custom view configuration file.Now could you please let me know how to upload this in the UI modeler as this is a new configuration file .

    Also please help me how to do the below step in the UI modeler :-

                   3. You need to add custom view to a perspective layout.



    ------------------------------
    Utsa Das
    Syneos
    ------------------------------