Skip to main content
14-Alexandrite
January 13, 2015
Question

Consuming JAVA libs in ThingWorx

  • January 13, 2015
  • 2 replies
  • 900 views

I am trying to manipulate some MSOffice documents inside TW and found out that an easy way to do it is using Apache POI libs.


My usecase is simple: get a datatable from TW and write it into a named table in Excel.


As I am not able to call them from the Services Javascript, what would be the best way to do it?


I thought maybe I´d have to write an extension for it. If so, is there any documentation or is everthing in the Wiki?]


Thanks

Ewerton

 



    2 replies

    19-Tanzanite
    January 14, 2015

    Hi Ewerton,

    In order to use any Java lib in ThingWorx, you need to create an Extension, in Eclipse.
    If you look in the Wiki, section 09. ThingWorx Extensibility has the documentation you need (description + sample Eclipse Java project).
    As a side note, creating an Extension for ThingWorx, most of the time, means just wrapping the existing functionality from your JARs.
    After some time spent familiarizing yourself with the Object Model of the Extensions (very similar with the TW one) you will see that creating an Extension is very easy, doable in 1-3 days.

    BR,
    Vladimir



    emoreira14-AlexandriteAuthor
    14-Alexandrite
    January 15, 2015

    Thanks for the feedback. I was able to write a basic extension that reads a named range in Excel and writes value on it. Struggled a bit to understand the object model but It is really not that difficult

    Ewerton