Integration of smart ui widget in external application

JaKar
edited April 21, 2023 in Smart View #1

Hello community,

do you have any experience with integrating random Smart Ui widgets in an external application? We are going to investigate the topic quite a little bit, so I am looking also for someone to share the knowledge with. Just let me know. Thank you.

Our goal is

to create completely new random widget and integrate it to clients website outside of the content server Smart View.

Tagged:

Comments

  • PPTX file coming with SDK mentions a file in SDK which you can open on you localhost. See the slide 48http://localhost:7778/doc/csui/models/widget/widget.discussion.html

  • We will play mainly with this code and apply some points from this post

    by Ferdinand Prandlt

  • Some SDK example

  • OK, so I was able to use onReady3 function to start nodestable and favorites view outside of the smart UI. The next step is to figure out, what makes only a few widgets able to integrate to 3rd party application.

    For example. I have developed my own widget in a separate modul. Now, I would like to integrate the widget outside. How this can be done? Any help guys? :)

  • At class long time back we developed a widget and then tested it in Javascript nodejs first.Then we deployed it to CS in a oscript module .Finally one went to a function in Admin.index called Perspective Manager where we could see the widget we developed in class. Are yours showing up there .Are you asking how does one take a simple html and by including lines like /widget?crossorigin=true

    What I think is happening and you can check it yourself is when the line is executed a huge gargantuan file of javascript is downloaded. they are minified so you cant read it so if you take that source and un minify it you will see the functions. I would check if you see your code there :)This is no different than client javascript.

    I didn't know much about Smart

  • Thank you @appuq I am not sure we understand each other. We know how to deploy modules in smart UI. The question is how to integrate our custom development into 3rd party application. There is the way, because nodestable for example can be integrated outside but I am not sure how is this possible.

  • Hey Jakar,

    The easiest way is to to forget all about the Smart UI SDK and just add just open a BWS inside an IFrame.
    That is a good place to start with a Custom Integration

    Usually the harder problem in "get CS into a Leading App" scenario is Authentication and CORS stuff.

    For the simplest implementation, you can get a ticket from OTDS (via REST API) with a OTDS Admin Account. Next get an impersonation ticket (using the first ticket) and the Resource ID for the actual user in the Leading Site/App.

    Once you have ticket for your correct User, you can open CS by using the ticket in the query string

    ?OTDSTicket=<your ticket>


    There are two Smart UI Apps:


    /otcs/llisapi.dll/app/nodes/<bwsID>?OTDSTicket=<>
    vs
    /otcs/llisapi.dll/xecm/xecm/<bwsID>?OTDSTicket=<>

    xecm is a lot better for integrations because it doesn't show the header.


    Once you get it working with IFrame, you can switch to starting the Smart UI directly in your Leading App, but that can be a lot more complex/JavaScript hellscape.


    Regards,

    -MC



  • Hello @Clarke thank you for the TIP. Your suggestion means that user would get an access to the whole content server, right?

    Can you give me a hint how to get token from OTDS? I found an API but it seems that I am not able to use it correctly https://developer.opentext.com/ce/products/opentextdirectoryservices/apis/otds221restapi

    Is there any difference in getting OTDS ticket first and then OTCS from it
    OR
    getting OTCS via CS rest API directly? At the end you always have an impersonated OTCS Ticket, right?

  • The OTDS ticket can be found like this

    and the response then

  • OTDS is a modern api so its developers(AFAIK OT is a glue of many companies many coding practice's) so if your product uses OTDS for authentication then chances are you have a OTDS server available. So the screenshot above shows the standard otds endpoint on a TC server so if you find that endpoint then tack on to it the extra bit otdsws/api/index.html?rest

    Now hit on oauth authorize for the api and then start using the inbuilt utility (CURL) to practice calling the api .I believe this is the swagger documentation that is available in developer.opentext.com .If you use postman you have to remember OTDS understands proper JSON but when you get to CS you need to make sure it is a Form-data post…

    The smartui app of OT is a special kind what it does behind the covers is use your browser to do a SSO with OTDS ,if you put fiddler you can see on first auth it getting a ticket then opening a iframe out of people's views and then using that .Many smartui app integrators use this code to run their app s.It is considerably easier to use a otds ticket and get the users ticket but most likely you may have to device the otds call securely because it has a super user password.

    I thought I will add this tid bit if you are new to CS authentication stuff :)

  • Thank you @Clarke I was able to succesfully use the iframe solution with OTDS ticket to access Smart UI from "outside"

    thank you for your help!


  • Hey Jakar,

    Congrats and glad to hear it!
    That is the best way IMO to get CS into your leading app, esp once you get impersonate working.

    I'
    You can open a Workspace, or you can open a Custom Folder with a Perspective assigned to it (if you want to make your own Custom Page, this is really common say if you want to make a Search Page for the leading app, etc.)

    But def a lot easier to do an IFrame then all the Smart UI jazz.

    Regards,
    -MC