Logic Machine Forum
Auto-generate widgets in Mozaic/Touch - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Auto-generate widgets in Mozaic/Touch (/showthread.php?tid=1856)



Auto-generate widgets in Mozaic/Touch - Trond Hoyem - 23.01.2019

Hi

I was wondrering, is there a way to generate widgets in Mozaic/touch by scripting? 
My plan is to create a test-functionality in a SL that I will use in projects during testing. That means that the SL have a new project every now and then.

For this I want to create widgets in touch by script. Is there a way to emulate the widget ceration?


RE: Auto-generate widgets in Mozaic/Touch - Daniel - 23.01.2019

Hi
Backup Mosaic and look in to the json file. All is defined there. Each widget must have unique ID.
BR


RE: Auto-generate widgets in Mozaic/Touch - admin - 23.01.2019

Config is saved to storage db in JSON form. You can get/set it like this, storage.get/storage.set cannot be used because of different data format.
Code:
config = storage.exec('get', 'mosaic:config:0')
storage.exec('set', 'mosaic:config:0', config)



RE: Auto-generate widgets in Mozaic/Touch - Trond Hoyem - 23.01.2019

OK, I will have a look at it.

Thanks!


RE: Auto-generate widgets in Mozaic/Touch - Trond Hoyem - 23.01.2019

Took a quick look. It looks like something we can do automatic.

One thing though; is this the ID; "uid":"f44205877ae73ca232650e06833db82c"?
Is this something I can generate myself or must this be added by LM/SL?


RE: Auto-generate widgets in Mozaic/Touch - admin - 23.01.2019

I think uid format does not matter, just that every widget must have a different uid string


RE: Auto-generate widgets in Mozaic/Touch - Trond Hoyem - 23.01.2019

(23.01.2019, 13:46)admin Wrote: I think uid format does not matter, just that every widget must have a different uid string

OK, great! Then I will try to make something.

Thanks for help!