Hi,

@Nivethika: +1 for documenting it.
@ Thisaru: If you are using a previous version of SP such as 4.0.0,4.1.0 or
4.2.0-rc1, Please upgrade it to SP 4.2.0-rc2 which is treated as the GA. So
you can use the latest artefacts such as base-widget which will simplify
the widget development.

Thanks,
Nisala

On Mon, Jul 9, 2018 at 11:52 AM Niveathika Rajendran <[email protected]>
wrote:

> Hi Nisala,
>
> Thank you for the explanation, as we have not documented the depended base
> widget version, I thought they should be compatible with all versions of SP.
>
> How about adding a note in SP creating custom widget documentation about
> depended base widget version?
> SP 4.2.0 -> @wso2-dashboards/widget: 1.2.2
> SP 4.1.0 -> @wso2-dashboards/widget: 1.1.0
> SP 4.0.0 -> @wso2-dashboards/widget: 1.1.0
>
> Best Regards,
> *Niveathika Rajendran,*
> *Software Engineer.*
> *Mobile : +94 077 903 7536*
>
>
>
>
>
> On Mon, Jul 9, 2018 at 12:48 AM Nisala Nanayakkara <[email protected]>
> wrote:
>
>> Hi Nivethika,
>>
>> @Damith What Thisaru means is that custom widgets(with a dependency of
>> @wso2-dashboards/widgets:1.2.2) are not backward compatible. It only works
>> in SP 4.2.0
>>
>> AFAIK older widgets which are built for SP 4.0.0/4.1.0, work with SP
>> 4.2.0 release. So the widgets' backward compatibility is preserved. Can you
>> please clarify a bit more about this? As you mentioned earlier,
>> wso2-dashboards/widgets only work with SP 4.2.0 release. Moreover, I think
>> that although there is a requirement to support older widgets with 4.2.0
>> release version, there is no use-case to support widgets which are built
>> for SP 4.2.0 to work with older versions such as SP 4.0.0/4.1.0.
>>
>> Thanks,
>> Nisala
>>
>> On Fri, Jul 6, 2018 at 8:41 PM Niveathika Rajendran <[email protected]>
>> wrote:
>>
>>> @Damith What Thisaru means is that custom widgets(with a dependency of
>>> @wso2-dashboards/widgets:1.2.2) are not backward compatible. It only works
>>> in SP 4.2.0 (SP-4.2.0-rc2 is the successful release candidate, we still
>>> waiting on quarterly release announcement to change the tags). This issue
>>> is only for the getWidgetChannelManager API, other functionalities are
>>> backward compatible. Users essentially need not use the
>>> widgetChannelManager API, as they can create the WebSocket connection
>>> within the custom widget.
>>>
>>> @Nisala & @Lasantha: This is due to a fix made in the latest version, to
>>> reuse WidgetChannelManager passed from the portal app[1]. This makes the
>>> base widget lib dependant upon the portal app. How about a fix such that
>>> base widget will reuse the WidgetChannelManager if passed from the portal
>>> app or will create a new instance of WidgetChannelManger? WDYT?
>>>
>>> [1]
>>> https://github.com/wso2/carbon-dashboards/blob/master/base-widget/src/Widget.jsx#L39
>>>
>>> Best Regards,
>>> *Niveathika Rajendran,*
>>> *Software Engineer.*
>>> *Mobile : +94 077 903 7536*
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Jul 6, 2018 at 6:46 PM Damith Wickramasinghe <[email protected]>
>>> wrote:
>>>
>>>> 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*
>>>>
>>>>
>>
>> --
>> *Nisala Niroshana Nanayakkara,*
>> Senior Software Engineer
>> Mobile | +94 717600022
>> WSO2 Inc | http://wso2.com/
>>
>

-- 
*Nisala Niroshana Nanayakkara,*
Senior Software Engineer
Mobile | +94 717600022
WSO2 Inc | http://wso2.com/
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to