Hi Thisaru, First thing is we need to use SP 4.2.0-rc2 version in order to use > WidgetChannelManager. Otherwise the communication channel will fail >
Do u mean in 4.2.0 released version this does not work ? On Fri, Jul 6, 2018 at 12:47 PM, Thisaru Guruge <[email protected]> wrote: > Hi Nivethika, > > Thanks for the immense support you gave, Now I am able to create the > widget. > > There were some issues I faced when creating the widget, and thought to > share them, and how I resolved them. > > - First thing is we need to use SP 4.2.0-rc2 version in order to use > WidgetChannelManager. Otherwise the communication channel will fail > - Next thing is to define the datastore in the widgetConf.json file. In > the existing solutions in the GitHub does not have such data. > But after the discussion with Nivethika got to know that we should > provide datastore name using "datasourceName": "<DATA_SOURCE_NAME>" under > the providerConfig -> config in the widgetConf.json file. > > Thank you again for the help given in resolving the issues I had. > > On Thu, Jul 5, 2018 at 4:05 PM Niveathika Rajendran <[email protected]> > wrote: > >> Hi Thirasu, >> >> The above information is still not added to the docs. >> >> The functionality behind this is to create a WebSocket connection to the >> data-provider endpoint with a required configuration. The >> documentation @Sajith pointed out has the details on various data provider >> endpoints and the configurations. >> >> You have to do the following steps, >> 1. Access data provider configurations in widgetConf.json file [1] >> 2. Use the base widget API to create WebSocket connection. For this, you >> can use the following APIs, >> >> - Subscribe to the endpoint: >> - syntax : super.getWidgetChannelManager().subscribeWidget(<Widget >> id>, <Call back method to handle data>, <data provider configs>) >> - Example: >> - >> >> super.getWidgetChannelManager() >> .subscribeWidget(this.props.id, this.handleDataReceived, >> dataProviderConfigs)); >> >> >> >> - Unsubscribe to the endpoint >> - syntax: super.getWidgetChannelManager().unsubscribeWidget(<Widget >> ID>); >> - Example: >> - >> >> super.getWidgetChannelManager().unsubscribeWidget(this.props.id); >> >> >> >> @Nisala Nanayakkara <[email protected]> Please add anything I have missed. >> >> @Rukshani Weerasinha <[email protected]> Shall we add the above to the >> documentation, as this will be a blocker to anyone writing custom widgets. >> >> [1] mail thread : [SP] [Solutions] Data provider configurations in >> solution widgets >> >> Best Regards, >> *Niveathika Rajendran,* >> *Software Engineer.* >> *Mobile : +94 077 903 7536* >> >> >> >> >> >> On Thu, Jul 5, 2018 at 3:01 PM Thisaru Guruge <[email protected]> wrote: >> >>> Hi Sajith, >>> >>> Thank you for the reply, but I was trying to create a custom widget, not >>> from the Wizard. >>> >>> On Thu, Jul 5, 2018 at 1:08 PM Sajith Perera <[email protected]> wrote: >>> >>>> Hi, >>>> >>>> Please have a look on the sample doc: https://docs.wso2.com/ >>>> display/SP4xx/Generating+Widgets >>>> >>>> Regards, >>>> SajithD >>>> >>>> On Thu, Jul 5, 2018 at 10:56 AM, Thisaru Guruge <[email protected]> >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> I am looking for a way to retrieve data from a RDBMS to show them in a >>>>> widget in SP dashboard. >>>>> >>>>> I found an example from this link >>>>> <https://github.com/wso2/product-sp/tree/master/modules/solutions/message-tracer/widgets/OpenTracingSearch> >>>>> thanks >>>>> to Nisala, and followed it. But widget is not showing the data. >>>>> >>>>> Is there any documentation where I can refer about this ? >>>>> >>>>> -- >>>>> Thanks and Best Regards, >>>>> Thisaru Guruge >>>>> Software Engineer >>>>> Mobile: +94 71 720 9720 >>>>> >>>>> >>>>> WSO2 Inc.: http://www.wso2.com >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> <http://wso2.com/signature> >>>> Sajith Dimal >>>> Software Engineer >>>> Email : [email protected] >>>> Mobile : +94783101496 >>>> WSO2 Inc. | http://wso2.com >>>> lean.enterprise.middleware >>>> >>> >>> >>> -- >>> Thanks and Best Regards, >>> Thisaru Guruge >>> Software Engineer >>> Mobile: +94 71 720 9720 >>> >>> >>> WSO2 Inc.: http://www.wso2.com >>> >>> >>> > > -- > Thanks and Best Regards, > Thisaru Guruge > Software Engineer > Mobile: +94 71 720 9720 > > > WSO2 Inc.: http://www.wso2.com > > > -- Senior Software Engineer WSO2 Inc.; http://wso2.com <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg> lean.enterprise.middleware mobile: *+94728671315*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
