How to define the UI of a ThingsBoard widget using a Json schema? - jsonschema

We're working on an IOT device connected to a ThingsBoard panel.
The goal is that a user must be able to modify the settings of that device in 2 different ways:
Direct connection through wifi
Using a widget on ThingsBoard
The first way has already been implemented. Anyone using a smartphone or computer can connect to the wifi gateway of the device and display the settings in a web browser. Those settings are organized using a Json schema describing the UI of the webpage. The schema is using the standard format react-schema-form.
To implement the ThingsBoard widget, I'd like to use the same schema. That schema would be part of the widget, to describe its UI. Keeping the same schema is obviously to avoid maintaining 2 different definitions of the same settings.
I've been researching a way to do that in a widget but haven't found any answer.
What I want to do is basically the same thing as what the Settings schema of a widget is doing. A Settings schema describes the UI of the settings. And I want to use a schema to describe the main UI of the widget.
The Gateway widget is a good example of what I'm looking for. The UI of that widget is defined into a context ctx, which I guess embed a schema describing that UI. But I'm not sure how to find the schema embedded into ctx, and also not sure if that would help me doing what I want.
So the question is: How to define the UI of a ThingsBoard widget using a Json schema? I will have to declare the schema as a var into the Javascript section of the widget. Then, how to use that var to display the related UI?
Thanks for your help.

Related

Is there built-in authorization mechanism in docusaurus?

Is there any authorization mechanism in docusaurus? In my case not everyone should have access to the documentation
Skimmed through the official documentaion and couldn't find the answer to my question
As far as I know, now it is not possible. For more details take a look at GitHub issue.
To quote the part that is relevant to you:
"Docusaurus builds a static site. IE the content is exactly the same for all users.
If you want different content displayed for different user roles, you have to:
make that content dynamic for each user: ie render it only on the client side by swizzling React components and fetching your dynamic data yourself, like in any React app)
build one different static site per user role, each containing a different set of visible pages. You can use serverless edge functions (Cloudflare Workers for example) to serve one static deployment or another based on the role of the user and pages they can access.
Remember all these are concerns that are outside the scope of Docusaurus. In the end, we just build a static React site."

Modify code created by ArcGIS Web AppBuilder

I'm new with ArcGIS. I have done an app with Web AppBuilder to show a map with layers. When I click on an item layer it shows a pop-up with item info. But I want to show more information that I have to get from a database, depending on the clicked item( it could be a csv file instead of a database if it was easier).
I know how to create a web with the ArcGIS Javascript API (following the tutorials) and I know to create widgets (tutorials too..). I known to create a web with Web AppBuilder. But I don't know how to use Javascript API (for example creating a new layer) modifying the code created by the Web AppBuilder.
My idea was to create the web, map and layers with Web AppBuilder and then make modifications in the generated code using the Javascript API.
What is the best approach to show dynamically obtained information when clicking an item?
Thank you.
If the data you want to show when you click a feature in the map is in the same (geo)database as your layers, you could create a Query Layer to join the data with the layer attributes. You will need to know SQL to do this. Also, you will need to use Arcmap (to publish a Mapserver with the query layer) or Arcgis Pro (to publish a webmap with the query layer) so you can query the data. More on query layers you can find in here.
You probably want to give more details of what exactly you are trying to accomplish, with sample data, so others can provide better answer to your question.

How can we use custom setpoints in CEP

I want to create a dashboard or maybe widgets where a user can add custom setpoints.
These setpoints should be stored for later use creating streaming analytics with CEP.
What would be the (best) approach for this?
Thanks
If these setpoints are related to a device a good approach would be to store them in the device object.
Maybe have a dedicated fragment in the device that is managed by your dashboard widget that will allow the configuration of these setpoints.
From CEP you then can check those fragments by querying the device

creating movie template "on the fly"

i want to develop a site where user selects various videos and site will render a single video containing all videos in a pre-built template.
what would be the way to go about this (in order to create the movie dynamically from site) ?
what would be the server side framework to use ?
can i use after-effects and have site use it to generate such templates (optional - as i have a friend who works with after effects and can create templates) ?
as i am fairly new to the field any additional information is welcomed.
I'm no expert, but I'm pretty sure you can't do what you described.
Rendering a video consumes huge resources (really huge), so a server park that could
handle this is just not worth it.
However, what you can do is to play the selected videos consecutively. That way, no rendering is necessary.
Also, forget about After Effects, for the same reasons described above.
You can achieve what you want by using a new plugin for After Effects called Templater Bot. From Dataclay's site:
Templater Bot is an enterprise solution for custom video on demand. It works as an automated system. Use it to periodically check for incoming data, pull new data in, and render video as a background process. Or use the command line interface to push data in to create new renders. Once your AE project is prepared, use Bot to customize and render it without operating the After Effects user interface. Developers can create front end applications, such as web or mobile apps, that feed data into Templater's data source, offering a collaborative, custom video content creation solution.

Live Data Visualisation

I want to know if there is a simpler and quicker way to visualize dynamic data. The setup that I require is:
An admin web-interface with forms to feed data.
A public web-page with a table and few charts to display data dynamically.
Live and dynamic display of data.
I know python and I am currently learning django framework.
Solutions which don't require programming skills are also welcome.
Any CMS;
Take a look at google's visualization api.
Visualizing the data client-side requires the use of something along the lines of Raphaƫl or jqplot, which you can customize to your specific scenario. You can, however, opt to display charts using images and generate them on the server, then switch the images periodically in Javascript.
The other technical hurdle is the way you get data on the client. Typically, you can implement polling via AJAX (easier) or some push mechanism (Comet, for example, though harder and requires server-side specifics). When you get the data on the client, you simply change out the data on the chart or remove and recreate it. When using images, it is as simple as changing the src property on the images, but requires generating the images on the server.
Highcharts provides some really good examples.
Realtime Plot Highcharts
Mostly AJAX shall suffice,but in case you wish to have a tightly coupled system,using Django-chartit might also be an option
When I setout to something very similar, I found these very useful,
Admin theme : Look at these themes and relatively very inexpensive. Big time savers.
These themes already has some built-in graphs/charts. If you want something more complex, D3 JS impressed me. Also look at kendoUI and sencha UI charts.
You can ofcourse build your portal on django but I'm developing on ruby on rails. Good luck!
If you need live data visualization,the best solution is Google Public Data Explorer http://goo.gl/CWbxO . But first of all ,you should learn about DSPL https://developers.google.com/public-data/overview ,the Dataset Publishing Language describes how your data is organized and how you want to show your data(e.g,bar chart ,line chart ,bubble char or else)
you can upload your data via http://www.google.com/publicdata/admin to upload your dataset
after you successfully upload your data,open it in your Public data adamin,explore the data,and you can get a link on the right ,you can embed the chart in your own website too
the chart is ilve,you can find some examples first,mostly,the x axis is by year,and you can describe it yourself
Here is a example of Google Public Data Explorer. http://goo.gl/yZ5Cj