Hi,
I’ve parsed an Excel file on the client using SheetJS and now have a clean JSON spec of the UI (fields, checkboxes, etc.). Next step: generate a Mashup XML from that spec and create the Mashup in ThingWorx automatically.
Results after parsing excel are as below. It gives complete results like how many widgets in one row and then width and height of that widget with all requried details which would be very helpful to now generate a mashupXML
What would you recommend? that how can i now write a file and upload it in thingworx. should i upload this as extension the parse excel code and then get that results in mashup somehow and then bind it to another extension may be in nodejs to do this job for me to write xml and upload in thingworx.. I have confusions about it like how can nodejs create a file and then upload it in thingworx as extension. (i know how NODEJS can create file but in thingworx context i have confusions)
Thank you
Solved! Go to Solution.
Hello,
In ThingWorx Mashups are code, so they have the same lifecycle as Things, Groups, etc. Unless your Excel templates change frequently, you shouldn't load them on your production system dynamically. Thus instead of wrapping it in a ThingWorx extension, I'd make it part of your build process, i.e.
If you don't want to redeploy your app when a template changes, you can still have it as part of a build process, completely outside of ThingWorx, just instead of step (3) above you'd package two extensions -- one with the app, and another one with those generated mashups. This way you can import the second without the first as frequently as you need.
Either way, making it a ThingWorx extension seems like unnecessarily complex route to me. You can have much more flexibility if you do it outside.
As for uploading an extension to ThingWorx via Node.js, I have an example in Bash / curl, hope it helps: https://github.com/vilia-fr/twx-cli/blob/main/twx#L250
/ Constantine
Hello,
In ThingWorx Mashups are code, so they have the same lifecycle as Things, Groups, etc. Unless your Excel templates change frequently, you shouldn't load them on your production system dynamically. Thus instead of wrapping it in a ThingWorx extension, I'd make it part of your build process, i.e.
If you don't want to redeploy your app when a template changes, you can still have it as part of a build process, completely outside of ThingWorx, just instead of step (3) above you'd package two extensions -- one with the app, and another one with those generated mashups. This way you can import the second without the first as frequently as you need.
Either way, making it a ThingWorx extension seems like unnecessarily complex route to me. You can have much more flexibility if you do it outside.
As for uploading an extension to ThingWorx via Node.js, I have an example in Bash / curl, hope it helps: https://github.com/vilia-fr/twx-cli/blob/main/twx#L250
/ Constantine
Hi @MA8731174
If you found the response from Constantine helpful, please mark it as the Accepted Solution for the benefit of other community members.
If you still have questions, please let us know.
Regards.
--Sharon