I want to create a custom widget by using the standard widgets code. Please let me know where I can find the JS code of OOTB widgets.
I tried to find it in the path:
<tomcat install location> \webapps\Thingworx\Common\thingworx\widgets
I can only see the images folder here.
The widgets aren't there anymore since, IIRC, ThingWorx 8.5
In ThingWorx 9 you can check the following file `webapps\Thingworx\Common\mashup-common-widgets-builder.js`,
as well as a bunch of other .js files in `webapps\Thingworx\Common `
Also check this GitHub repo https://github.com/ptc-iot-sharing/ThingworxDemoWebpackWidget
Hi @MR_10404102 and team,
If the question is how to create a custom widget, there is some documentation about this in our help center - happy to add it if it is not known. Specifically the PTCS widgets, known as the new widgets, can be extended by following the steps here. Note I did not follow those steps so I can guarantee it works, but I expect it does.
If the question is to look in the source code of the widgets (regardless if they are new/old) you should be aware that in the ThingWorx End User License Agreement in section 2.3 you will see the following excerpt (the line below is shortened for conciseness by me):
"Customer shall not and shall not permit any third party(ies) to:
(iv) disassemble, decompile or reverse engineer the Licensed Products or the file format of the Licensed Products, or otherwise attempt to gain access to the source code or file format of the Licensed Products, except as expressly permitted in Schedule A, if applicable; "
You can consult this License agreement by clicking in ThingWorx Composer on the question mark, then choosing License.
In conclusion, while we might be tempted to reuse or dig in the source code of the PTC's widgets I advise to better try and create your own widgets. If you're looking for examples, there are many out there in GitHub repositories.
An additional note to the GitHub link shared below: ptc-iot-sharing is a PTC presales-led account that contains a variety of repositories that are NOT supported by PTC (like a normal product) and delivered as-is (what this means for you: if you encounter any issue with any of the repositories, you should raise an issue in that repository)