Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOT tool to send messages to Dweet - https://github.com/apache/openmeetings/issues/102 #103

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

gkrthk
Copy link

@gkrthk gkrthk commented Jul 26, 2020

This PR contains the WB tool added to send IOT messages to Dweet.
Dweet api integration for send message in wb area.

@collisiondetection
Copy link

@solomax any thoughts on this ?

@solomax
Copy link
Contributor

solomax commented Nov 17, 2020

Hello @gkrthk, @collisiondetection

Unfortunately I had no time (yet) to check this PR (mea culpa)
will try to do it next week
please ping me here next Tuesday

@collisiondetection
Copy link

Ok you can check the dweet / message appearing here https://dweet.io/see from OM whiteboard.

@collisiondetection
Copy link

image

@collisiondetection
Copy link

@solomax does it seem ok ?

Copy link
Contributor

@solomax solomax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose to send messages to Dweet?
I mean why would OM users would like to have this new feature?

@@ -163,7 +163,8 @@
<jsSourceFile>raw-tool-arrow.js</jsSourceFile>
<jsSourceFile>raw-tool-clipart.js</jsSourceFile>
<jsSourceFile>raw-wb-board.js</jsSourceFile>
<jsSourceFile>raw-wb-area.js</jsSourceFile>
<jsSourceFile>raw-wb-area.js</jsSourceFile>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not create trailing spaces

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -264,7 +265,7 @@
<jsEngine>CLOSURE</jsEngine>
<jsTargetDir>../generated-sources/main/java/org/apache/openmeetings/web/user/chat</jsTargetDir>
</configuration>
</execution>
</execution>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not create trailing spaces

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -960,4 +960,8 @@ see https://openmeetings.apache.org/LanguageEditor.html for Details
<entry key="wizard.button.finish"><![CDATA[Finish]]></entry>
<entry key="zoom.FULL_FIT"><![CDATA[Full-Fit]]></entry>
<entry key="zoom.PAGE_WIDTH"><![CDATA[Page Width]]></entry>
<entry key="wb.tool.dweet"><![CDATA[Dweet IOT Messaging]]></entry>
<entry key="wb.tool.dweet.mything"><![CDATA[MyThing]]></entry>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear what MyThing should mean

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"MyThing " is the term used by Dweet for an object ( fridge, light ) to be controlled.

To make this clearer for the user we could add an example object in the text field: MyThing: ..Light ...........

@@ -369,6 +370,52 @@ var Wb = function() {
minHeight: 140
, minWidth: 255
});
tools.find('.om-icon.dweet').click(function(){
dweet = OmUtil.tmpl("#wb-dweet");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. OmUtil.tmpl accepts new id as second parameter
  2. please use single quotes for strings

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -369,6 +370,52 @@ var Wb = function() {
minHeight: 140
, minWidth: 255
});
tools.find('.om-icon.dweet').click(function(){
dweet = OmUtil.tmpl("#wb-dweet");
dweet[0].id='wb-dweet' + dweetIDCount++;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is no clear why element ID should be different every time user role is changed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everytime the user clicks on the dweet button a new dweet popup will be opened. One user can have multiple dweet popup's opened to control different IOT things. So giving each popup a unique id so that on submit can handle the specific popup action.

tools.find('.om-icon.dweet').click(function(){
dweet = OmUtil.tmpl("#wb-dweet");
dweet[0].id='wb-dweet' + dweetIDCount++;
dweet[0].style.bottom = '100px';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

styles should go to CSS

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

dweet[0].id='wb-dweet' + dweetIDCount++;
dweet[0].style.bottom = '100px';
dweet[0].style.position= 'absolute';
dweet[0].style[(Settings.isRtl ? 'left' : 'right')] = '100px';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this Settings.isRtl ? 'left' : 'right' code is obsolete
alignment will be changed automatically in case of RTL

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

, minWidth: 255
});
dweet.find('.update-btn').button().click(function() {
var id = $(this.parentElement.parentElement).attr('id');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use let or const instead of var

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -1 +1,20 @@
/* Licensed under the Apache License, Version 2.0 (the "License") http://www.apache.org/licenses/LICENSE-2.0 */
.room-block .sb-wb .wb-block .tools .om-icon.big.dweet::before {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

custom.css is for users
OM CSS should go to correspondent raw-*.css files (most probably to raw-wd.css)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

var request;

var LAST_THING_NAME = "last-thing.dat";
var DWEET_SERVER = "https://dweet.io:443";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt connection to external server will be allowed by CSP

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During our testing on a live site we did not experience any issues with this.

@collisiondetection
Copy link

What is the purpose to send messages to Dweet?
I mean why would OM users would like to have this new feature?

The purpose is to be able to control any object such as an arduino. This will allow students to control robots or doctors to control robot arms. It will allow OM to become an interface to any device that can respond to a dweet.

@collisiondetection
Copy link

@solomax If I upgrade this to work with current OM can you merge ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants